Closed Bug 1937624 Opened 8 months ago Closed 8 months ago

Add some tests for 'stretch' size keyword in scenarios with abspos content and orthogonal writing-modes

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Filing this bug to add some WPT tests as generalizations of the testcase in bug 1933408 comment 9.

Blocks: 1789477

This patch adds an initial testcase, and subsequent patches will add some
variants.

The testcase in this patch and its variants will give us code-coverage
for some of Gecko's positioning code that has to sort out the
absolutely-positioned element's position while reasoning about coordinates in
as many as three different writing-modes simultaneously:

  • the writing-mode of the abspos element itself.
  • the writing-mode of its in-flow box-tree parent.
  • the writing-mode of its absolutely-positioned containing block.

See e.g. mozilla::ReflowInput::CalculateHypotheticalPosition() for where some
of this code lives; particularly the areas around 'hypotheticalPosWillUseCbwm'.

This test is identical to the block-size equivalent, but with inline/block
property-values swapped (and with 'data-expected-{width,height}' swapped
accordingly so that we're still testing the resolved value of 'stretch' which
is now being specified in the other axis).

This forces the browser to compute the static position, which is a bit
complicated in this situation (since the static position comes from doing
layout in the in-flow parent, whose writing mode is potentially different from
the abspos child itself and also different from the abspos containing block).

In Gecko at least, this leads to a special case where we're forced to resolve
the abspos element's block-size a bit earlier-than-we-would-otherwise, as part
of the writing-mode conversion, here:
https://searchfox.org/mozilla-central/rev/66aaf96f955d9bdc4bdb087a5075d5fbff2b9c8d/layout/generic/ReflowInput.cpp#1508-1538

This patch's "stretch-block-size-003.html" testcase provides code-coverage for
that codepath, to ensure we're handling the 'stretch' keyword properly
there. And the inline-size variant is just included for symmetry/completeness.

I'm generating these testcases as modified variants of their -002 siblings,
where I've removed the explicit 0 insets, but I've also removed the padding
on their box-tree parent. The intent is to make their static position exactly
the same as the absolute position in the -002 test, so that the expected sizing
(when stretching to reach the abspos container's far edge) will still be the
same.

Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d141be9adb7c part 1: Add automated test for 'stretch' size keyword on abspos element with various writing-modes on parent & containing block. r=dshin https://hg.mozilla.org/integration/autoland/rev/9a1aa8165693 part 2: Add variant of WPT for 'stretch' size keyword on abspos element, with 'stretch' set on inline-size. r=dshin https://hg.mozilla.org/integration/autoland/rev/4c5fe4075067 part 3: Add variants of WPT for 'stretch' size keyword on abspos element, with the abspos element having a static position. r=dshin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/49769 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
Upstream PR merged by moz-wptsync-bot
Blocks: 1940367
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: