

























@@ -1541,32 +1541,37 @@ Style Container Features</h3>
15411541<h3 id="scroll-state-container">
15421542Scroll State Container Features</h3>
154315431544- A <dfn export>container scroll-state query</dfn> allows querying a container for
1545- state that depends on scroll position. It is a boolean combination of
1546- individual <dfn lt="scroll-state feature">scroll-state features</dfn>
1547- (<<scroll-state-feature>>) that each query a single feature of the
1548-[=query container=]. The syntax of a <dfn><<scroll-state-feature>></dfn> is the
1549- same as for a [=media feature=]: a feature name, a comparator, and a value.
1550-1551-[=Scroll-state features=] can either match state of the scroller itself,
1552- or an element that is affected by the scroll position of an ancestor
1553-[=scroll container's=] [=scrollport=]. An example of the former is the
1554-''scrollable'' feature, ''snapped'' the latter.
1544+ A <dfn export>container scroll-state query</dfn>
1545+ allows querying a container for state that depends on scroll position.
1546+ It is a boolean combination
1547+ of individual <dfn lt="scroll-state feature">scroll-state features</dfn>
1548+ (<<scroll-state-feature>>)
1549+ that each query a single feature of the [=query container=].
1550+ The syntax of a <dfn><<scroll-state-feature>></dfn> is the same as for a [=media feature=]:
1551+ a feature name, a comparator, and a value.
1552+1553+[=Scroll-state features=] can either match state of the scroller itself
1554+ (such as the ''scollable'' feature),
1555+ or an element that is affected by the scroll position
1556+ of an ancestor [=scroll container's=] [=scrollport=]
1557+ (such as the ''snapped'' feature).
1555155815561559<h4 id="updating-scroll-state">
15571560Updating Scroll State</h4>
1558156115591562 Scroll state may cause layout cycles since queried scroll state may cause style changes,
15601563 which may lead to scroll state changes as a result of layout.
156115641562- To avoid such layout cycles, ''scroll-state'' [=query containers=] update their
1563- current state as part of [=run snapshot post-layout state steps=] which is only
1564- run at specific points in the
1565+ To avoid such layout cycles,
1566+''scroll-state'' [=query containers=] update their current state
1567+ as part of [=run snapshot post-layout state steps=]
1568+ which is only run at specific points in the
15651569<a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model">HTML event loop processing model</a>.
156615701567- When asked to [=run snapshot post-layout state steps=], update the current state
1568- of every ''scroll-state'' [=query container=]. This snapshotted state will be used
1569- for any style and layout updates until the next time these steps are run.
1571+ When asked to [=run snapshot post-layout state steps=],
1572+ update the current state of every ''scroll-state'' [=query container=].
1573+ This snapshotted state will be used for any style and layout updates
1574+ until the next time these steps are run.
1570157515711576<h4 id="stuck">
15721577Sticky positioning: the '@container/stuck' feature</h4>
@@ -1648,9 +1653,10 @@ Scroll snapping: the '@container/snapped' feature</h4>
16481653 container-queries/scroll-state/scroll-state-snapped-pseudo.html
16491654</wpt>
165016551651- The '@container/snapped' [=container feature=] queries whether a [=snap target=]
1652- is, or would be, snapped to its [=scroll snap container=], in the given axis. That is,
1653- it matches any [=snap target=] that the {{scrollsnapchanging}} event is fired for.
1656+ The '@container/snapped' [=container feature=] queries
1657+ whether a [=snap target=] is, or would be,
1658+ snapped to its [=scroll snap container=] in the given axis.
1659+ That is, it matches any [=snap target=] that the {{scrollsnapchanging}} event is fired for.
1654166016551661<dl dfn-type=value dfn-for="@container/snapped">
16561662<dt><dfn>none</dfn>
@@ -1700,15 +1706,15 @@ Scrollable: the '@container/scrollable' feature</h4>
17001706 container-queries/scroll-state/scroll-state-scrollable-root.html
17011707</wpt>
170217081703- The '@container/scrollable' [=container feature=] queries whether a
1704-[=scroll container=] has clipped [=scrollable overflow rectangle=] content
1705-in the given direction which is reachable through user initiated scrolling.
1706- That is, '@container/scrollable' does not match for a ''overflow/hidden''
1707-container, nor for a [=unreachable scrollable overflow region=].
1709+ The '@container/scrollable' [=container feature=] queries
1710+whether a [=scroll container=] has clipped [=scrollable overflow rectangle=] content in the given direction
1711+ which is reachable through user initiated scrolling.
1712+ That is, '@container/scrollable' does not match for a ''overflow/hidden'' container,
1713+ nor for a [=unreachable scrollable overflow region=].
170817141709- The logical values map to physical based on the direction and writing-mode of
1710- the [=query container=]. None of the values match if the container is not a
1711-[=scroll container=].
1715+ The logical values map to physical
1716+based on the direction and writing-mode of the [=query container=].
1717+None of the values match if the container is not a [=scroll container=].
1712171817131719<dl dfn-type=value dfn-for="@container/scrollable">
17141720<dt><dfn>none</dfn>
@@ -1784,8 +1790,10 @@ Scrolled: the '@container/scrolled' feature</h4>
17841790</wpt>
1785179117861792 For a [=query container=] that is a [=scroll container=],
1787- the '@container/scrolled' [=container feature=] queries the direction of its most recent [=relative scroll=].
1788- The logical values map to physical based on the direction and writing-mode of the [=query container=].
1793+ the '@container/scrolled' [=container feature=] queries the direction
1794+ of its most recent [=relative scroll=].
1795+ The logical values map to physical
1796+ based on the direction and writing-mode of the [=query container=].
17891797 None of the values match if the container is not a [=scroll container=].
1790179817911799<dl dfn-type=value dfn-for="@container/scrolled">
@@ -1836,8 +1844,8 @@ Container Relative Lengths: the ''cqw'', ''cqh'', ''cqi'', ''cqb'', ''cqmin'', '
1836184418371845<dfn export lt="container query length | container query length unit">Container query length units</dfn>
18381846 specify a length relative to the dimensions of a [=query container=].
1839- Style sheets that use [=container query length=] units can more easily move components
1840- from one [=query container=] to another.
1847+ Style sheets that use [=container query length=] units
1848+can more easily move components from one [=query container=] to another.
1841184918421850 The [=container query length=] units are:
18431851此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。