Skip to content

layout: Don't use quirky block size for determining margin collapse - #49617

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

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

Conversation

@Loirooriol

Copy link
Copy Markdown
Contributor

When determining whether a block container that doesn't establish a BFC would collapse its margins through, or collapse the bottom margin with the bottom margin of the contents, we need to check whether the height is intrinsic.

To do so, it was convenient to just check the containing block established for the contents. However, quirks mode can override that.

Therefore, pass around the original block size before the quirk took effect. This also avoids the need to especially handle anonymous blocks, that was previously necessary because they don't establish a containing block.

Testing: Adding a test

@Loirooriol
Loirooriol requested a review from mrobinson as a code owner November 4, 2026 23:12
@Loirooriol Loirooriol added the T-linux-wpt Do a try run of the WPT label Nov 4, 2026
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 4, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

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

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

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

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

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

Flaky unexpected result (21)
  • TIMEOUT [expected OK] /IndexedDB/idbcursor-request-source.any.sharedworker.html (#48728)
    • TIMEOUT [expected PASS] subtest: IDBObjectStore::openCursor's request source must be the IDBObjectStore instance that opened the cursor

      Test timed out
      

  • OK /IndexedDB/idbtransaction-oncomplete.any.sharedworker.html (#45911)
    • 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
      

  • OK /css/CSS2/visudet/inline-block-baseline-with-block-in-inline-001.html (#49559)
    • PASS [expected FAIL] subtest: An inline-block whose last line box holds a block level box exports that line's baseline
  • FAIL [expected PASS] /css/css-backgrounds/background-size-042.html
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • PASS [expected FAIL] subtest: Same-origin navigation started from unload handler must be ignored
  • 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.html (#44028)
  • TIMEOUT [expected PASS] /html/semantics/document-metadata/the-link-element/link-error-handler-triggers-abort-crash.html (#49503)
  • 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
      

  • 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)
  • PASS [expected FAIL] /mathml/presentation-markup/operators/operator-dictionary-empty-and-three-chars.html (#49173)
  • OK /mixed-content/tentative/autoupgrades/mixed-content-cors.https.sub.html (#41123)
    • FAIL [expected PASS] subtest: Cross-Origin audio should get upgraded even if CORS is set

      assert_equals: Length of other host audio is correct expected 1 but got Infinity
      

  • 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 /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 /upgrade-insecure-requests/gen/sharedworker-classic-data.meta/upgrade/websocket.https.html
    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects allowed for websocket to cross-ws-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'allowed'. expected "allowed" but got "blocked"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects allowed for websocket to same-ws-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'allowed'. expected "allowed" but got "blocked"
      

  • OK /webdriver/tests/classic/find_element_from_shadow_root/find.py
    • FAIL [expected PASS] subtest: test_null_parameter_value

      webdriver.error.TimeoutException: timeout (500): Load timed out
      

  • 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] /fetch/api/redirect/redirect-keepalive.https.any.html (#32153)
    • TIMEOUT [expected PASS] subtest: [keepalive][iframe][load] mixed content redirect; setting up

      Test timed out
      

  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit.html (#44098)
    • TIMEOUT [expected FAIL] subtest: Replace before load, triggered by formElement.requestSubmit()

      Test timed out
      

  • 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
      

  • 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
      

  • PASS [expected FAIL] /mathml/presentation-markup/operators/mo-form-dynamic-002.html (#49169)
  • FAIL [expected PASS] /mathml/presentation-markup/operators/mo-single-char-and-children.html (#49318)

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

✨ Try run (#41931849576) succeeded.

When determining whether a block container that doesn't establish a BFC
would collapse its margins through, or collapse the bottom margin with
the bottom margin of the contents, we need to check whether the height
is intrinsic.

To do so, it was convenient to just check the containing block
established for the contents. However, quirks mode can override that.

Therefore, pass around the original block size before the quirk took
effect. This also avoids the need to especially handle anonymous blocks,
that was previously necessary because they don't establish a containing
block.

Signed-off-by: Oriol Brufau <[email protected]>
@Loirooriol
Loirooriol force-pushed the percentage-quirk-fix-2 branch from e4cb0dd to b9b6827 Compare November 5, 2026 07:50
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

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

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 5, 2026
@Loirooriol Loirooriol mentioned this pull request Nov 5, 2026
5 of 7 tasks
@Loirooriol
Loirooriol added this pull request to the merge queue Nov 5, 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 5, 2026
@Loirooriol
Loirooriol removed this pull request from the merge queue due to a manual request Nov 5, 2026
@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, 2026
@Loirooriol
Loirooriol added this pull request to the merge queue Nov 5, 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 5, 2026
@Loirooriol
Loirooriol removed this pull request from the merge queue due to a manual request Nov 5, 2026
@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, 2026
@Loirooriol
Loirooriol added this pull request to the merge queue Nov 5, 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 5, 2026
Merged via the queue into servo:main with commit 43b67f6 Nov 5, 2026
41 checks passed
@Loirooriol
Loirooriol deleted the percentage-quirk-fix-2 branch November 5, 2026 11:59
@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, 2026
sageliem pushed a commit to sageliem/servo that referenced this pull request Nov 6, 2026
…ervo#49617)

When determining whether a block container that doesn't establish a BFC
would collapse its margins through, or collapse the bottom margin with
the bottom margin of the contents, we need to check whether the height
is intrinsic.

To do so, it was convenient to just check the containing block
established for the contents. However, quirks mode can override that.

Therefore, pass around the original block size before the quirk took
effect. This also avoids the need to especially handle anonymous blocks,
that was previously necessary because they don't establish a containing
block.

Testing: Adding a test

Signed-off-by: Oriol Brufau <[email protected]>
Loirooriol added a commit to Loirooriol/servo that referenced this pull request Nov 9, 2026
…ervo#49684)

Fixes a regression from servo#49617, I forgot to use the block size that
includes the quirk for intrinsic sizing.

Testing: Adding a test
Fixes: servo#49683

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.

4 participants