Skip to content

Commit 754dfee

Browse files
committed
[css-anchor-position] Record last-successful position option at the same time as we forget. Specify more precisely *what* is being remembered. #10216
1 parent 95d8782 commit 754dfee

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

css-anchor-position-1/Overview.bs

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,8 +1809,7 @@ even tho they depend on layout and [=used values=].
18091809
4. If |el rect| is not fully contained within |cb rect|,
18101810
[=iteration/continue=].
18111811

1812-
5. Set |option| as |el|'s <dfn>last successful position option</dfn>.
1813-
Return |adjusted styles|.
1812+
5. Return |adjusted styles|.
18141813

18151814
3. Assert: The previous step finished without finding a [=position option=]
18161815
that avoids overflow.
@@ -1846,18 +1845,29 @@ laying out later elements cannot change this decision.
18461845
Layout does not "go backward", in other words.
18471846
</div>
18481847

1849-
<div algorithm="forget the last rememberd @position-try option">
1850-
At the time that {{ResizeObserver}} events are determined and delivered,
1851-
if an element |el| has a [=last successful position option=]
1852-
and if any of the following are true of it,
1853-
remove its [=last successful position option=]:
1848+
<div algorithm="remember or forget the last rememberd position option">
1849+
At the time that {{ResizeObserver}} events are determined and delivered:
18541850

1855-
* |el| is not an [=absolutely positioned=] element
1856-
* |el|'s computed value for 'position-try-options' has changed
1857-
* Any of the ''@position-try'' rules referenced by |el|'s 'position-try-options'
1858-
have been added, removed, or mutated.
1851+
* If an element |el| is [=absolutely positioned=],
1852+
set its [=last successful position option=]
1853+
to the set of [=accepted @position-try properties=] (and values)
1854+
that it's currently using.
18591855

1860-
Note: The timing of this removal
1856+
* Otherwise, if |el| has a [=last successful position option=]
1857+
and if any of the following are true of it,
1858+
remove its [=last successful position option=]:
1859+
1860+
* |el| is not an [=absolutely positioned=] element
1861+
* |el|'s computed value for 'position-try-options' has changed
1862+
* Any of the ''@position-try'' rules referenced by |el|'s 'position-try-options'
1863+
have been added, removed, or mutated.
1864+
1865+
Then, [=determine the position fallback styles=] of |el|
1866+
and set its [=last successful position option=]
1867+
to the set of [=accepted @position-try properties=] (and values)
1868+
that it's now using.
1869+
1870+
Note: The timing of this recording/removal
18611871
is intentionally identical to the treatment of [=last remembered sizes=].
18621872
</div>
18631873

0 commit comments

Comments
 (0)