Skip to content

script/paint: Make scroll ranges sensitive to writing modes - #49891

Merged
mrobinson merged 1 commit into
servo:mainfrom
mrobinson:script-paint-make-scroll-range-writing-mode-sensitive
Nov 17, 2026
Merged

mrobinson merged 1 commit into
servo:mainfrom
mrobinson:script-paint-make-scroll-range-writing-mode-sensitive

Conversation

@mrobinson

Copy link
Copy Markdown
Member

This change makes various fixes to ensure that scroll ranges are
sensitive to the writing mode of their scrolling boxes. Scroll ranges
should be clamped to the edges of the content box, even if they extent
into negative values beyond the edges of the scrolling box (for RTL writing
modes). In addition, start and end scroll targets are now sensitive to
the writing mode (flipping in the case of RTL). Finally, scroll
positions queries no longer call abs() on their values, reflecting the
fact that scroll positions can be negative.

Testing: Change causes various WPT tests to start passing and one to start
failing due to us not implementing the resolution from w3c/csswg-drafts#12289
yet.

This change makes various fixes to ensure that scroll ranges are
sensitive to the writing mode of their scrolling boxes. Scroll ranges
should be clamped to the edges of the content box, even if they extent
into negative values beyond the edges of the scrolling box (for RTL writing
modes). In addition, start and end scroll targets are now sensitive to
the writing mode (flipping in the case of RTL). Finally, scroll
positions queries no longer call `abs()` on their values, reflecting the
fact that scroll positions can be negative.

Signed-off-by: Martin Robinson <[email protected]>
Co-authored-by: Oriol Brufau <[email protected]>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 13, 2026
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 16, 2026
@mrobinson
mrobinson added this pull request to the merge queue Nov 17, 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 17, 2026
@github-actions

Copy link
Copy Markdown

