Box tree construction: only unset pseudo elements if the box is rebuilt#39930
Conversation
|
Can you write an automated test for this? |
cacab52 to
1cc1b12
Compare
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#55540) with upstreamable changes. |
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#55540). |
1cc1b12 to
a5cda0d
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#55540). |
There was a problem hiding this comment.
It should be possible to write a test without testdriver.js. We want an action that triggers reflow but not recollection, which can be done by style change.
I haven't checked this part of code for a while, what do you think? @mrobinson
I also think it's better if we don't need to use testdriver. However, right now I only know this way to reproduce the issue. |
stevennovaryo
left a comment
There was a problem hiding this comment.
I am afraid the test with Pointer might be too unstable and complex, primarily due to Webdriver implementations and difference in reflowing. We might need a to look why it is happening in the first place and more general case.
| <!DOCTYPE html> | ||
| <meta charset="utf-8"> | ||
| <title>::before transition keeps updating while pointer moves to another element (IntersectionObserver)</title> | ||
| <link rel="help" href="https://drafts.csswg.org/css-transitions/"> |
There was a problem hiding this comment.
| <link rel="help" href="https://drafts.csswg.org/css-transitions/"> | |
| <link rel="author" title="<your name>" href="mailto:<your email>@gmail.com"> |
Please add the contact.
| <title>::before transition keeps updating while pointer moves to another element (IntersectionObserver)</title> | ||
| <link rel="help" href="https://drafts.csswg.org/css-transitions/"> | ||
| <link rel="help" href="https://w3c.github.io/IntersectionObserver/"> | ||
| <meta name="assert" content="Moving pointer to another element does not freeze a ::before width transition on the host; host keeps expanding until it intersects the other element."> |
There was a problem hiding this comment.
| <meta name="assert" content="Moving pointer to another element does not freeze a ::before width transition on the host; host keeps expanding until it intersects the other element."> | |
| <link rel="help" href="https://github.com/servo/servo/issues/39225"/> |
You could also add the issue reference.
There was a problem hiding this comment.
Thank you, I updated.
|
I am wondering whether we have unit tests for incremental layout. If not, whether it is plausible to introduce it or not? |
|
Or, @longvatrong111 can you move the test to the folder which won't export to upstream? This might be vulnerable to future UA stylesheet change tho.. |
Only certain style changes cause a rebuilding of the box tree. You can see what kind of damage style changes inflict here: https://github.com/servo/stylo/blob/main/style/servo/restyle_damage.rs#L152. |
components/layout/dom_traversal.rs
Outdated
| ) { | ||
| element.unset_all_pseudo_boxes(); | ||
| let damage = element.take_restyle_damage(); | ||
| if damage.contains(LayoutDamage::recollect_box_tree_children().into()) { |
There was a problem hiding this comment.
| if damage.contains(LayoutDamage::recollect_box_tree_children().into()) { | |
| if damage.has_box_damage() { |
There was a problem hiding this comment.
I think it's reasonable.
Interesting, I tried all 4 levels of style change but still can't reproduce the issue... |
a5cda0d to
03992ad
Compare
|
🤖 This change no longer contains upstreamable changes to WPT; closed existing upstream pull request (web-platform-tests/wpt#55540). |
Signed-off-by: batu_hoang <[email protected]>
f540159 to
8a582eb
Compare
Seem like using pointer is the only way now.
It's reasonable. |
8a582eb to
c91c426
Compare
Signed-off-by: batu_hoang <[email protected]>
c91c426 to
2fd5580
Compare
|
@longvatrong111 It seems this test is stably failing now, but the original issue is already gone. |
Box Tree re-construction may cause the loss of pseudo element: #39225 (comment), then causes transition stucks.
We should only unset pseudo elements if the box is rebuilt.
Testing: fix manual test in #39225, CI reports no regression: action
Fixes: #39225
cc: @xiaochengh