<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>289743</bug_id>
          <alias>css-anchor-position-1-wpt</alias>
          <creation_ts>2025-03-13 15:54:49 -0700</creation_ts>
          <short_desc>[css-anchor-position-1] Failing WPT tests</short_desc>
          <delta_ts>2026-03-28 00:07:19 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>295006</dependson>
    
    <dependson>310959</dependson>
    
    <dependson>212372</dependson>
    
    <dependson>295002</dependson>
    
    <dependson>295003</dependson>
    
    <dependson>295005</dependson>
    
    <dependson>295009</dependson>
    
    <dependson>295011</dependson>
    
    <dependson>295012</dependson>
    
    <dependson>295013</dependson>
    
    <dependson>295014</dependson>
    
    <dependson>295924</dependson>
    
    <dependson>295964</dependson>
    
    <dependson>296309</dependson>
    
    <dependson>296314</dependson>
    
    <dependson>296445</dependson>
    
    <dependson>297159</dependson>
    
    <dependson>299836</dependson>
    
    <dependson>299844</dependson>
    
    <dependson>300373</dependson>
    
    <dependson>300398</dependson>
    
    <dependson>300399</dependson>
    
    <dependson>306830</dependson>
    
    <dependson>306831</dependson>
          <blocked>291856</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Kiet Ho">kiet.ho</reporter>
          <assigned_to name="Kiet Ho">kiet.ho</assigned_to>
          <cc>fantasai.bugs</cc>
    
    <cc>kiet.ho</cc>
    
    <cc>koivisto</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2103096</commentid>
    <comment_count>0</comment_count>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2025-03-13 15:54:49 -0700</bug_when>
    <thetext>imported/w3c/web-platform-tests/css/css-anchor-position/anchor-position-multicol-007.html
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-position-multicol-008.html
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scope-scroll.html
imported/w3c/web-platform-tests/css/css-anchor-position/position-area-scrolling-004.tentative.html
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-center-fallback-transition-behavior.html
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scope-basic.html
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-position-try-001.html
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-position-try-006.html
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-position-try-007.html
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-position-try-008.html
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-position-try-009.html
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-position-try-010.html
imported/w3c/web-platform-tests/css/css-anchor-position/anchor-size-parse-valid.html
imported/w3c/web-platform-tests/css/css-anchor-position/last-successful-iframe.html
imported/w3c/web-platform-tests/css/css-anchor-position/position-area-scrolling-001.tentative.html
imported/w3c/web-platform-tests/css/css-anchor-position/position-area-scrolling-002.tentative.html
imported/w3c/web-platform-tests/css/css-anchor-position/position-area-scrolling-005.html
imported/w3c/web-platform-tests/css/css-anchor-position/position-area-scrolling-006.html
imported/w3c/web-platform-tests/css/css-anchor-position/position-area-scrolling-007.html
imported/w3c/web-platform-tests/css/css-anchor-position/position-try-fallbacks-003.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2103097</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-03-13 15:56:41 -0700</bug_when>
    <thetext>&lt;rdar://problem/146993999&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2103103</commentid>
    <comment_count>2</comment_count>
    <who name="Kiet Ho">kiet.ho</who>
    <bug_when>2025-03-13 16:07:22 -0700</bug_when>
    <thetext>Tim notices that 292089@main doesn&apos;t fix the failures in

LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-try-order-position-area.html
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/position-try-order-basic.html