Test results for linux-wpt from merge queue job (#44057723860):

Flaky unexpected result (25)
  • CRASH [expected OK] /content-security-policy/frame-ancestors/frame-ancestors-nested-same-in-same-star-allow.html
  • TIMEOUT [expected CRASH] /content-security-policy/inheritance/blob-url-in-main-window-self-navigate-inherits.sub.html (#41490)
  • FAIL [expected PASS] /css/css-backgrounds/background-size-042.html
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-style: 'oblique 10deg' should prefer 'oblique 5deg' over 'oblique 15deg 20deg'

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

  • OK /dom/nodes/moveBefore/iframe-document-preserve.window.html (#43152)
    • FAIL [expected PASS] subtest: moveBefore(): cross-origin iframe is preserved: remove self via innerHTML

      assert_equals: iframe does not fire a second load event expected 1 but got 0
      

  • TIMEOUT [expected PASS] /dom/nodes/moveBefore/moveBefore-range-iframe-crash.html
  • OK /fetch/h1-parsing/h1-parsing.tentative.html?include=after-value
    • PASS [expected FAIL] subtest: COLON at &lt;after-value&gt; should result in Network Error frame
  • 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/semantics/embedded-content/media-elements/media_fragment_seek.html (#24114)
    • FAIL [expected PASS] subtest: Video should seek to time specified in media fragment syntax

      assert_equals: expected 4 but got 0
      

  • TIMEOUT /html/semantics/embedded-content/media-elements/preserves-pitch.html (#49303)
    • PASS [expected TIMEOUT] subtest: Speed-ups should not change the pitch when preservesPitch=true
    • TIMEOUT [expected NOTRUN] subtest: Slow-downs should not change the pitch when preservesPitch=true

      Test timed out
      

  • CRASH [expected FAIL] /html/semantics/forms/the-select-element/customizable-select/select-appearance-button-after-span.html
  • PASS [expected FAIL] /mathml/presentation-markup/operators/mo-lspace-rspace-dynamic.html (#49168)
  • PASS [expected FAIL] /mathml/presentation-markup/operators/operator-dictionary-empty-and-three-chars.html (#49173)
  • CRASH [expected OK] /mixed-content/gen/srcdoc-inherit.meta/opt-in/object-tag.https.html
  • OK /mixed-content/tentative/autoupgrades/video-upgrade.https.sub.html (#41135)
    • FAIL [expected PASS] subtest: Video autoupgraded

      assert_equals: Length. expected 1 but got Infinity
      

  • TIMEOUT [expected OK] /pointerevents/compat/pointerevent_touch-action_two-finger_interaction.html
    • NOTRUN [expected PASS] subtest: touch two-finger pan on 'touch-action: pan-x pan-y'
    • NOTRUN [expected FAIL] subtest: touch two-finger pan on 'touch-action: pinch-zoom'
  • 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 /webdriver/tests/classic/back/user_prompts.py (#49983)
    • FAIL [expected PASS] subtest: test_dismiss_and_notify[alert-None]

      AssertionError: assert 'about:blank' == 'https://web-platform.test:8443/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%3Cp+id%3D2%3E&amp;mime=text%2Fhtml&amp;charset=UTF-8'
      

  • OK /webdriver/tests/classic/delete_all_cookies/delete.py
    • ERROR [expected FAIL] subtest: test_no_browsing_context

      setup error: webdriver.error.NoSuchElementException: no such element (404)
      

  • OK /webdriver/tests/classic/delete_cookie/delete.py
    • ERROR [expected FAIL] subtest: test_no_browsing_context

      setup error: webdriver.error.NoSuchElementException: no such element (404)
      

  • OK /webdriver/tests/classic/dismiss_alert/dismiss.py (#39098)
    • ERROR [expected PASS] subtest: test_no_browsing_context

      setup error: webdriver.error.NoSuchElementException: no such element (404)
      

  • OK /webdriver/tests/classic/get_window_handles/get.py
    • ERROR [expected PASS] subtest: test_no_browsing_context

      setup error: webdriver.error.NoSuchElementException: no such element (404)
      

  • OK /webdriver/tests/classic/navigate_to/navigate.py
    • ERROR [expected PASS] subtest: test_no_browsing_context

      setup error: webdriver.error.NoSuchElementException: no such element (404)
      

  • OK /webdriver/tests/classic/switch_to_frame/switch.py
    • ERROR [expected FAIL] subtest: test_no_browsing_context[id2]

      setup error: webdriver.error.NoSuchElementException: no such element (404)
      

  • OK /webxr/xrSession_features_deviceSupport.https.html (#24357)
    • FAIL [expected PASS] subtest: Immersive XRSession requests with no supported device should reject

      assert_unreached: Should have rejected: undefined Reached unreachable code
      

Stable unexpected results that are known to be intermittent (10)
  • 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/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
      

  • CRASH [expected TIMEOUT] /dom/xpath-evaluation-detached-nodes.html (#49715)
  • 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"
      

  • TIMEOUT [expected ERROR] /html/browsers/history/the-location-interface/location_replace_session_history.html (#41896)
  • OK /infrastructure/testdriver/click_window.html (#47303)
    • FAIL [expected PASS] subtest: TestDriver click method in window

      Unhandled rejection: assert_unreached: click failed Reached unreachable code
      

  • CRASH [expected TIMEOUT] /performance-timeline/not-restored-reasons/abort-block-bfcache.window.html (#42802)
  • OK /preload/prefetch-document.html (#37210)
    • PASS [expected FAIL] subtest: different-site document prefetch with 'as=document' should not be consumed
  • OK /user-timing/measure_associated_with_navigation_timing.html (#47273)
    • FAIL [expected PASS] subtest: loadTime plus loadEventEnd to a mark "a" should equal to navigationStart to "a".

      assert_equals: loadTime plus loadEventEnd to a mark "a" should equal to navigationStart to "a". expected 15.01 but got 15
      

Merged via the queue into servo:main with commit 76654a8 Nov 17, 2026
38 checks passed
@mrobinson
mrobinson deleted the script-paint-make-scroll-range-writing-mode-sensitive branch November 17, 2026 11:06
@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 17, 2026
SimonSapin pushed a commit to SimonSapin/servo that referenced this pull request Nov 26, 2026
…rvo#50243)

Continues servo#49891 to fix the scroll range of the viewport. When the
viewport has a RTL direction, then the viewport is initially scrolled to
the right, and scrolling to the left means getting into negative scroll
coordinates.

Before this patch, the initial scroll position was correct, but then,
instead of allowing to scroll to the left, we were instead allowing to
scroll further into the right, despite already being at the end.

Testing: Adding a test
Fixes: servo#50242

Signed-off-by: Oriol Brufau <[email protected]>
devin-ai-integration Bot pushed a commit to baigojahanzaib/servo that referenced this pull request Nov 28, 2026
…rvo#50243)

Continues servo#49891 to fix the scroll range of the viewport. When the
viewport has a RTL direction, then the viewport is initially scrolled to
the right, and scrolling to the left means getting into negative scroll
coordinates.

Before this patch, the initial scroll position was correct, but then,
instead of allowing to scroll to the left, we were instead allowing to
scroll further into the right, despite already being at the end.

Testing: Adding a test
Fixes: servo#50242

Signed-off-by: Oriol Brufau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants