tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit a9184ac28d5d280dbacf39705bd42cde8003810d
parent f9538b019e72db60784a50b613c4ed9bcd26a905
Author: Jonathan Kew <jkew@mozilla.com>
Date:   Sat, 27 Dec 2025 15:37:20 +0000

Bug 1989059 - Fix up position-try-order-logical testcase to force overflow & fallback to happen. r=layout-anchor-positioning-reviewers,emilio

This test seems questionable as written, because the anchored box fits at its "base" position
without overflowing the IMCB, and therefore there doesn't seem to be any justification for
applying fallbacks at all (see also https://github.com/w3c/csswg-drafts/issues/13268).

This patch forces fallbacks to be considered in all cases, by ensuring the base position always
overflows and then providing a fallback that matches the "original" (non-overflowing) base position;
then the browser will choose between this and the flipped fallback according to the specified
position-try-order and writing modes involved.

Differential Revision: https://phabricator.services.mozilla.com/D277557

Diffstat:
Dtesting/web-platform/meta/css/css-anchor-position/position-try-order-logical.html.ini | 2--
Mtesting/web-platform/tests/css/css-anchor-position/position-try-order-logical-ref.html | 1+
Mtesting/web-platform/tests/css/css-anchor-position/position-try-order-logical.html | 10+++++++++-
3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/testing/web-platform/meta/css/css-anchor-position/position-try-order-logical.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-try-order-logical.html.ini @@ -1,2 +0,0 @@ -[position-try-order-logical.html] - expected: FAIL diff --git a/testing/web-platform/tests/css/css-anchor-position/position-try-order-logical-ref.html b/testing/web-platform/tests/css/css-anchor-position/position-try-order-logical-ref.html @@ -3,6 +3,7 @@ .container { position: relative; display: inline-block; + vertical-align: middle; width: 100px; height: 100px; margin: 10px; diff --git a/testing/web-platform/tests/css/css-anchor-position/position-try-order-logical.html b/testing/web-platform/tests/css/css-anchor-position/position-try-order-logical.html @@ -5,6 +5,7 @@ .container { position: relative; display: inline-block; + vertical-align: middle; width: 100px; height: 100px; margin: 10px; @@ -24,11 +25,18 @@ .anchored { position: absolute; position-anchor: --a; - position-try-fallbacks: flip-block flip-inline; + left: 100px; /* ensure the element will overflow the IMCB at "base" position */ + /* fallbacks: (1) with left inset removed; (2) also flipped in both axes */ + position-try-fallbacks: --noinset, --noinset flip-block flip-inline; width: 15px; height: 15px; background: green; } + +@position-try --noinset { + /* a fallback that just removes the left inset from the base position */ + left: unset; +} </style> <div class="container"> <div class="anchor"></div>