Then the test got changed (https://github.com/web-platform-tests/wpt/commit/08aa9091e58d0c9c7b3f653c795cd80f8718bfdc) so now they pass in WebKit.
But the test change removed some cases that quite possibly, removed cases that WebKit failed. So needs more investigation here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2123877</commentid>
    <comment_count>3</comment_count>
    <who name="fantasai">fantasai.bugs</who>
    <bug_when>2025-06-15 22:11:20 -0700</bug_when>
    <thetext>Analysis of WPT Failures Part 1!
 https://wpt.fyi/results/css/css-anchor-position?label=experimental&amp;label=master&amp;aligned

anchor-animation-dynamic-name - Passes on trunk.
anchor-center-fallback-transition-behavior - Seems to be an incorrect test?
anchor-function-pseudo-element-basic - Passes on trunk.
anchor-function-pseudo-element-implicit-anchor - Passes on trunk.
anchor-getComputedStyle-002 - Fragmentation (multicol, inline) bug. (A,B)
anchor-ident-function - Testing ident() function. Also other stuff that should be split out.
anchor-name-inline-002 - Passes on trunk.
anchor-name-multicol-* - Multicol bug. (A)
anchor-position-borders-002 - Scrollbar gutter calculation bug. (C)
anchor-position-flip-sibling-index - Testing sibling-index() function.
anchor-position-grid-001 - Multicol bug. (A)
anchor-position-inline-00[123] - Passes on trunk.
anchor-position-inline-004 - Multicol bug. (A)
anchor-position-multicol-* - Multicol bug. (A)
anchor-position-sibling-index - Testing sibling-index() function.
anchor-position-top-layer-* - Top layer bug. (D)
anchor-scope-scroll - Off-by-one anchor-scope bug. (E)
anchor-scope-shadow-names - ::part() names not scoped correctly. (F)
anchor-scroll-003 - Multicol bug. (A)
anchor-scroll-004 - Inline abspos containing blocks break stuff. (G)
anchor-scroll-006 - No scroll adjustment for fixedpos anchored boxes. (H)
anchor-scroll-007 - No scroll adjustment for fixedpos multi-anchored boxes. (H)
anchor-scroll-chained - No scroll adjustment when anchored to scroll-adjusted anchored box. (I)
anchor-scroll-fixedpos - No scroll adjustment for fixedpos anchored boxes. (H)
anchor-scroll-js-expose - Element.offset*, IntersectionObserver not updated for scroll.


Missing features unrelated to anchor positioning that cause us to fail tests in this directory:
- ident()
- sibling-index()

Bugs related to anchor positioning that cause us to fail tests in this directory:
A. Multicol fragmentation is not handled correctly.
B. Inline fragmentation is not handled correctly?
C. Non-overlay scrollbars unaccounted for in anchor() calculations.
D. Anchoring relationships across top-level layers not handled correctly.
E. Off-by-one error for anchor-scope: same element can name and scope to descendants.
F. Names declared on ::part() not scoped to match light DOM slotted elements.
G. Inline abspos containing blocks cause several miscalculations:
      - The positions of the anchored boxes are wrong.
      - They attach to the wrong element (always the last one)
         when multiple anchors share an anchor name.
H. Anchored boxes with &apos;position: fixed&apos; aren&apos;t scroll-adjusted.
I. Boxes anchored to an anchored box that is scroll-adjusted aren&apos;t scroll-adjusted along with their anchor.
J. Element.offset* is not updated by scroll-adjustments.
K. IntersectionObserver is not fired when scroll-adjustment changes visibility.


Other bugs noticed during triage:
- anchor-scope changes don&apos;t cause style/layout invalidation, but should.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2125629</commentid>
    <comment_count>4</comment_count>
    <who name="fantasai">fantasai.bugs</who>
    <bug_when>2025-06-24 17:06:07 -0700</bug_when>
    <thetext>Analysis of WPT Failures Part 2!
 https://wpt.fyi/results/css/css-anchor-position?label=experimental&amp;label=master&amp;aligned

anchor-scroll-position-try-* - Scrolling doesn&apos;t trigger fallback for anchor(). (J)
anchor-scroll-to-sticky-00[34] - Anchored box painted underneath scrollbars in sibling. (K)
anchor-scroll-update-003 - Seems to pass on trunk.
anchor-scroll-update-00[56] - Zero-height anchor treated as invisible. (L) Also test seems to be wrong?
anchor-scroll-update-007 - Seems to pass on trunk.
anchor-transition-focus - Seems to pass on trunk.
anchor-transition-name - Seems to pass on trunk.
at-position-try-cssom - Seems to pass on trunk.
last-successful-* - Successful option not remembered across style change. (M)
popover-implicit-anchor - WPT harness failure. Test actually seems to pass on trunk.
position-area-inline-container - Inline containing blocks not supported.
position-area-pseudo-element-implicit-anchor - Passes on trunk.
position-area-scrolling-00[123].tentative.html - Paints correctly, unsure about offset*. (O)
position-area-scrolling-00[567].html - Container, not scrollable area, needs to trigger fallbacks. (P)
position-try-backdrop - position-try on ::backdrop not supported. (Q)
position-try-cascade-layer-reorder - @position-try changes don&apos;t invalidate correctly. (R)
position-try-cascade - revert-layer should revert the @position-try origin only (S)
position-try-container - container query height fails to cycle back into position-try fallback choice (T)
position-try-fallbacks-003 - Fallback not triggered by scrolling CB. (P)
position-try-grid-001 - anchor() fails to account for grid area (U)
position-try-ident-function - Requires support for ident().
position-try-pseudo-elements - position-try not supported on ::before/::after (V)
position-try-switch-to-fixed-anchor - fixed position scrolling not handled (H)
position-try-tree-scoped - Open shadow DOM fails to inherit @position-try (W)
position-visibility-anchors-valid - &apos;position-visibility: anchors-valid&apos; unsupported (ZB)
position-visibility-anchors-visible-chained - Chained visibility change invalidation failure (Z)
position-visibility-anchors-visible-change-anchor - Change invalidation failure (Z)
position-visibility-remove-*no-overflow* - &apos;position-visibility: no-overflow&apos; unsupported (ZA)
position-visibility-anchors-visible-with-position - Seems to be an incorrect test?
position-visibility-remove-anchors-visible - Seems to be an incorrect test?
transform-00*.tentative - Anchor rect fails to account for anchor transforms. (X)
try-tactic-position-area - Need to simplify position-area serialization. (Y)

Bugs related to anchor positioning that cause us to fail tests in this directory (continued):

J. Scrolling the anchor doesn&apos;t trigger fallback when needed for anchor()-positioned box whose containing block is scroller. (Related to P.)
K. Anchoring a box to the child of a sibling scroller paints it underneath that scroller&apos;s scrollbars.
L. Zero-height anchors treated as invisible even if within visible range.
M. Earlier try options are ignored if a previous layout attempt adopted a successful option further down the list.
N. Inline absolute positioning containing blocks not supported.
O. Tests check offsetTop/Left/Width/Height, but unclear these should change.
P. Scrolling doesn&apos;t trigger fallback when needed for position-area box whose containing block is scroller. (Related to J.)
Q. Missing support for anchor positioning on ::backdrop.
R. @position-try changes don&apos;t invalidate and recalculate style correctly.
S. revert-layer reverts the top author layer in addition to the position-try origin
T. height from container query fails to cycle back into fallback choice
U. anchor() functions don&apos;t account for grid area insets
V. position-try-fallbacks not supported on ::before/::after
W. Open shadow roots are unable to see @position-try rules from outer scopes (but correctly ignore inner scopes).
X. Test expects anchor rect to reflect anchor box transforms.
Y. https://bugs.webkit.org/show_bug.cgi?id=291004
Z. Anchoring a box to an anchored box fails to hide or to invalidate correctly when the original anchor&apos;s visibility changes.

ZA. &apos;position-visibility: no-overflow&apos; unsupported
ZB. &apos;position-visibility: anchors-valid&apos; unsupported


Other bugs noticed during triage:
b. Scrolling the anchor partially out of view causes the anchored box to detach from the anchor. (anchor-scroll-position-try-001)
c. Grid area insets don&apos;t trigger fallbacks. (position-try-grid variant)

Possible spec issues:
- Behavior required in J &amp; P might not be well specified, and might conflict with other expecations, see e.g.
  https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cdiv%20style%3D%22width%3A%20100px%3B%20height%3A%20100px%3B%20border%3A%20solid%3B%20overflow%3A%20scroll%3B%20position%3A%20relative%22%3E%0A%20%20%3Cdiv%20style%3D%22width%3A%20200px%3B%20height%3A%20200px%3B%20background%3A%20aqua%3B%22%3E%3C%2Fdiv%3E%0A%20%20%3Cdiv%20style%3D%22border%3A%20solid%20orange%2010px%3B%20position%3A%20absolute%3B%20top%3A%200%3B%20left%3A%200%3B%20right%3A%200%3B%20bottom%3A%200%22%3E%3C%2Fdiv%3E
  and position-visibility-anchors-visible-with-position.html</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>