Skip to content

layout: Simplify the way that document selection is handled in traversals - #46762

Merged
jdm merged 1 commit into
servo:mainfrom
mrobinson:simplify-document-text-selection
Jul 24, 2026
Merged

jdm merged 1 commit into
servo:mainfrom
mrobinson:simplify-document-text-selection

Conversation

@mrobinson

Copy link
Copy Markdown
Member

Instead of eagerly passing the document selection range in the DOM
traveral, only fetch it when necessary before pushing text into an
InlineFormattingContextBuilder. This greatly simplifies the traversal
handler signatures and makes the code more straight-foward in other
places as well (removing ~70 lines of code).

Testing: This should not change behavior so is covered by existing tests.

…sals

Instead of eagerly passing the document selection range in the DOM
traveral, only fetch it when necessary before pushing text into an
`InlineFormattingContextBuilder`. This greatly simplifies the traversal
handler signatures and makes the code more straight-foward in other
places as well (removing ~70 lines of code).

Signed-off-by: Martin Robinson <[email protected]>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 24, 2026

@jdm jdm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, much simpler. Pour one out for my atomic refcell text PR rebasing over this again :)

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Jul 24, 2026
@jdm
jdm added this pull request to the merge queue Jul 24, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 24, 2026
Merged via the queue into servo:main with commit a2e175a Jul 24, 2026
34 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants