Repository navigation
Recompute styles on viewport size change if they contain viewport percentages - #9876
Conversation
|
Heads up! This PR modifies the following files:
|
| rules: vec![CSSRule::Viewport(translated_rule)], | ||
| origin: Origin::Author, | ||
| media: None, | ||
| depends_on_viewport_size: true, |
There was a problem hiding this comment.
On second thought, maybe this stylesheet (one that contains a generated @viewport rule) should have the flag set to false, since viewport constraints are already recalculated on resize and shouldn't require the whole page to be recomputed.
070b1fd to
88d9b65
Compare
|
The And the To sum up, I think that this PR is correct but that we can do better (possibly later in follow ups) to avoid no-op work. Maybe tracking which elements (rather than which stylesheets) are affected by Reviewed 3 of 3 files at r2. components/style/selector_matching.rs, line 228 [r2] (raw file): Comments from the review on Reviewable.io |
88d9b65 to
7cc42c3
Compare
Yes, I agree. Review status: 2 of 3 files reviewed at latest revision, 2 unresolved discussions. components/style/selector_matching.rs, line 228 [r2] (raw file): Comments from the review on Reviewable.io |
|
r=me, pending servo/rust-cssparser#99 Reviewed 1 of 1 files at r3. Comments from the review on Reviewable.io |
d3d424d to
f4598fc
Compare
|
@bors-servo r=SimonSapin |
|
📌 Commit f4598fc has been approved by |
Recompute styles on viewport size change if they contain viewport percentages Fixes #8754. Depends on servo/rust-cssparser#99. r? @SimonSapin <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9876) <!-- Reviewable:end -->
|
💔 Test failed - linux-dev |
|
f4598fc to
25c1bce
Compare
|
@bors-servo r=SimonSapin fixed the unit test error |
|
📌 Commit 25c1bce has been approved by |
Recompute styles on viewport size change if they contain viewport percentages Fixes #8754. Depends on servo/rust-cssparser#99. r? @SimonSapin <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9876) <!-- Reviewable:end -->
|
☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, status-appveyor |
This is a follow-up to servo#9876. It avoids clearing and rebuilding SelectorMaps when vh and vw units need to be recomputed. Instead it just dirties all nodes, to force elements to be re-cascaded. Filed servo#10104 for later follow-up work to dirty only affected nodes.
Don't re-add stylesheets to recompute vw/vh lengths This is a follow-up to #9876. It avoids clearing and rebuilding SelectorMaps when vh and vw units need to be recomputed. Instead it just dirties all nodes, to force elements to be re-cascaded. Filed #10104 for later follow-up work to dirty only affected nodes. r? @SimonSapin <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10105) <!-- Reviewable:end -->
Fixes #8754. Depends on servo/rust-cssparser#99. r? @SimonSapin