script: Always dirty nodes when changing node state#39102
Merged
mrobinson merged 1 commit intoservo:mainfrom Sep 3, 2025
Merged
script: Always dirty nodes when changing node state#39102mrobinson merged 1 commit intoservo:mainfrom
mrobinson merged 1 commit intoservo:mainfrom
Conversation
With incremental layout adding a restyle to a node isn't enough to force its layout to update. We also need to explicitly mark the node as dirty so that its contents are updated when layout is run. This change makes this consistent for all node state changes. This might be a bit too conservative as all node state may not affect layout, but should catch issues in the future. Signed-off-by: Martin Robinson <[email protected]>
mukilan
approved these changes
Sep 3, 2025
Loirooriol
added a commit
to Loirooriol/servo
that referenced
this pull request
Nov 26, 2025
When for example changing the hover state of an element, we were dirtying it with ContentOrHeritage damage, which forced it to be laid out again. This was added in servo#39102 in order to fix servo#38989, but it's no longer needed. Co-authored-by: Martin Robinson <[email protected]> Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol
added a commit
to Loirooriol/servo
that referenced
this pull request
Nov 28, 2025
When for example changing the hover state of an element, we were dirtying it with ContentOrHeritage damage, which forced it to be laid out again. This was added in servo#39102 in order to fix servo#38989, but it's no longer needed. Co-authored-by: Martin Robinson <[email protected]> Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol
added a commit
to Loirooriol/servo
that referenced
this pull request
Nov 28, 2025
When for example changing the hover state of an element, we were dirtying it with ContentOrHeritage damage, which forced it to be laid out again. This was added in servo#39102 in order to fix servo#38989, but it's no longer needed. Co-authored-by: Martin Robinson <[email protected]> Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol
added a commit
to Loirooriol/servo
that referenced
this pull request
Nov 28, 2025
When for example changing the hover state of an element, we were dirtying it with ContentOrHeritage damage, which forced it to be laid out again. This was added in servo#39102 in order to fix servo#38989, but it's no longer needed. Co-authored-by: Martin Robinson <[email protected]> Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol
added a commit
to Loirooriol/servo
that referenced
this pull request
Dec 1, 2025
When for example changing the hover state of an element, we were dirtying it with ContentOrHeritage damage, which forced it to be laid out again. This was added in servo#39102 in order to fix servo#38989, but it's no longer needed. Co-authored-by: Martin Robinson <[email protected]> Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol
added a commit
to Loirooriol/servo
that referenced
this pull request
Dec 1, 2025
When for example changing the hover state of an element, we were dirtying it with ContentOrHeritage damage, which forced it to be laid out again. This was added in servo#39102 in order to fix servo#38989, but it's no longer needed. Co-authored-by: Martin Robinson <[email protected]> Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol
added a commit
to Loirooriol/servo
that referenced
this pull request
Dec 1, 2025
When for example changing the hover state of an element, we were dirtying it with ContentOrHeritage damage, which forced it to be laid out again. This was added in servo#39102 in order to fix servo#38989, but it's no longer needed. Co-authored-by: Martin Robinson <[email protected]> Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol
added a commit
to Loirooriol/servo
that referenced
this pull request
Dec 2, 2025
When for example changing the hover state of an element, we were dirtying it with ContentOrHeritage damage, which forced it to be laid out again. This was added in servo#39102 in order to fix servo#38989, but it's no longer needed. Co-authored-by: Martin Robinson <[email protected]> Signed-off-by: Oriol Brufau <[email protected]>
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 2, 2025
…#40902) When for example changing the hover state of an element, we were dirtying it with ContentOrHeritage damage, which forced it to be laid out again. This was added in #39102 in order to fix #38989, but for the most part it's no longer needed. However, we will now dirty when a `<textarea>` or `<input>` which can be selected gets or loses focus. This is to ensure that the caret or selections get correctly updated. Testing: Manually tested that #38989 is not regressing Signed-off-by: Oriol Brufau <[email protected]> Co-authored-by: Martin Robinson <[email protected]>
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.
With incremental layout adding a restyle to a node isn't enough to force
its layout to update. We also need to explicitly mark the node as dirty
so that its contents are updated when layout is run. This change makes
this consistent for all node state changes. This might be a bit too
conservative as all node state may not affect layout, but should catch
issues in the future.
Testing: This is very hard to test as it requires moving the mouse over the
WebView, and the moving it away, and then testing the rendered contents. This
kind of coordination would be difficult to manage with unit tests.
Fixes: #38989.