-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vh and vw units are not recalculated after window resize #8754
Comments
As might be expected, this is also affecting the positioning of child elements (test case). |
Workaround for servo/servo#8754
Works around servo/servo#8754
Currently Stylist::set_device sets its This |
Alternately we could change the types like |
I’d rather not do that. It would add significant complexity everywhere in the layout code: when accessing any length from the style system, any piece of layout code would need to also have access to the viewport size and call something to resolve to an absolute length. |
Layout code can access the viewport size pretty easily because it's part of the LayoutContext, which we already thread through all of the layout traversals.
We need to do this anyway because of percentage lengths. |
Not every This also deviates from the spec, and although I haven’t managed to come up with a case where the difference is observable I don’t know if they don’t exist. (The computed value is what’s inherited, and any property can take the value |
Used to tell Servo to recalulate styles on window resize (servo/servo#8754).
Used to tell Servo to recalulate styles on window resize (servo/servo#8754).
Record whether viewport percentage dimensions are seen Used to tell Servo to recalulate styles on window resize (servo/servo#8754). r? @SimonSapin <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/rust-cssparser/99) <!-- Reviewable:end -->
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 -->
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 -->
vh
andvw
units are not recalculated after a window resize. Here's a minimal test case.- This issue is present in both normal and "browser.html" modes. - This issue is **not** present with percentage-based sizes ([test case](https://gordonbrander.github.io/servo-testcases/resize-percent/))
The text was updated successfully, but these errors were encountered: