Skip to content

layout: Add experimental aspect-ratio support for non-replaced boxes - #47980

Merged
mrobinson merged 13 commits into
servo:mainfrom
hhhwsqhhh:feature-preferred_aspect_ratio
Nov 24, 2026
Merged

mrobinson merged 13 commits into
servo:mainfrom
hhhwsqhhh:feature-preferred_aspect_ratio

Conversation

@hhhwsqhhh

@hhhwsqhhh hhhwsqhhh commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Query and usage of preferred_aspect_ratio() on non-replaced boxes (Flow, Flex, Grid).

This is gated behind the experimental layout_css_aspect_ratio_enabled preference, since following not implemented

  • Automatic content-based minimum sizes
  • Inline size constraints derived from block axis.
  • Float/atomic inlines
  • Update tentative_block_size for in flow boxes.
  • absolute positioned box

Aspect-ratio on table boxes themselves is left unsupported due to unclear spec w3c/csswg-drafts#11419.

Testing: New passing. Rest failures are due to above limitations.
Fixes: Part of #32802

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Sep 11, 2026

@yezhizhen yezhizhen left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. You can just reopen #47969 instead of opening a new PR
  2. Please rebase and force push instead of "merge main into.."
  3. Please use proper title and description. Refer to https://book.servo.org/contributing/making-a-pull-request.html and some examples, such as #47852.

@servo-highfive servo-highfive added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Sep 11, 2026
@hhhwsqhhh
hhhwsqhhh marked this pull request as draft September 11, 2026 03:50
@hhhwsqhhh
hhhwsqhhh force-pushed the feature-preferred_aspect_ratio branch from a5542e6 to 35cdb23 Compare September 11, 2026 04:06
@hhhwsqhhh hhhwsqhhh changed the title aspect-ratio layout: complement of preferred-aspect-ratio on 4 non-replaced boxes Sep 11, 2026
@hhhwsqhhh hhhwsqhhh changed the title layout: complement of preferred-aspect-ratio on 4 non-replaced boxes layout: Complement of preferred-aspect-ratio on 4 non-replaced boxes Sep 11, 2026
@hhhwsqhhh
hhhwsqhhh force-pushed the feature-preferred_aspect_ratio branch 2 times, most recently from 7d52cf0 to af59c7c Compare September 11, 2026 07:24
@yezhizhen yezhizhen added the T-linux-wpt Do a try run of the WPT label Sep 11, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Sep 11, 2026
@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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

Flaky unexpected result (10)
  • TIMEOUT [expected OK] /_webgl/conformance/reading/read-pixels-test.html
  • CRASH [expected OK] /_webgl/conformance/uniforms/no-over-optimization-on-uniform-array-16.html
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/no-over-optimization-on-uniform-array-17.html
    • NOTRUN [expected PASS] subtest: Overall test
  • PASS [expected FAIL] /css/css-text-decor/text-underline-position-from-font-variable.html (#45615)
  • OK [expected ERROR] /css/selectors/invalidation/media-loading-pseudo-classes-in-has.sub.html
    • FAIL [expected PASS] subtest: Test :has(:stalled) invalidation

      assert_implements: :stalled is not supported undefined
      

    • FAIL [expected PASS] subtest: Test :has(:buffering) invalidation

      assert_implements: :buffering is not supported undefined
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment.html (#20768)
    • PASS [expected FAIL] subtest: Tests that a fragment navigation in the unload handler will not block the initial navigation
  • OK /html/semantics/embedded-content/media-elements/seeking/seek-to-max-value.htm (#40626)
    • FAIL [expected PASS] subtest: seek to Number.MAX_VALUE

      assert_equals: expected 1 but got 0
      

  • 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 OK] /html/webappapis/dynamic-markup-insertion/opening-the-input-stream/remove-initial-about-blankness.window.html (#47638)
  • CRASH [expected OK] /webstorage/storage_local_setitem_quotaexceedederr.window.html
Stable unexpected results that are known to be intermittent (8)
  • OK /_webgl/conformance/textures/misc/texture-upload-size.html (#21770)
    • PASS [expected FAIL] subtest: WebGL test #77
    • PASS [expected FAIL] subtest: WebGL test #79
    • PASS [expected FAIL] subtest: WebGL test #81
    • PASS [expected FAIL] subtest: WebGL test #83
  • OK /html/browsers/browsing-the-web/navigating-across-documents/refresh/same-document-refresh.html (#34597)
    • PASS [expected FAIL] subtest: Same-Document Referrer from Refresh
  • OK /infrastructure/testdriver/click_window.html (#47303)
    • PASS [expected FAIL] subtest: TestDriver click method in window
  • 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 [expected TIMEOUT] /trusted-types/trusted-types-navigation.html?01-05 (#38975)
    • PASS [expected TIMEOUT] subtest: Navigate a window via anchor with javascript:-urls in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a window via anchor with javascript:-urls w/ default policy in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a frame via anchor with javascript:-urls in enforcing mode.
  • TIMEOUT [expected OK] /trusted-types/trusted-types-navigation.html?26-30 (#38807)
    • TIMEOUT [expected PASS] subtest: Navigate a window via form-submission with javascript:-urls in report-only mode.

      Test timed out
      

    • NOTRUN [expected PASS] subtest: Navigate a window via form-submission with javascript:-urls w/ default policy in report-only mode.
    • NOTRUN [expected PASS] subtest: Navigate a frame via form-submission with javascript:-urls in enforcing mode.
    • NOTRUN [expected PASS] subtest: Navigate a frame via form-submission with javascript:-urls w/ default policy in enforcing mode.
  • OK [expected TIMEOUT] /trusted-types/trusted-types-navigation.html?31-35 (#38034)
    • PASS [expected TIMEOUT] subtest: Navigate a frame via form-submission with javascript:-urls in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a frame via form-submission with javascript:-urls w/ default policy in report-only mode.
    • FAIL [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy throwing an exception in enforcing mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

    • FAIL [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy throwing an exception in report-only mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

    • FAIL [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy making the URL invalid in enforcing mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

  • 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 (18)
  • OK /css/css-align/abspos/stretch-intrinsic-size-htb-vrl.html
    • FAIL [expected PASS] subtest: .item 5

      assert_equals: 
      <div class="container">
        <div class="item ar" style="justify-self: start; align-self: start;" data-expected-width="20" data-expected-height="20"></div>
      </div>
      height expected 20 but got 40
      

    • PASS [expected FAIL] subtest: .item 6
  • OK /css/css-align/abspos/stretch-intrinsic-size-vrl-vrl.html
    • FAIL [expected PASS] subtest: .item 5

      assert_equals: 
      <div class="container">
        <div class="item ar" style="justify-self: start; align-self: start;" data-expected-width="20" data-expected-height="20"></div>
      </div>
      height expected 20 but got 40
      

  • PASS [expected FAIL] /css/css-flexbox/aspect-ratio-intrinsic-size-003.html
  • PASS [expected FAIL] /css/css-flexbox/aspect-ratio-intrinsic-size-008.html
  • PASS [expected FAIL] /css/css-flexbox/aspect-ratio-intrinsic-size-009.html
  • PASS [expected FAIL] /css/css-flexbox/aspect-ratio-intrinsic-size-012.html
  • FAIL [expected PASS] /css/css-flexbox/balance/balance-percentage-size-002.html
  • PASS [expected FAIL] /css/css-flexbox/flex-aspect-ratio-cross-size-002.html
  • FAIL [expected PASS] /css/css-grid/grid-with-aspect-ratio-uses-content-box-height-for-track-sizing.html
  • FAIL [expected PASS] /css/css-sizing/aspect-ratio/flex-aspect-ratio-004.html
  • FAIL [expected PASS] /css/css-sizing/aspect-ratio/flex-aspect-ratio-010.html
  • PASS [expected FAIL] /css/css-sizing/aspect-ratio/flex-aspect-ratio-021.html
  • PASS [expected FAIL] /css/css-sizing/aspect-ratio/flex-aspect-ratio-033.html
  • PASS [expected FAIL] /css/css-sizing/aspect-ratio/flex-aspect-ratio-048.html
  • FAIL [expected PASS] /css/css-sizing/aspect-ratio/flex-aspect-ratio-050.html
  • FAIL [expected PASS] /css/css-sizing/aspect-ratio/flex-aspect-ratio-051.html
  • PASS [expected FAIL] /css/css-sizing/aspect-ratio/flex-aspect-ratio-054.html
  • PASS [expected FAIL] /css/css-sizing/aspect-ratio/grid-aspect-ratio-align-items-center.html

@github-actions

Copy link
Copy Markdown

⚠️ Try run (#34577752509) failed!

Some((block_size.into(), depends_on_inline_stretch_size))
},
_ => None,
IndependentFormattingContextContents::Flow(_) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是可以这样写

IndependentFormattingContextContents::Flow()
| IndependentFormattingContextContents::Flex(
)
| IndependentFormattingContextContents::Grid()
| IndependentFormattingContextContents::Table(
) => {
let ratio = preferred_aspect_ratio?;
let block_size = ratio.compute_dependent_size(Direction::Block, inline_stretch_size);
Some((block_size.into(), true))
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

语义上应该是一样的,不过参考同类里其他函数对五种box均分别讨论了,感觉还是分开写对日后扩展更方便些?

@yezhizhen

Copy link
Copy Markdown
Member

I haven't checked the code. But next step is to check those new failures in "Stable unexpected results (18)". If they were passing false positively, you can state reasons for these in PR description.

@yezhizhen
yezhizhen marked this pull request as ready for review September 22, 2026 13:00
@servo-highfive servo-highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Sep 22, 2026
@yezhizhen
yezhizhen marked this pull request as draft September 22, 2026 13:09

@Loirooriol Loirooriol left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think tentative_block_content_size should continue being None for non-replaced.

Instead, sizing should decouple the transference of sizes thru ratios from inline_content_sizes() (it's fine for replaced but not others, due to automatic minimums)

},
_ => None,
IndependentFormattingContextContents::Flow(_) => {
let ratio = preferred_aspect_ratio?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is common, can be moved above.

_ => None,
IndependentFormattingContextContents::Flow(_) => {
let ratio = preferred_aspect_ratio?;
let block_size = ratio.compute_dependent_size(Direction::Block, inline_stretch_size);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you stretching the intrinsic size of a non-replaced?

@hhhwsqhhh
hhhwsqhhh force-pushed the feature-preferred_aspect_ratio branch 4 times, most recently from 104e221 to 50c8cbd Compare October 12, 2026 06:45
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

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

1 similar comment
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

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

@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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

Flaky unexpected result (23)
  • CRASH [expected OK] /IndexedDB/cursor-overloads.any.worker.html
  • CRASH [expected ERROR] /IndexedDB/idbcursor-direction-objectstore.any.serviceworker.html
  • CRASH [expected OK] /IndexedDB/structured-clone.any.html?101-last
  • CRASH [expected OK] /_webgl/conformance/state/state-uneffected-after-compositing.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-041.html
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-weight: '501' should prefer '502 510' over '503 520'

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

  • OK /css/css-position/static-position/inline-containing-block-with-border.html
    • FAIL [expected PASS] subtest: writing-mode: horizontal-tb; direction: ltr; inline box 'border-inline-start: 30px solid; padding-inline-start: 7px'; originally inline-level absolutely positioned box

      assert_equals: left expected 111 but got 137
      

  • OK /css/css-text-decor/parsing/text-decoration-inset-computed.html (#47617)
    • FAIL [expected PASS] subtest: Property text-decoration-inset value '0'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '0px 0px'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '0.5em'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '-1em'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '-1ch -1ch'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '1px 2px'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '1ch -1ch'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value 'calc(1em / 4) calc(-1ch)'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value 'auto'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '10%'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • And 5 more unexpected results...
  • OK [expected ERROR] /focus/focus-event-after-switching-iframes.sub.html (#40368)
  • 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
      

  • TIMEOUT [expected PASS] /html/semantics/document-metadata/the-link-element/link-error-handler-triggers-abort-crash.html (#49503)
  • 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 (#49544)
    • NOTRUN [expected PASS] subtest: Propagation test
  • 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"])
      

  • 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/operator-dictionary-empty-and-three-chars.html (#49173)
  • 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 /trusted-types/trusted-types-navigation.html?21-25
    • FAIL [expected PASS] subtest: Navigate a window via form-submission with javascript:-urls in enforcing mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: {\"type\":\"DOMContentLoaded\",\"uri\":\"http://web-platform.test:8000/trusted-types/support/navigation-support.html?area=1&defaultpolicy=make-invalid&navigationattempted=1&continue=1\"}"
      

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

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

  • OK /webdriver/tests/classic/perform_actions/iframe.py
    • FAIL [expected PASS] subtest: test_perform_actions_on_element_in_frame[same_origin]

      AssertionError: assert '' == 'clicked'
      

  • 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 (7)
  • OK /css/CSS2/floats/float-in-block-in-inline-position-001.html (#49534)
    • PASS [expected FAIL] subtest: A line after a bordered block containing a float avoids it at the block's position (nested)
    • PASS [expected FAIL] subtest: A line after a self collapsing block containing a float avoids it at the block's position (sibling)
    • PASS [expected FAIL] subtest: The float lands in the same place whether the bordered block is nested in an inline box or a sibling of inline content
  • 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 [expected TIMEOUT] /fetch/api/redirect/redirect-keepalive.https.any.html (#32153)
    • PASS [expected TIMEOUT] subtest: [keepalive][iframe][load] mixed content redirect; setting up
  • 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 /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 [expected TIMEOUT] /webdriver/tests/classic/perform_actions/navigation.py (#38822)
Stable unexpected results (1)
  • PASS [expected FAIL] /css/css-flexbox/flex-item-aspect-ratio-svg-use-symbol-001.html

@github-actions

Copy link
Copy Markdown

⚠️ Try run (#43851940061) failed!

@yezhizhen

Copy link
Copy Markdown
Member

I will take a final look tomorrow, but it's looking reasonably good.

Just wanna say it's been another five days, pls check again.

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

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

@Loirooriol Loirooriol left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay.

I have found some issues, but I don't want to block this even longer. Since it's behind a pref anyway, you can address in follow-ups if you want.

Comment thread components/layout/flow/mod.rs Resolved
if let Some(ratio_dependent_block_size) =
compute_ratio_dependent_block_size(preferred_aspect_ratio, inline_size)
{
block_size_for_children = SizeConstraint::Definite(content_box_sizes.block.resolve(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only updates block_size_for_children but not tentative_block_size, which is e.g. checked for margin collapse. Which probably means that the logic for margin collapse should check the ratio.

These margins shouldn't collapse thru:

<!DOCTYPE html>
Should be a square:
<div style="border: solid; width: 200px">
  <div style="width: 100px; aspect-ratio: 1; margin: 50px 0"></div>
</div>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added TODO in a44e524

block_stretch_size,
|| block_content_size,
is_table,
|| None, /* ratio_dependent_block_size */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not handled here for floats and atomic inlines:

<!DOCTYPE html>
<div style="float: left; aspect-ratio: 1; width: 100px; border: solid">
  <div style="height: 50%; width: 50px; background: cyan"></div>
</div>
<div style="display: inline-block; aspect-ratio: 1; width: 100px; border: solid">
  <div style="height: 50%; width: 50px; background: cyan"></div>
</div>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added TODO in a44e524

Comment thread components/layout/flow/root.rs Resolved
block_stretch_size,
|| block_content_size,
is_table,
|| None, /* ratio_dependent_block_size */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not handled

<!DOCTYPE html>
<div style="position: absolute; aspect-ratio: 1; width: 100px; border: solid">
  <div style="height: 50%; width: 50px; background: cyan"></div>
</div>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added TODO in a44e524

@github-actions

Copy link
Copy Markdown

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

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

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

@github-actions

Copy link
Copy Markdown

⚠️ Try run (#45346996167) cancelled.

Signed-off-by: Euclid Ye <[email protected]>
The ratio is already taken into account when resolving the lazy block size.
Using it here would also prevent resolving `auto` minimums in the future.

Signed-off-by: Euclid Ye <[email protected]>
Signed-off-by: Euclid Ye <[email protected]>
@github-actions

Copy link
Copy Markdown

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

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

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

@github-actions

Copy link
Copy Markdown

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

Flaky unexpected result (18)
  • ERROR [expected OK] /_mozilla/mozilla/upstream/css-variables-setProperty-recompute.html
  • 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
      

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

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

  • OK [expected ERROR] /focus/focus-event-after-switching-iframes.sub.html (#40368)
  • 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 [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/syntax/speculative-parsing/expect-no-linked-resources/no-speculative-fetch.tentative.optional.html (#47290)
    • PASS [expected FAIL] subtest: expect-no-linked-resources hint was ignored
  • TIMEOUT [expected OK] /html/user-activation/navigation-state-reset-sameorigin.html (#45151)
    • TIMEOUT [expected FAIL] subtest: Post-navigation state reset.

      Test timed out
      

  • 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/operator-dictionary-empty-and-three-chars.html (#49173)
  • TIMEOUT [expected OK] /pointerevents/compat/pointerevent_touch-action_two-finger_interaction.html (#50155)
    • 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 /trusted-types/trusted-types-navigation.html?11-15 (#44834)
    • FAIL [expected PASS] subtest: Navigate a window via area with javascript:-urls in enforcing mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: {\"type\":\"DOMContentLoaded\",\"uri\":\"http://web-platform.test:8000/trusted-types/support/navigation-support.html?defaultpolicy=make-invalid&amp;navigationattempted=1&amp;continue=1\"}"
      

  • OK /webdriver/tests/classic/element_click/navigate.py (#47582)
    • FAIL [expected PASS] subtest: test_multi_line_link

      AssertionError: assert 'https://web-platform.test:8443/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%0A++++++++%3Cp+style%3D%22background-color%3A+yellow%3B+width%3A+50px%3B%22%3E%0A++++++++++++%3Ca+href%3D%2Fwebdriver%2Ftests%2Fclassic%2Felement_click%2Fsupport%2Finput.html%3EHelloooooooooooooooooooo+Worlddddddddddddddd%3C%2Fa%3E%0A++++++++%3C%2Fp%3E&amp;mime=text%2Fhtml&amp;charset=UTF-8' == 'https://web-platform.test:8443/webdriver/tests/classic/element_click/support/input.html'
      

  • OK /webdriver/tests/classic/element_click/single_tick.py (#48249)
    • FAIL [expected PASS] subtest: test_element_click_dispatches_actions_in_a_single_tick

      assert not True
      

  • 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 (9)
  • OK /beacon/beacon-basic.https.window.html (#41723)
    • FAIL [expected PASS] subtest: Payload size restriction should be accumulated: type = string

      assert_false: expected false got true
      

    • FAIL [expected PASS] subtest: Payload size restriction should be accumulated: type = arraybuffer

      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 /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment.html (#20768)
    • PASS [expected FAIL] subtest: Tests that a fragment navigation in the unload handler will not block the initial navigation
  • 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
      

  • 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 /preload/prefetch-document.html (#37210)
    • PASS [expected FAIL] subtest: different-site document prefetch with 'as=document' should not be consumed
  • OK /sanitizer-api/sanitizer-inert-document.html (#45260)
    • FAIL [expected PASS] subtest: Test whether setHTML loads the image.

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

    • PASS [expected FAIL] subtest: Test whether setHTMLUnsafe loads the image.

@github-actions

Copy link
Copy Markdown

✨ Try run (#45347951784) succeeded.

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

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

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.

7 participants