commit f9637192c0407084aa9956b11a015f3abd71c79c parent 11eab16dc55b3aee3e7388059b58ceacfb194035 Author: Emilio Cobos Álvarez <emilio@crisal.io> Date: Fri, 3 Oct 2025 07:43:40 +0000 Bug 1962598 - Implement full @position-try fallback for anchor positioning. r=layout-anchor-positioning-reviewers,layout-reviewers,dshin Remaining failures are due to position-try-order, afaict. Add some meta viewports to tests so that we get more consistent results on android. Differential Revision: https://phabricator.services.mozilla.com/D267231 Diffstat:
43 files changed, 355 insertions(+), 349 deletions(-)
diff --git a/layout/generic/AbsoluteContainingBlock.cpp b/layout/generic/AbsoluteContainingBlock.cpp @@ -835,6 +835,25 @@ void AbsoluteContainingBlock::ResolveAutoMarginsAfterLayout( } } +struct MOZ_STACK_CLASS MOZ_RAII AutoFallbackStyleSetter { + AutoFallbackStyleSetter(nsIFrame* aFrame, ComputedStyle* aFallbackStyle) + : mFrame(aFrame) { + if (aFallbackStyle) { + mOldStyle = aFrame->SetComputedStyleWithoutNotification(aFallbackStyle); + } + } + + ~AutoFallbackStyleSetter() { + if (mOldStyle) { + mFrame->SetComputedStyleWithoutNotification(std::move(mOldStyle)); + } + } + + private: + nsIFrame* const mFrame; + RefPtr<ComputedStyle> mOldStyle; +}; + // XXX Optimize the case where it's a resize reflow and the absolutely // positioned child has the exact same size and position and skip the // reflow... @@ -872,43 +891,20 @@ void AbsoluteContainingBlock::ReflowAbsoluteFrame( #endif // DEBUG const bool isGrid = aFlags.contains(AbsPosReflowFlag::IsGridContainerCB); - const auto* stylePos = aKidFrame->StylePosition(); // TODO(bug 1989059): position-try-order. - auto fallbacks = stylePos->mPositionTryFallbacks._0.AsSpan(); + auto fallbacks = aKidFrame->StylePosition()->mPositionTryFallbacks._0.AsSpan(); Maybe<uint32_t> currentFallbackIndex; - // TODO(emilio): Right now fallback only applies to position-area, which only - // makes a difference with a default anchor... Generalize it? - if (aAnchorPosReferenceData) { - bool found = false; - uint32_t index = aKidFrame->GetProperty( - nsIFrame::LastSuccessfulPositionFallback(), &found); - if (found) { - if (index >= fallbacks.Length()) { - // This should not happen, because we remove the frame property if the - // fallback list changes. - MOZ_ASSERT_UNREACHABLE("invalid LastSuccessfulPositionFallback"); - aKidFrame->RemoveProperty(nsIFrame::LastSuccessfulPositionFallback()); - } else { - currentFallbackIndex.emplace(index); - } - } - } const StylePositionTryFallbacksItem* currentFallback = nullptr; RefPtr<ComputedStyle> currentFallbackStyle; - auto TryAdvanceFallback = [&]() -> bool { - if (fallbacks.IsEmpty()) { - return false; - } - uint32_t nextFallbackIndex = - currentFallbackIndex ? *currentFallbackIndex + 1 : 0; - if (nextFallbackIndex >= fallbacks.Length()) { + auto SeekFallbackTo = [&](uint32_t aIndex) -> bool { + if (aIndex >= fallbacks.Length()) { return false; } const StylePositionTryFallbacksItem* nextFallback; RefPtr<ComputedStyle> nextFallbackStyle; while (true) { - nextFallback = &fallbacks[nextFallbackIndex]; + nextFallback = &fallbacks[aIndex]; if (nextFallback->IsIdentAndOrTactic()) { auto* ident = nextFallback->AsIdentAndOrTactic().ident.AsAtom(); if (!ident->IsEmpty()) { @@ -918,8 +914,8 @@ void AbsoluteContainingBlock::ReflowAbsoluteFrame( if (!nextFallbackStyle) { // No @position-try rule for this name was found, per spec we should // skip it. - nextFallbackIndex++; - if (nextFallbackIndex >= fallbacks.Length()) { + aIndex++; + if (aIndex >= fallbacks.Length()) { return false; } } @@ -927,27 +923,45 @@ void AbsoluteContainingBlock::ReflowAbsoluteFrame( } break; } - currentFallbackIndex = Some(nextFallbackIndex); + currentFallbackIndex = Some(aIndex); currentFallback = nextFallback; currentFallbackStyle = std::move(nextFallbackStyle); return true; }; + auto TryAdvanceFallback = [&]() -> bool { + if (fallbacks.IsEmpty()) { + return false; + } + uint32_t nextFallbackIndex = + currentFallbackIndex ? *currentFallbackIndex + 1 : 0; + return SeekFallbackTo(nextFallbackIndex); + }; + + // TODO(emilio): Right now fallback only applies to position-area, which only + // makes a difference with a default anchor... Generalize it? + if (aAnchorPosReferenceData) { + bool found = false; + uint32_t index = aKidFrame->GetProperty( + nsIFrame::LastSuccessfulPositionFallback(), &found); + if (found && !SeekFallbackTo(index)) { + aKidFrame->RemoveProperty(nsIFrame::LastSuccessfulPositionFallback()); + } + } + do { + AutoFallbackStyleSetter fallback(aKidFrame, currentFallbackStyle); const nsRect usedCb = [&] { if (isGrid) { // TODO(emilio): how does position-area interact with grid? return nsGridContainerFrame::GridItemCB(aKidFrame); } - auto positionArea = stylePos->mPositionArea; + auto positionArea = aKidFrame->StylePosition()->mPositionArea; const StylePositionTryFallbacksTryTactic* tactic = nullptr; if (currentFallback) { if (currentFallback->IsIdentAndOrTactic()) { const auto& item = currentFallback->AsIdentAndOrTactic(); - if (currentFallbackStyle) { - positionArea = currentFallbackStyle->StylePosition()->mPositionArea; - } tactic = &item.try_tactic; } else { MOZ_ASSERT(currentFallback->IsPositionArea()); diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h @@ -957,15 +957,16 @@ class nsIFrame : public nsQueryFrame { } /** - * SetComputedStyleWithoutNotification is for changes to the style - * context that should suppress style change processing, in other - * words, those that aren't really changes. This generally means only - * changes that happen during frame construction. - */ - void SetComputedStyleWithoutNotification(ComputedStyle* aStyle) { - if (aStyle != mComputedStyle) { - mComputedStyle = aStyle; - } + * SetComputedStyleWithoutNotification is for changes to the style that should + * suppress style change processing, in other words, those that aren't really + * changes. This generally means only changes that happen during frame + * construction, or those that get handled out of band, like @position-try + * fallback. + * @return the old style. + */ + RefPtr<ComputedStyle> SetComputedStyleWithoutNotification( + RefPtr<ComputedStyle> aStyle) { + return std::exchange(mComputedStyle, std::move(aStyle)); } protected: diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-getComputedStyle-003.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-getComputedStyle-003.html.ini @@ -1,6 +0,0 @@ -[anchor-getComputedStyle-003.html] - [getComputedStyle() should return and absolutize the first @try rule style for target1] - expected: FAIL - - [getComputedStyle() should return and absolutize the second @try rule style for target2] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-invalid-fallback.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-invalid-fallback.html.ini @@ -1,3 +0,0 @@ -[anchor-invalid-fallback.html] - [Flip to invalid anchor()] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-position-non-anchored-fallback.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-position-non-anchored-fallback.html.ini @@ -0,0 +1,2 @@ +[anchor-position-non-anchored-fallback.html] + expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-chained-fallback.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-chained-fallback.html.ini @@ -1,2 +0,0 @@ -[anchor-scroll-chained-fallback.html] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-001.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-001.html.ini @@ -1,17 +1,6 @@ [anchor-scroll-position-try-001.html] [Scroll down until the top edge of #anchor touches container but not overflowing] - expected: - [PASS, FAIL] + expected: [PASS, FAIL] [Scroll further up, where the second option no longer fits] - expected: - [PASS, FAIL] - - [Scroll further down, making the first fallback position overflow by 1px] - expected: FAIL - - [Scroll back up so that both the first and second options fit.] - expected: FAIL - - [Scroll bottom-right to make the first two options overflow] - expected: FAIL + expected: [PASS, FAIL] diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-002.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-002.html.ini @@ -1,3 +0,0 @@ -[anchor-scroll-position-try-002.html] - [Should use the second fallback position after scrolling left] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-003.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-003.html.ini @@ -1,3 +1,3 @@ [anchor-scroll-position-try-003.html] - [Should use the second fallback position after scrolling up] + [Should use the first fallback position at the initial scroll offset] expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-004.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-004.html.ini @@ -1,7 +1,4 @@ [anchor-scroll-position-try-004.html] - [Should use the second fallback position after scrolling viewport down] - expected: FAIL - [Should use the third fallback position after scrolling the vrl scroller left] expected: if os == "android": [PASS, FAIL] diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-005.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-005.html.ini @@ -1,3 +0,0 @@ -[anchor-scroll-position-try-005.html] - [Should use the second fallback position after scrolling left] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-006.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-006.html.ini @@ -1,10 +1,4 @@ [anchor-scroll-position-try-006.html] - [Should use the last (fourth) position option initially] - expected: FAIL - - [Should still use the last position option as long as it fits.] - expected: FAIL - [Should use the third position option with enough space below, and not enough above] expected: FAIL @@ -17,3 +11,4 @@ [Should use the first position option with enough space below and right] expected: if (os == "mac") and not debug: [PASS, FAIL] + FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-007.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-007.html.ini @@ -1,10 +1,4 @@ [anchor-scroll-position-try-007.html] - [Should use the last position option initially] - expected: FAIL - - [Should stay at initial position, since it still fits] - expected: FAIL - [Should use the third position option with enough space left] expected: FAIL @@ -14,3 +8,4 @@ [Should use the first position option with enough space left and below] expected: if (os == "mac") and not debug: [PASS, FAIL] + FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-008.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-008.html.ini @@ -1,7 +1,4 @@ [anchor-scroll-position-try-008.html] - [Should use the last fallback position initially] - expected: FAIL - [Should use the third fallback position with enough space left] expected: FAIL @@ -11,3 +8,4 @@ [Should use the first fallback position with enough space left and above] expected: if (os == "mac") and not debug: [PASS, FAIL] + FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-009.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-009.html.ini @@ -1,7 +1,4 @@ [anchor-scroll-position-try-009.html] - [Should use the last fallback position initially] - expected: FAIL - [Should use the third fallback position with enough space right] expected: FAIL @@ -12,3 +9,4 @@ expected: if (os == "mac") and not debug: [PASS, FAIL] if os == "android": [PASS, FAIL] + FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-010.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-010.html.ini @@ -1,7 +1,4 @@ [anchor-scroll-position-try-010.html] - [Should use the last fallback position initially] - expected: FAIL - [Should use the third fallback position with enough space right] expected: FAIL @@ -11,3 +8,4 @@ [Should use the first fallback position with enough space right and above] expected: if (os == "mac") and not debug: [PASS, FAIL] + FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-011.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-011.html.ini @@ -1,7 +1,4 @@ [anchor-scroll-position-try-011.html] - [Should use the last fallback position initially] - expected: FAIL - [Should use the third fallback position with enough space above] expected: FAIL @@ -11,3 +8,4 @@ [Should use the first fallback position with enough space above and right] expected: if (os == "mac") and not debug: [PASS, FAIL] + FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-012.html.ini b/testing/web-platform/meta/css/css-anchor-position/anchor-scroll-position-try-012.html.ini @@ -1,3 +1,4 @@ [anchor-scroll-position-try-012.html] expected: if (os == "win") and debug and not swgl: [PASS, FAIL] + FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/last-successful-change-fallbacks.html.ini b/testing/web-platform/meta/css/css-anchor-position/last-successful-change-fallbacks.html.ini @@ -1,3 +1,6 @@ [last-successful-change-fallbacks.html] [No successful position, keep flip-block] expected: FAIL + + [No successful position, last successful invalidated by position-try-fallbacks change] + expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-anchor-001.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-anchor-001.html.ini @@ -1,2 +0,0 @@ -[position-anchor-001.html] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-area-in-position-try.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-area-in-position-try.html.ini @@ -1,177 +1,27 @@ [position-area-in-position-try.html] - [none] + [y-self-start x-self-start] expected: FAIL - [span-all] + [y-self-start center] expected: FAIL - [span-all span-all] + [y-self-start x-self-end] expected: FAIL - [top left] + [center x-self-start] expected: FAIL - [top center] + [center x-self-end] expected: FAIL - [top right] + [y-self-end x-self-start] expected: FAIL - [center left] + [y-self-end center] expected: FAIL - [center center] + [y-self-end x-self-end] expected: FAIL - [center right] - expected: FAIL - - [bottom left] - expected: FAIL - - [bottom center] - expected: FAIL - - [bottom right] - expected: FAIL - - [start start] - expected: FAIL - - [start center] - expected: FAIL - - [start end] - expected: FAIL - - [center start] - expected: FAIL - - [center end] - expected: FAIL - - [end start] - expected: FAIL - - [end center] - expected: FAIL - - [end end] - expected: FAIL - - [self-start self-start] - expected: FAIL - - [self-start center] - expected: FAIL - - [self-start self-end] - expected: FAIL - - [center self-start] - expected: FAIL - - [center self-end] - expected: FAIL - - [self-end self-start] - expected: FAIL - - [self-end center] - expected: FAIL - - [self-end self-end] - expected: FAIL - - [y-start x-start] - expected: FAIL - - [y-start center] - expected: FAIL - - [y-start x-end] - expected: FAIL - - [center x-start] - expected: FAIL - - [center x-end] - expected: FAIL - - [y-end x-start] - expected: FAIL - - [y-end center] - expected: FAIL - - [y-end x-end] - expected: FAIL - - [self-y-start self-x-start] - expected: FAIL - - [self-y-start center] - expected: FAIL - - [self-y-start self-x-end] - expected: FAIL - - [center self-x-start] - expected: FAIL - - [center self-x-end] - expected: FAIL - - [self-y-end self-x-start] - expected: FAIL - - [self-y-end center] - expected: FAIL - - [self-y-end self-x-end] - expected: FAIL - - [span-self-y-start span-self-x-end] - expected: FAIL - - [span-bottom span-all] - expected: FAIL - - [Placement: --top] - expected: FAIL - - [Placement: --left] - expected: FAIL - - [Placement: --right, --top] - expected: FAIL - - [Placement: --bottom, --top] - expected: FAIL - - [Placement: --bottom, --right, --top] - expected: FAIL - - [Placement: --bottom, --right, --left, --top] - expected: FAIL - - [Placement: --bottom, --left, --top, --right] - expected: FAIL - - [Placement: --right flip-inline] - expected: FAIL - - [Placement: --bottom flip-block] - expected: FAIL - - [Placement: --left flip-start] - expected: FAIL - - [Placement: --left flip-inline, --top] - expected: FAIL - - [Placement: --top flip-block, --left] - expected: FAIL - - [Placement: --left flip-start flip-block, --left] + [span-y-self-start span-x-self-end] expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-try-001.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-try-001.html.ini @@ -1,7 +1,4 @@ [position-try-001.html] - [.target 2] - expected: FAIL - [.target 3] expected: FAIL @@ -10,3 +7,6 @@ [.target 5] expected: FAIL + + [.target 6] + expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-try-cascade-layer-reorder.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-try-cascade-layer-reorder.html.ini @@ -1,6 +0,0 @@ -[position-try-cascade-layer-reorder.html] - [When in the same layer, the last rule of each name wins] - expected: FAIL - - [When in different layers, the rule of each name in the highest layer wins] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-try-cascade.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-try-cascade.html.ini @@ -1,18 +1,3 @@ [position-try-cascade.html] - [@position-try rule applies] - expected: FAIL - - [@position-try rule wins over inline style] - expected: FAIL - - [@position-try rule does not win over !important] - expected: FAIL - - [@position-try rule does not win over animations] - expected: FAIL - [@position-try rule does not win over transitions] expected: FAIL - - [@position-try revert / revert-layer reverts to user / author origin] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-try-container-query.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-try-container-query.html.ini @@ -1,6 +1,3 @@ [position-try-container-query.html] - [Size container query responds to fallback width] - expected: FAIL - [Size container query responds to fallback width and applies height to not fit the first fallback] expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-try-dynamic.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-try-dynamic.html.ini @@ -1,3 +0,0 @@ -[position-try-dynamic.html] - [Left position set to right edge of anchor with @position-try] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-try-fallbacks-limit.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-try-fallbacks-limit.html.ini @@ -1,6 +1,3 @@ [position-try-fallbacks-limit.html] [Try fallbacks which are not found are not part of the limit] expected: FAIL - - [Must support At least five try fallbacks] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-try-initial-transition.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-try-initial-transition.html.ini @@ -1,3 +0,0 @@ -[position-try-initial-transition.html] - [No transition for initial style with @position-try] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-try-order-basic.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-try-order-basic.html.ini @@ -0,0 +1,39 @@ +[position-try-order-basic.html] + [most-inline-size --right, --left | --left] + expected: FAIL + + [most-width --right, --left | --left] + expected: FAIL + + [most-block-size --bottom, --top | --top] + expected: FAIL + + [most-height --bottom, --top | --top] + expected: FAIL + + [most-inline-size --right, --left, --bottom, --top | --bottom] + expected: FAIL + + [most-inline-size --right, --left, --top, --bottom | --top] + expected: FAIL + + [most-block-size --bottom, --top, --right, --left | --right] + expected: FAIL + + [most-block-size --bottom, --top, --left, --right | --left] + expected: FAIL + + [most-block-size --bottom-sweep, --left-sweep | --left-sweep] + expected: FAIL + + [most-inline-size --right-sweep, --left-sweep, --bottom-sweep, --top-sweep | --left-sweep] + expected: FAIL + + [most-block-size --right-sweep, --left-sweep, --bottom-sweep, --top-sweep | --top-sweep] + expected: FAIL + + [most-inline-size\n --right-sweep, --left-sweep, --bottom-sweep, --top-sweep,\n /* --right, --left, --bottom, --top */\n --bottom\n | --bottom] + expected: FAIL + + [most-block-size\n --right-sweep, --left-sweep, --bottom-sweep, --top-sweep,\n /* --right, --left, --bottom, --top */\n --right\n | --right] + expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-try-order-position-area.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-try-order-position-area.html.ini @@ -1,47 +1,41 @@ [position-try-order-position-area.html] expected: if (processor == "x86") and (os == "linux"): [OK, CRASH] - [--right, --left, --bottom, --top | --right] - expected: FAIL - - [normal --right, --left, --bottom, --top | --right] - expected: FAIL - - [normal --top, --left, --bottom, --right | --top] + [most-inline-size --right, --left, --bottom, --top | --bottom] expected: FAIL - [most-block-size --right, --left | --right] + [most-inline-size --right, --left, --top, --bottom | --top] expected: FAIL - [most-height --right, --left | --right] + [most-block-size --bottom, --top, --right, --left | --right] expected: FAIL - [most-inline-size --bottom, --top | --bottom] + [most-block-size --bottom, --top, --left, --right | --left] expected: FAIL - [most-width --bottom, --top | --bottom] + [most-inline-size --right-sweep, --left-sweep, --bottom-sweep, --top-sweep | --left-sweep] expected: FAIL - [most-inline-size --right, --left, --bottom, --top | --bottom] + [most-inline-size --right, --left | --left] expected: FAIL - [most-inline-size --right, --left, --top, --bottom | --top] + [most-width --right, --left | --left] expected: FAIL - [most-block-size --bottom, --top, --right, --left | --right] + [most-block-size --bottom, --top | --top] expected: FAIL - [most-block-size --bottom, --top, --left, --right | --left] + [most-height --bottom, --top | --top] expected: FAIL - [most-inline-size --left-sweep, --bottom-sweep | --left-sweep] + [most-block-size --bottom-sweep, --left-sweep | --left-sweep] expected: FAIL - [most-inline-size --bottom-sweep, --left-sweep | --bottom-sweep] + [most-block-size --right-sweep, --left-sweep, --bottom-sweep, --top-sweep | --top-sweep] expected: FAIL - [most-block-size --left-sweep, --bottom-sweep | --left-sweep] + [most-inline-size\n --right-sweep, --left-sweep, --bottom-sweep, --top-sweep,\n /* --right, --left, --bottom, --top */\n --bottom\n | --bottom] expected: FAIL - [most-inline-size --right-sweep, --left-sweep, --bottom-sweep, --top-sweep | --left-sweep] + [most-block-size\n --right-sweep, --left-sweep, --bottom-sweep, --top-sweep,\n /* --right, --left, --bottom, --top */\n --right\n | --right] expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-try-position-anchor.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-try-position-anchor.html.ini @@ -1,5 +0,0 @@ -[position-try-position-anchor.html] - expected: - if (processor == "x86") and (os == "linux"): [OK, ERROR, CRASH] - [#anchored 1] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-try-pseudo-element.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-try-pseudo-element.html.ini @@ -1,8 +0,0 @@ -[position-try-pseudo-element.html] - expected: - if (processor == "x86") and (os == "linux"): [OK, CRASH] - [::before using second fallback] - expected: FAIL - - [::after using first fallback] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/position-visibility-anchors-visible-non-intervening-container.html.ini b/testing/web-platform/meta/css/css-anchor-position/position-visibility-anchors-visible-non-intervening-container.html.ini @@ -1,3 +0,0 @@ -[position-visibility-anchors-visible-non-intervening-container.html] - fuzzy: - if (os == "win"): maxDifference=92;totalPixels=0-1 diff --git a/testing/web-platform/meta/css/css-anchor-position/try-tactic-alignment.html.ini b/testing/web-platform/meta/css/css-anchor-position/try-tactic-alignment.html.ini @@ -76,3 +76,39 @@ [flip-block, align-self:flex-end] expected: FAIL + + [flip-inline, justify-self:start;align-self:start, justify-self:end;align-self:start, ltr, horizontal-tb] + expected: FAIL + + [flip-block, justify-self:start;align-self:start, justify-self:start;align-self:end, ltr, horizontal-tb] + expected: FAIL + + [flip-block flip-inline, justify-self:start;align-self:start, justify-self:end;align-self:end, ltr, horizontal-tb] + expected: FAIL + + [flip-start, justify-self:start;align-self:end, justify-self:end;align-self:start, ltr, horizontal-tb] + expected: FAIL + + [flip-block flip-start, justify-self:start;align-self:start, justify-self:end;align-self:start, ltr, horizontal-tb] + expected: FAIL + + [flip-inline flip-start, justify-self:start;align-self:start, justify-self:start;align-self:end, ltr, horizontal-tb] + expected: FAIL + + [flip-block flip-inline flip-start, justify-self:start;align-self:start, justify-self:end;align-self:end, ltr, horizontal-tb] + expected: FAIL + + [flip-inline, justify-self:left;align-self:start, justify-self:right;align-self:start, ltr, horizontal-tb] + expected: FAIL + + [flip-start, justify-self:left;align-self:end, justify-self:end;align-self:self-start, ltr, horizontal-tb] + expected: FAIL + + [flip-start, justify-self:right;align-self:start, justify-self:start;align-self:self-end, ltr, horizontal-tb] + expected: FAIL + + [flip-start, justify-self:left;align-self:end, justify-self:end;align-self:self-start, ltr, vertical-rl] + expected: FAIL + + [flip-start, justify-self:left;align-self:start, justify-self:start;align-self:self-end, rtl, horizontal-tb] + expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/try-tactic-anchor.html.ini b/testing/web-platform/meta/css/css-anchor-position/try-tactic-anchor.html.ini @@ -1,21 +1,114 @@ [try-tactic-anchor.html] - [CSS Anchor Positioning: try-tactic, anchor()] + [flip-start] expected: FAIL - [flip-inline] + [flip-inline flip-start] expected: FAIL - [flip-block] + [flip-start flip-block] expected: FAIL - [flip-start] + [Can transform a value post-var-substitution] expected: FAIL - [flip-inline flip-start] + [flip-start, right:anchor(left), bottom:anchor(top)] expected: FAIL - [flip-start flip-block] + [flip-start, bottom:anchor(top), right:anchor(left)] expected: FAIL - [Can transform a value post-var-substitution] + [flip-inline flip-start, right:anchor(left), top:anchor(bottom)] + expected: FAIL + + [flip-start flip-inline, top:anchor(bottom), right:anchor(left)] + expected: FAIL + + [flip-start flip-block, left:anchor(right), bottom:anchor(top)] + expected: FAIL + + [flip-block flip-start, bottom:anchor(top), left:anchor(right)] + expected: FAIL + + [flip-start, left:anchor(right), top:anchor(bottom)] + expected: FAIL + + [flip-start, top:anchor(bottom), left:anchor(right)] + expected: FAIL + + [flip-block, bottom:anchor(top), top:anchor(bottom)] + expected: FAIL + + [flip-block, top:anchor(bottom), bottom:anchor(top)] + expected: FAIL + + [flip-inline, right:anchor(start), left:anchor(right)] + expected: FAIL + + [flip-inline, left:anchor(end), right:anchor(left)] + expected: FAIL + + [flip-start, right:anchor(start), bottom:anchor(top)] + expected: FAIL + + [flip-start, bottom:anchor(start), right:anchor(left)] + expected: FAIL + + [flip-inline flip-start, right:anchor(start), top:anchor(bottom)] + expected: FAIL + + [flip-start flip-inline, top:anchor(end), right:anchor(left)] + expected: FAIL + + [flip-start flip-block, left:anchor(end), bottom:anchor(top)] + expected: FAIL + + [flip-block flip-start, bottom:anchor(start), left:anchor(right)] + expected: FAIL + + [flip-start, left:anchor(end), top:anchor(bottom)] + expected: FAIL + + [flip-start, top:anchor(end), left:anchor(right)] + expected: FAIL + + [flip-block, bottom:anchor(start), top:anchor(bottom)] + expected: FAIL + + [flip-block, top:anchor(end), bottom:anchor(top)] + expected: FAIL + + [flip-inline, right:anchor(self-start), left:anchor(right)] + expected: FAIL + + [flip-inline, left:anchor(self-end), right:anchor(left)] + expected: FAIL + + [flip-start, right:anchor(self-start), bottom:anchor(top)] + expected: FAIL + + [flip-start, bottom:anchor(self-start), right:anchor(left)] + expected: FAIL + + [flip-inline flip-start, right:anchor(self-start), top:anchor(bottom)] + expected: FAIL + + [flip-start flip-inline, top:anchor(self-end), right:anchor(left)] + expected: FAIL + + [flip-start flip-block, left:anchor(self-end), bottom:anchor(top)] + expected: FAIL + + [flip-block flip-start, bottom:anchor(self-start), left:anchor(right)] + expected: FAIL + + [flip-start, left:anchor(self-end), top:anchor(bottom)] + expected: FAIL + + [flip-start, top:anchor(self-end), left:anchor(right)] + expected: FAIL + + [flip-block, bottom:anchor(self-start), top:anchor(bottom)] + expected: FAIL + + [flip-block, top:anchor(self-end), bottom:anchor(top)] expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/try-tactic-basic.html.ini b/testing/web-platform/meta/css/css-anchor-position/try-tactic-basic.html.ini @@ -20,9 +20,6 @@ [--pf flip-block flip-inline flip-start] expected: FAIL - [--pf] - expected: FAIL - [--pf flip-inline flip-block] expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/try-tactic-margin.html.ini b/testing/web-platform/meta/css/css-anchor-position/try-tactic-margin.html.ini @@ -19,6 +19,3 @@ [--pf flip-block flip-inline flip-start] expected: FAIL - - [--pf] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/try-tactic-percentage.html.ini b/testing/web-platform/meta/css/css-anchor-position/try-tactic-percentage.html.ini @@ -0,0 +1,78 @@ +[try-tactic-percentage.html] + [flip-inline, left:anchor(10%), right:anchor(90%)] + expected: FAIL + + [flip-inline, left:anchor(calc(10% + 20%)), right:anchor(70%)] + expected: FAIL + + [flip-inline, left:anchor(0%), right:anchor(100%)] + expected: FAIL + + [flip-inline, left:anchor(100%), right:anchor(0%)] + expected: FAIL + + [flip-inline, top:anchor(0%), top:anchor(0%)] + expected: FAIL + + [flip-inline, top:anchor(100%), top:anchor(100%)] + expected: FAIL + + [flip-block flip-inline, left:anchor(0%), right:anchor(100%)] + expected: FAIL + + [flip-block flip-inline, left:anchor(100%), right:anchor(0%)] + expected: FAIL + + [flip-block flip-inline, top:anchor(0%), bottom:anchor(100%)] + expected: FAIL + + [flip-block flip-inline, top:anchor(100%), bottom:anchor(0%)] + expected: FAIL + + [flip-start, left:anchor(0%), top:anchor(0%)] + expected: FAIL + + [flip-start, left:anchor(100%), top:anchor(100%)] + expected: FAIL + + [flip-start, bottom:anchor(0%), right:anchor(0%)] + expected: FAIL + + [flip-start, bottom:anchor(100%), right:anchor(100%)] + expected: FAIL + + [flip-block flip-start, left:anchor(0%), top:anchor(0%)] + expected: FAIL + + [flip-block flip-start, left:anchor(100%), top:anchor(100%)] + expected: FAIL + + [flip-block flip-start, bottom:anchor(0%), left:anchor(100%)] + expected: FAIL + + [flip-block flip-start, bottom:anchor(100%), left:anchor(0%)] + expected: FAIL + + [flip-inline flip-start, left:anchor(0%), bottom:anchor(100%)] + expected: FAIL + + [flip-inline flip-start, left:anchor(100%), bottom:anchor(0%)] + expected: FAIL + + [flip-inline flip-start, bottom:anchor(0%), right:anchor(0%)] + expected: FAIL + + [flip-inline flip-start, bottom:anchor(100%), right:anchor(100%)] + expected: FAIL + + [flip-block flip-inline flip-start, left:anchor(0%), bottom:anchor(100%)] + expected: FAIL + + [flip-block flip-inline flip-start, left:anchor(100%), bottom:anchor(0%)] + expected: FAIL + + [flip-block flip-inline flip-start, bottom:anchor(0%), left:anchor(100%)] + expected: FAIL + + [flip-block flip-inline flip-start, bottom:anchor(100%), left:anchor(0%)] + expected: FAIL diff --git a/testing/web-platform/meta/css/css-anchor-position/try-tactic-wm.html.ini b/testing/web-platform/meta/css/css-anchor-position/try-tactic-wm.html.ini @@ -1,7 +1,4 @@ [try-tactic-wm.html] - [ horizontal-tb ltr] - expected: FAIL - [flip-inline horizontal-tb ltr] expected: FAIL diff --git a/testing/web-platform/tests/css/css-anchor-position/anchor-scroll-position-try-006.html b/testing/web-platform/tests/css/css-anchor-position/anchor-scroll-position-try-006.html @@ -3,6 +3,7 @@ <link rel="author" href="mailto:xiaochengh@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-anchor-1/#scroll"> <link rel="help" href="https://drafts.csswg.org/css-anchor-1/#fallback-apply"> +<meta name="viewport" content="width=device-width, initial-scale=1" /> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="support/test-common.js"></script> diff --git a/testing/web-platform/tests/css/css-anchor-position/anchor-scroll-position-try-009.html b/testing/web-platform/tests/css/css-anchor-position/anchor-scroll-position-try-009.html @@ -3,6 +3,7 @@ <link rel="author" href="mailto:xiaochengh@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-anchor-1/#scroll"> <link rel="help" href="https://drafts.csswg.org/css-anchor-1/#fallback-apply"> +<meta name="viewport" content="width=device-width, initial-scale=1"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="support/test-common.js"></script> diff --git a/testing/web-platform/tests/css/css-anchor-position/anchor-scroll-position-try-010.html b/testing/web-platform/tests/css/css-anchor-position/anchor-scroll-position-try-010.html @@ -3,6 +3,7 @@ <link rel="author" href="mailto:xiaochengh@chromium.org"> <link rel="help" href="https://drafts.csswg.org/css-anchor-1/#scroll"> <link rel="help" href="https://drafts.csswg.org/css-anchor-1/#fallback-apply"> +<meta name="viewport" content="width=device-width, initial-scale=1"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="support/test-common.js"></script> diff --git a/testing/web-platform/tests/css/css-anchor-position/at-position-try-invalidation.html b/testing/web-platform/tests/css/css-anchor-position/at-position-try-invalidation.html @@ -1,6 +1,7 @@ <!DOCTYPE html> <title>CSS Anchor Positioning Test: Dynamically change @position-try rules</title> <link rel="help" href="https://drafts.csswg.org/css-anchor-1/#fallback-rule"> +<meta name="viewport" content="width=device-width, initial-scale=1"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <style>