




























@@ -596,30 +596,35 @@ by matching the relevant parts of the navigation URL to the link URL.
596596NOTE: Some of the design discussion for this feature has been in
597597<a href="https://github.com/w3c/csswg-drafts/issues/13163">w3c/csswg-drafts#13163</a>.
598598599-<h3 id="trigger-link-pseudo-class">The '':trigger-link'' pseudo-class</h3>
599+<h3 id="nav-source-pseudo-class">The '':nav-source'' pseudo-class</h3>
600600601-This specification defines a new
602-<dfn id="trigger-link-pseudo" selector>'':trigger-link''</dfn>
603-that matches link elements that trigger the current navigation.
604-605-The '':trigger-link'' pseudo-class matches any element where both:
606-* the element matches '':any-link''
607-* the [=current navigation state=] is not null, and element is its [=navigation state/source element=].
601+This specification defines a <dfn id="nav-source-pseudo" selector>'':nav-source''</dfn> pseudo-class,
602+matching the element that triggered the current navigation. It is a CSS reflection of the {{NavigateEvent/sourceElement}} property in the Navigation API.
603+The trigger element can be an [^a^], [^area^], [^form^], a [^input/type/submit^] input, or a [^button^].
608604609-Issue: should this apply to forms or submit buttons?
605+The '':nav-source'' pseudo-class matches any element <var>el</var> where
606+the [=current navigation state=] is not null, and <var>el</var> is its [=navigation state/source element=].
610607611608<div class="example">
612609613-A simple example of a '':trigger-link'' selector is this one,
610+A simple example of a '':nav-source'' selector is this one,
614611which sets the ''view-transition-name'' for an image thumbnail that is a child of the link that triggers the current navigation.
615612616-617-<pre highlight=css>
618-:trigger-link .thumb {
613+<pre highlight=css>``
614+a:nav-source .thumb {
619615 view-transition-name: active-image;
620616}
621617</pre>
622618619+The '':nav-source'' pseudo-class can also be used for forms and submit buttons:
620+621+<pre highlight=css>``
622+form:nav-source .submit,
623+.submit:nav-source {
624+ outline: 3px solid green;
625+}
626+</pre>
627+623628</div>
624629625630<h2 id="conditional-navigation-queries">Conditional rules for navigation queries</h2>
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。