[wpt-sync] Sync PR 37366 - [anchor-position] Allow top-layer elements to anchor to abspos elements
Categories
(Core :: CSS Parsing and Computation, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox110 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 37366 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/37366
Details from upstream follow.
Xiaocheng Hu <xiaochengh@chromium.org> wrote:
[anchor-position] Allow top-layer elements to anchor to abspos elements
Per discussion [1], we should allow a top-layer element to anchor to:
- Non-top-layer absolutely positioned elements
- Elements preceding the current element in the document top-layer
This patch implements it and adds a comprehensive test suite.
The implementation:
- Adds a flag to NGLogicalAnchorQuery::AnchorReference() to allow
returning invalid (i.e., abspos) anchors, and sets the flag when
positioning top-layer elements. This is fine because valid anchors
for a top-layer element are always inserted into the AnchorQuery
before we layout the top-layer element (ensured by layout tree order)- Adds a flag to NGPhysicalAnchorQuery::Fragment() to allow returning
invalid (i.e., abspos) anchors, which is foranchor-scroll. The
result is further validated with layout tree order, so that we don't
anchor a top-layer element to another element after it in the top
layer.- Introduces
ContainingScrollContainerForAnchor()to correctly get
the scroll container (nullptr) of a fixed positioned anchor, as this
case is not possible before this patch[1] https://github.com/w3c/csswg-drafts/issues/8165
Fixed: 1396436
Fixed: 1385882
Change-Id: I4436f35885e6fede6d780aae633c6525b4100510Reviewed-on: https://chromium-review.googlesource.com/4083692
WPT-Export-Revision: 8984ab89a4879fb0df00110ab747dd302b820c64
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 1•2 years ago
|
||
| Assignee | ||
Comment 2•2 years ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 7 tests
Status Summary
Firefox
FAIL: 7
Chrome
PASS: 2
FAIL: 5
Safari
FAIL: 7
Links
Details
New Tests That Don't Pass
- /css/css-anchor-position/anchor-position-top-layer-001.html [wpt.fyi]:
FAIL(Chrome:FAIL, Safari:FAIL) - /css/css-anchor-position/anchor-position-top-layer-002.html [wpt.fyi]:
FAIL(Chrome:FAIL, Safari:FAIL) - /css/css-anchor-position/anchor-position-top-layer-003.html [wpt.fyi]:
FAIL(Chrome:FAIL, Safari:FAIL) - /css/css-anchor-position/anchor-position-top-layer-004.html [wpt.fyi]:
FAIL(Chrome:FAIL, Safari:FAIL) - /css/css-anchor-position/anchor-position-top-layer-005.html [wpt.fyi]:
FAIL(Chrome:PASS, Safari:FAIL) - /css/css-anchor-position/anchor-position-top-layer-006.html [wpt.fyi]:
FAIL(Chrome:PASS, Safari:FAIL) - /html/semantics/popovers/popover-anchor-nested-display.tentative.html [wpt.fyi]:
FAIL(Chrome:FAIL, Safari:FAIL)
Comment 4•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/19c6f3f32913
https://hg.mozilla.org/mozilla-central/rev/47e852b9824a
Description
•