Skip to content

layout: Fixes for the percentage height quirk - #49366

Merged
Loirooriol merged 1 commit into
servo:mainfrom
Loirooriol:percentage-quirk-fix
Nov 4, 2026
Merged

Loirooriol merged 1 commit into
servo:mainfrom
Loirooriol:percentage-quirk-fix

Conversation

@Loirooriol

@Loirooriol Loirooriol commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

This implements 4 changes:

Testing: 2 existing tests improve, also adding new tests
Fixes: #49025

@Loirooriol Loirooriol added the T-linux-wpt Do a try run of the WPT label Oct 28, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Oct 28, 2026
@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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

Flaky unexpected result (15)
  • CRASH [expected OK] /_webgl/conformance2/wasm/readpixels-2gb-in-4gb-wasm-memory.html
  • 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 -20deg' should prefer 'oblique -60deg -40deg' over 'oblique -10deg'

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

  • OK [expected TIMEOUT] /fetch/api/redirect/redirect-keepalive.https.any.html (#32153)
    • PASS [expected TIMEOUT] subtest: [keepalive][iframe][load] mixed content redirect; setting up
  • 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/forms/form-submission-0/jsurl-form-submit.tentative.html (#36489)
    • PASS [expected FAIL] subtest: Verifies that form submissions scheduled inside javascript: urls take precedence over the javascript: url's return value.
  • CRASH [expected FAIL] /html/semantics/interestfor/interestfor-plain-inline-element.tentative.html
  • TIMEOUT [expected OK] /html/user-activation/navigation-state-reset-sameorigin.html (#45151)
    • TIMEOUT [expected FAIL] subtest: Post-navigation state reset.

      Test timed out
      

  • TIMEOUT [expected OK] /html/user-activation/propagation-sameorigin.html
    • NOTRUN [expected PASS] subtest: Propagation test
  • FAIL [expected PASS] /mathml/presentation-markup/operators/mo-lspace-rspace-dynamic.html (#49168)
  • ERROR [expected TIMEOUT] /performance-timeline/not-restored-reasons/abort-block-bfcache.window.html (#42802)
  • 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 /user-timing/measure_associated_with_navigation_timing.html (#47273)
    • PASS [expected FAIL] subtest: loadTime plus loadEventEnd to a mark "a" should equal to navigationStart to "a".
  • TIMEOUT [expected OK] /webdriver/tests/classic/element_click/scroll_into_view.py
  • OK [expected TIMEOUT] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.html (#29053)
    • FAIL [expected TIMEOUT] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe

      assert_true: about:blank window opened by 3P iframe does not inherit 3P iframe's StorageKey expected true got false
      

Stable unexpected results that are known to be intermittent (6)
  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/navigating-across-documents/cross-origin-top-navigation-with-user-activation-in-parent.window.html (#48205)
    • TIMEOUT [expected FAIL] subtest: Cross-origin top navigation is blocked without user activation, even if the parent has user activation

      Test timed out
      

  • CRASH [expected TIMEOUT] /html/browsers/history/the-location-interface/location_replace_session_history.html (#41896)
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/autoplay-allowed-by-permissions-policy.https.sub.html (#46803)
    • PASS [expected TIMEOUT] subtest: Permissions-Policy header: autoplay * allows same-origin iframes.
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/autoplay-default-permissions-policy.https.sub.html (#46805)
    • PASS [expected TIMEOUT] subtest: Default "autoplay" feature policy ["self"] allows same-origin iframes.
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/autoplay-disabled-by-permissions-policy.https.sub.html (#46012, #46804)
    • FAIL [expected TIMEOUT] subtest: Permissions-Policy header: autoplay "none" disallows same-origin iframes.

      assert_false: autoplay expected false got true
      

  • OK /sanitizer-api/sanitizer-inert-document.html (#45260)
    • PASS [expected FAIL] subtest: Test whether setHTML loads the image.
    • FAIL [expected PASS] subtest: Test whether setHTMLUnsafe loads the image.

      promise_test: Unhandled rejection with value: "The server observed a request. It shouldn't have."
      

@github-actions

Copy link
Copy Markdown

✨ Try run (#40689394413) succeeded.

@Loirooriol
Loirooriol force-pushed the percentage-quirk-fix branch from ad35774 to 373d636 Compare October 28, 2026 17:58
@Loirooriol Loirooriol added the T-linux-wpt Do a try run of the WPT label Oct 28, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Oct 28, 2026
@github-actions

Copy link
Copy Markdown

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

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#64322) with upstreamable changes.

@github-actions

Copy link
Copy Markdown

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

Flaky unexpected result (19)
  • OK /IndexedDB/idbtransaction-oncomplete.any.worker.html (#42804)
    • FAIL [expected PASS] subtest: IDBTransaction - complete event

      assert_array_equals: lengths differ, expected array ["upgradeneeded", "complete", "success", "opencursor"] length 4, got ["upgradeneeded", "complete", "success"] length 3
      

  • CRASH [expected OK] /_webgl/conformance2/wasm/readpixels-2gb-in-4gb-wasm-memory.html
  • FAIL [expected PASS] /css/css-backgrounds/background-size-042.html
  • OK /css/css-overflow/scrollable-overflow-textarea.html (#47563)
    • FAIL [expected PASS] subtest: #textarea 1

      assert_equals: 
      <textarea id="textarea" data-expected-scroll-width="132" data-expected-scroll-height="128">XXXXX XXXXX XXXXX XXXXX XXXXX</textarea>
      scrollHeight expected 128 but got 144
      

  • OK /fetch/content-length/api-and-duplicate-headers.any.html (#35873)
    • FAIL [expected PASS] subtest: fetch() and duplicate Content-Length/Content-Type headers

      promise_test: Unhandled rejection with value: object "TypeError: Network error: HTTP failure: client error (SendRequest)"
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
    • PASS [expected FAIL] subtest: aElement.click() before the load event must NOT replace
  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click.html (#44099)
    • TIMEOUT [expected FAIL] subtest: Replace before load, triggered by submitButton.click()

      Test timed out
      

  • 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 3 but got 0
      

  • CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-nav-location-assign.html (#32863)
  • TIMEOUT [expected OK] /html/user-activation/consumption-sameorigin.html
    • NOTRUN [expected PASS] subtest: Consumption test
  • TIMEOUT [expected OK] /html/user-activation/navigation-state-reset-sameorigin.html (#45151)
    • TIMEOUT [expected FAIL] subtest: Post-navigation state reset.

      Test timed out
      

  • CRASH [expected OK] /html/webappapis/dynamic-markup-insertion/opening-the-input-stream/remove-initial-about-blankness.window.html (#47638)
  • OK /infrastructure/testdriver/click_iframe.html (#47688)
    • FAIL [expected PASS] subtest: TestDriver click on a document in an iframe

      Unhandled rejection: assert_unreached: click failed Reached unreachable code
      

  • FAIL [expected PASS] /mathml/presentation-markup/operators/mo-lspace-rspace-dynamic.html (#49168)
  • OK /mathml/presentation-markup/operators/operator-dictionary-combining.html (#49238)
    • FAIL [expected PASS] subtest: Spacing around ≠

      assert_true: expected true got false
      

    • FAIL [expected PASS] subtest: Spacing around =⃒

      assert_true: expected true got false
      

    • FAIL [expected PASS] subtest: Spacing around |̸

      assert_true: expected true got false
      

    • FAIL [expected PASS] subtest: Spacing around |⃒

      assert_true: expected true got false
      

    • FAIL [expected PASS] subtest: Spacing around ⋉̸

      assert_true: expected true got false
      

    • FAIL [expected PASS] subtest: Spacing around ⋉⃒

      assert_true: expected true got false
      

    • FAIL [expected PASS] subtest: Spacing around ∄

      assert_true: expected true got false
      

    • FAIL [expected PASS] subtest: Spacing around ∃⃒

      assert_true: expected true got false
      

  • OK /mixed-content/tentative/autoupgrades/video-upgrade.https.sub.html (#41135)
    • FAIL [expected PASS] subtest: Video of other host autoupgraded

      assert_equals: Length. Other host 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 /preload/prefetch-document.html (#37210)
    • FAIL [expected PASS] subtest: different-site document prefetch with 'as=document' should not be consumed

      assert_equals: expected 2 but got 1
      

  • 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/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-weight: '501' should prefer '500' over '450 460'

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

    • FAIL [expected PASS] subtest: Matching font-stretch: '90%' 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 10deg' should prefer 'oblique 15deg 20deg' over 'oblique 30deg 60deg'

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

    • PASS [expected FAIL] subtest: Matching font-style: 'oblique -21deg' should prefer 'oblique 40deg 50deg' over 'italic'
  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/navigating-across-documents/cross-origin-top-navigation-with-user-activation-in-parent.window.html (#48205)
    • TIMEOUT [expected FAIL] subtest: Cross-origin top navigation is blocked without user activation, even if the parent has user activation

      Test timed out
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/autoplay-allowed-by-permissions-policy.https.sub.html (#46803)
    • PASS [expected TIMEOUT] subtest: Permissions-Policy header: autoplay * allows same-origin iframes.
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/autoplay-default-permissions-policy.https.sub.html (#46805)
    • PASS [expected TIMEOUT] subtest: Default "autoplay" feature policy ["self"] allows same-origin iframes.
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/autoplay-disabled-by-permissions-policy.https.sub.html (#46012, #46804)
    • FAIL [expected TIMEOUT] subtest: Permissions-Policy header: autoplay "none" disallows same-origin iframes.

      assert_false: autoplay expected false got true
      

  • 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
      

  • PASS [expected FAIL] /mathml/presentation-markup/operators/mo-form-dynamic-002.html (#49169)
  • FAIL [expected PASS] /mathml/presentation-markup/operators/operator-dictionary-empty-and-three-chars.html (#49173)
  • OK /sanitizer-api/sanitizer-inert-document.html (#45260)
    • PASS [expected FAIL] subtest: Test whether setHTML loads the image.
    • FAIL [expected PASS] subtest: Test whether setHTMLUnsafe loads the image.

      promise_test: Unhandled rejection with value: "The server observed a request. It shouldn't have."
      

  • OK /user-timing/measure_associated_with_navigation_timing.html (#47273)
    • PASS [expected FAIL] subtest: loadTime plus loadEventEnd to a mark "a" should equal to navigationStart to "a".

@github-actions

Copy link
Copy Markdown

✨ Try run (#40741206159) succeeded.

@Loirooriol
Loirooriol marked this pull request as ready for review October 28, 2026 20:47
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 28, 2026
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#64322) title and body.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 2, 2026
@Loirooriol
Loirooriol force-pushed the percentage-quirk-fix branch from 373d636 to a0f8425 Compare November 4, 2026 00:36
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 4, 2026
@Loirooriol
Loirooriol enabled auto-merge November 4, 2026 00:37
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#64322).

@Loirooriol
Loirooriol force-pushed the percentage-quirk-fix branch from a0f8425 to 35df446 Compare November 4, 2026 00:54
@Loirooriol
Loirooriol disabled auto-merge November 4, 2026 00:56
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#64322).

This implements 4 changes:
- Restricts the quirk to elements that have a percentage in `height`.
  E.g. `100%` won't be quirky in `height: auto; min-height: 100%`, but
  it will in `height: 0%; min-height: 100%`. This matches the spec and
  Gecko, though Blink and WebKit only enforce it on replaced elements.
- More concretely, it requires a `<percentage>`, as opposed to a
  `<length-percentage>` containing a percentage. E.g. `calc(100% + 1px)`
  won't be quirky, but `100%`, `calc(100%)` and `calc(100% + 0px)` will.
  This matches the spec and Gecko, but not Blink and WebKit.
- Restricts the quirk to percentage resolution. E.g. `height: stretch`
  won't be quirky. This matches Blink, the spec is unclear.
- Restricts the quirk to sizing purposes. E.g. `top: 100%` won't be
  quirky. This matches the spec, Blink and WebKit, but not Gecko.

Signed-off-by: Oriol Brufau <[email protected]>
@Loirooriol
Loirooriol force-pushed the percentage-quirk-fix branch from 35df446 to 7023ab8 Compare November 4, 2026 01:09
@Loirooriol
Loirooriol enabled auto-merge November 4, 2026 01:09
@Loirooriol

Copy link
Copy Markdown
Contributor Author

Updated the new tests, they were failing on other browsers because of https://html.spec.whatwg.org/multipage/rendering.html#margin-collapsing-quirks, which we don't implement.

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#64322).

@Loirooriol
Loirooriol added this pull request to the merge queue Nov 4, 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 4, 2026
Merged via the queue into servo:main with commit 6d3581d Nov 4, 2026
35 checks passed
@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 4, 2026
@Loirooriol
Loirooriol deleted the percentage-quirk-fix branch November 4, 2026 04:15
@Loirooriol Loirooriol mentioned this pull request Nov 5, 2026
5 of 7 tasks
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.

Percentage quirk should only apply when preferred size is a percentage

4 participants