script: Iterate over correct collections when moving#44347
Merged
Conversation
Several times, we first need to capture the relevant nodes, perform a step and then iterate over the nodes. Previously, we would iterate over it, but the iterator could have moved, hence we would jump over some nodes. Instead, capture these beforehand and then iterate over them. Also fixes the issue where text-decoration wasn't properly checked, since its a shorthand for 3 longhands. And a PropertyDeclarationBlock only has longhands. The two regressions are for tests that now generate the correct HTML, but their ranges are incorrectly moved from the `a` to the `b`. I went through the relevant algorithms and didn't spot the mistake. To keep on making babysteps towards a full implementation, I will tackle these in a follow-up. These algorithms are already difficult enough to reason about. Part of servo#25005 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
jdm
approved these changes
Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several times, we first need to capture the relevant nodes, perform a step and then iterate over the nodes. Previously, we would iterate over it, but the iterator could have moved, hence we would jump over some nodes.
Instead, capture these beforehand and then iterate over them.
Also fixes the issue where text-decoration wasn't properly checked, since its a shorthand for 3 longhands. And a PropertyDeclarationBlock only has longhands.
The two regressions are for tests that now generate the correct HTML, but their ranges are incorrectly moved from the
ato theb. I went through the relevant algorithms and didn't spot the mistake. To keep on making babysteps towards a full implementation, I will tackle these in a follow-up. These algorithms are already difficult enough to reason about.Part of #25005
Testing: WPT