Skip to content

layout: Make Servo compatible with Stylo with extra preference media query support - #50095

Merged
TimvdLippe merged 1 commit into
servo:mainfrom
TimvdLippe:prefer-media-queries
Nov 20, 2026
Merged

TimvdLippe merged 1 commit into
servo:mainfrom
TimvdLippe:prefer-media-queries

Conversation

@TimvdLippe

@TimvdLippe TimvdLippe commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Make Servo compatible with Stylo with extra preference media query support Obtaining the value from the embedder is left for a follow-up. This makes Servo recognise prefers-contrast, prefers-reduced-transparency, prefers-reduced-motion.

Stylo PR: servo/stylo#528
Fixes: Part of #39068
Supersedes and closes #42011
Supersedes and closes #49958

@TimvdLippe TimvdLippe added the T-linux-wpt Do a try run of the WPT label Nov 20, 2026
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 20, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Nov 20, 2026
@github-actions

Copy link
Copy Markdown

🔨 Triggering try run (#44745759552) for Linux (WPT)

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 20, 2026
@github-actions

Copy link
Copy Markdown

Test results for linux-wpt from try job (#44745759552):

Flaky unexpected result (16)
  • TIMEOUT [expected OK] /IndexedDB/transaction-deactivation-timing.any.html
  • OK /css/CSS2/visudet/inline-block-baseline-with-block-in-inline-001.html (#49559)
    • FAIL [expected PASS] subtest: An inline-block whose last line box holds a block level box exports that line's baseline

      assert_equals: the text after the inline-block is aligned to the inline-block's last line box baseline expected 20 but got 18.35
      

  • FAIL [expected PASS] /css/css-backgrounds/background-size-042.html
  • CRASH [expected PASS] /css/css-font-loading/fontfaceset-worker-fontface-crash.html (#50063)
  • TIMEOUT [expected PASS] /dom/nodes/moveBefore/moveBefore-range-iframe-crash.html
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/cross-origin-top-navigation-with-user-activation-in-parent.window.html (#48205)
    • FAIL [expected TIMEOUT] subtest: Cross-origin top navigation is blocked without user activation, even if the parent has user activation

      assert_equals: expected "Denied" but got "Allowed"
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/refresh/same-document-refresh.html (#34597)
    • FAIL [expected PASS] subtest: Same-Document Referrer from Refresh

      assert_equals: original page loads expected "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh-with-section.sub.html?url=%23section" but got "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh-with-section.sub.html?url=%23section#section"
      

  • TIMEOUT /html/browsers/history/the-history-interface/001.html (#12580)
    • FAIL [expected PASS] subtest: traversing history must also traverse hash changes

      assert_equals: (this could cause other failures later on) expected "" but got "test"
      

  • CRASH [expected TIMEOUT] /html/browsers/origin/inheritance/about-blank-iframe-navigated-by-ancestor.window.html?same-origin&5-last
  • OK /html/semantics/scripting-1/the-script-element/execution-timing/077.html (#22139)
    • FAIL [expected PASS] subtest: adding several types of scripts through the DOM and removing some of them confuses scheduler

      assert_array_equals: expected property 1 to be "Script #1 ran" but got "Script #3 ran" (expected array ["Script #2 ran", "Script #1 ran", "Script #3 ran", "Script #4 ran"] got ["Script #2 ran", "Script #3 ran", "Script #4 ran", "Script #1 ran"])
      

  • TIMEOUT [expected OK] /html/user-activation/navigation-state-reset-sameorigin.html (#45151)
    • TIMEOUT [expected FAIL] subtest: Post-navigation state reset.

      Test timed out
      

  • FAIL [expected PASS] /mathml/presentation-markup/operators/mo-form-dynamic-002.html (#49169)
  • PASS [expected FAIL] /mathml/presentation-markup/operators/operator-dictionary-empty-and-three-chars.html (#49173)
  • TIMEOUT [expected OK] /webdriver/tests/classic/element_click/scroll_into_view.py
  • OK [expected TIMEOUT] /webdriver/tests/classic/perform_actions/navigation.py (#38822)
  • OK /webdriver/tests/classic/perform_actions/pointer_mouse.py (#49662)
    • FAIL [expected PASS] subtest: test_down_closes_browsing_context[without up]

      Failed: DID NOT RAISE <class 'webdriver.error.NoSuchWindowException'>
      

Stable unexpected results that are known to be intermittent (16)
  • OK /beacon/beacon-basic.https.window.html (#41723)
    • FAIL [expected PASS] subtest: Payload size restriction should be accumulated: type = blob

      assert_false: expected false got true
      

  • OK /css/CSS2/floats/float-in-block-in-inline-position-001.html (#49534)
    • FAIL [expected PASS] subtest: A line after a bordered block containing a float avoids it at the block's position (sibling)

      assert_equals: the line's block-axis position expected 108 but got 106.35000000000002
      

  • OK /css/CSS2/floats/floats-in-inline-content-intrinsic-size-001.html (#49728)
    • FAIL [expected PASS] subtest: An empty float next to text (emptyFloatAndText, min-content)

      assert_equals: expected 70 but got 50
      

  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-weight: '400' should prefer '450 460' over '500'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

    • FAIL [expected PASS] subtest: Matching font-weight: '430' should prefer '450 460' over '500'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

    • FAIL [expected PASS] subtest: Matching font-stretch: '110%' should prefer '50% 80%' over '60% 70%'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

    • FAIL [expected PASS] subtest: Matching font-style: 'oblique 0deg' should prefer 'oblique 30deg 60deg' over 'oblique 40deg 50deg'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

    • FAIL [expected PASS] subtest: Matching font-style: 'oblique -21deg' should prefer 'oblique -60deg -40deg' over 'oblique -10deg'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

  • OK [expected TIMEOUT] /dom/xpath-evaluation-detached-nodes.html (#49715)
  • OK [expected TIMEOUT] /fetch/api/redirect/redirect-keepalive.https.any.html (#32153)
    • PASS [expected TIMEOUT] subtest: [keepalive][iframe][load] mixed content redirect; setting up
  • OK [expected ERROR] /focus/focus-event-after-switching-iframes.sub.html (#40368)
  • TIMEOUT [expected ERROR] /html/browsers/history/the-location-interface/location_replace_session_history.html (#41896)
  • TIMEOUT [expected OK] /html/browsers/windows/consume-user-activation/window-open-multi-global.html (#47399)
    • TIMEOUT [expected FAIL] subtest: window.open() and consuming user activation with multiple globals in play

      Test timed out
      

  • OK /html/semantics/embedded-content/media-elements/playing-the-media-resource/fragmented-mp4-end.html (#48349)
    • FAIL [expected PASS] subtest: fragmented-mp4-end

      assert_equals: Expected seeked event, but got error event instead expected "seeked" but got "error"
      

  • OK /html/semantics/embedded-content/media-elements/playing-the-media-resource/loop-from-ended.tentative.html (#33778)
    • FAIL [expected PASS] subtest: play() with loop set to true after playback ended

      assert_true: ended at ended event expected true got false
      

  • OK /html/webappapis/user-prompts/print-during-unload.html (#35944)
    • FAIL [expected PASS] subtest: print() during unload

      assert_array_equals: expected property 1 to be "destination" but got "error: window.print is not a function" (expected array ["start", "destination"] got ["start", "error: window.print is not a function"])
      

  • PASS [expected FAIL] /mathml/presentation-markup/operators/mo-lspace-rspace-dynamic.html (#49168)
  • ERROR [expected TIMEOUT] /performance-timeline/not-restored-reasons/abort-block-bfcache.window.html (#42802)
  • OK /pointerevents/pointerevent_pointercapture_in_frame.html?pen (#45536)
    • PASS [expected FAIL] subtest: Test penpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture.
    • PASS [expected FAIL] subtest: Test penpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture to outer frame should not capture.
  • OK /preload/prefetch-document.html (#37210)
    • PASS [expected FAIL] subtest: different-site document prefetch with 'as=document' should not be consumed
Stable unexpected results (1)
  • OK /_mozilla/css/css-property-listing.html
    • FAIL [expected PASS] subtest: Web-exposed CSS shorthands

      assert_object_equals: property "121" expected "fill-rule" got "stroke-linecap"
      

@github-actions

Copy link
Copy Markdown

⚠️ Try run (#44745759552) failed!

…query support

Make Servo compatible with Stylo with extra preference media query support

Obtaining the value from the embedder is left for a follow-up.

This makes Servo recognise `prefers-contrast`, `prefers-reduced-transparency`, `prefers-reduced-motion`.

Stylo PR: servo/stylo#528

Part of servo#39068
Supersedes and closes servo#42011

Co-authored-by: Luke Warlow <[email protected]>
Signed-off-by: Tim van der Lippe <[email protected]>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 20, 2026
@TimvdLippe
TimvdLippe enabled auto-merge November 20, 2026 14:47
@TimvdLippe
TimvdLippe added this pull request to the merge queue Nov 20, 2026
@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 20, 2026
Merged via the queue into servo:main with commit 534ae6c Nov 20, 2026
38 checks passed
@TimvdLippe
TimvdLippe deleted the prefer-media-queries branch November 20, 2026 17:32
@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 20, 2026
staging-devin-ai-integration Bot pushed a commit to DioxusLabs/stylo that referenced this pull request Nov 20, 2026
This adds `prefers-contrast`, `prefers-reduced-motion`, and
`prefers-reduced-transparency`.

Rebased and updated version of servo#288

Supersedes and closes servo#288

Servo PR: servo/servo#50095

Signed-off-by: Tim van der Lippe <[email protected]>
Co-authored-by: Luke Warlow <[email protected]>
@servo-highfive

Copy link
Copy Markdown

Someone thinks this change could be added to the monthly blog post! To help with this, we need someone to answer the following questions: 😄

  1. Who is most impacted by this change: users, Servo developers, embedders, or some other group?
  2. What observable difference does this change make?
  3. What preferences (if any) need to be enabled to observe this difference?
  4. What (if any) specific URLs are affected?

If this change is part of a broader feature/project please make sure the PR description contains a Fixes: #12345 or Part of: #12345 issue reference.

Please add @servo-highfive monthly update answer when answering these questions so the bot notices your answer (or just quote this comment).

Thanks for helping us prepare the monthly blog post! ❤️

@TimvdLippe

Copy link
Copy Markdown
Contributor Author
  1. Users
  2. Servo now supports all prefers-* media queries. This PR adds support for prefers-contrast, prefers-reduced-transparency and prefers-reduced-motion
  3. n/a
  4. n/a

@servo-highfive monthly update answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

monthly update 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.

3 participants