Skip to content

script: Eagerly update the Device in Layout when it changes#40432

Merged
mrobinson merged 1 commit intoservo:mainfrom
mrobinson:update-device-immediately
Nov 5, 2025
Merged

script: Eagerly update the Device in Layout when it changes#40432
mrobinson merged 1 commit intoservo:mainfrom
mrobinson:update-device-immediately

Conversation

@mrobinson
Copy link
Copy Markdown
Member

@mrobinson mrobinson commented Nov 5, 2025

Instead of waiting for a reflow to update the Device in layout, update
it eagerly. This ensures that media queries can be answered correctly in
script before the next reflow. Also, it ensure that a new reflow is
triggered and reflects the change to the theme or viewport.

In addition, an unused viewport-related message from the Constellation
is removed. This would have needed to be updated by change, but since
it's unused I've just removed it.

This depends on servo/stylo#260.

Testing: This fixes a WebView API test and improves
/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html.

Fixes: #40395.
Fixes: #40129.

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 5, 2025
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 5, 2025
@mrobinson mrobinson force-pushed the update-device-immediately branch from 0c5b2b0 to d29be5f Compare November 5, 2025 18:49
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 5, 2025
@mrobinson mrobinson enabled auto-merge November 5, 2025 18:49
@mrobinson mrobinson added this pull request to the merge queue Nov 5, 2025
@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 Nov 5, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 5, 2025
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Nov 5, 2025
Instead of waiting for a reflow to update the `Device` in layout, update
it eagerly. This ensures that media queries can be answered correctly in
script before the next reflow. Also, it ensure that a new reflow is
triggered and reflects the change to the theme or viewport.

In addition, an unused viewport-related message from the Constellation
is removed. This would have needed to be updated by change, but since
it's unused I've just removed it.

Signed-off-by: Martin Robinson <[email protected]>
@mrobinson mrobinson force-pushed the update-device-immediately branch from d29be5f to 294a125 Compare November 5, 2025 21:10
@servo-highfive servo-highfive removed the S-tests-failed The changes caused existing tests to fail. label Nov 5, 2025
@mrobinson mrobinson enabled auto-merge November 5, 2025 21:12
@mrobinson mrobinson added this pull request to the merge queue Nov 5, 2025
@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 Nov 5, 2025
Merged via the queue into servo:main with commit fd54ce9 Nov 5, 2025
33 checks passed
@mrobinson mrobinson deleted the update-device-immediately branch November 5, 2025 22:17
@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 Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Theme is Ignored and always show light mode WebView test_theme_change is failing

3 participants