v156 · css · selectors · enabled by default
CSS pseudo-class for navigation source element
The :navigation-source pseudo-class matches the element that triggered the document’s current navigation — the clicked link, the submitted form, or its submit button — and keeps matching it for the whole lifetime of that navigation. It is the CSS reflection of the Navigation API’s NavigateEvent.sourceElement, and its headline use is cross-document view transitions: give the thumbnail inside the clicked link a view-transition-name in pure CSS, with no JavaScript at all.
at a glance
| What it is | A new selector, :navigation-source, defined in CSS Navigation Matching Level 1 §2.2: “matching the element that triggered the current navigation … a CSS reflection of the sourceElement property in the Navigation API” |
|---|---|
| Why | Lets the outgoing page style the navigation’s trigger element declaratively — chiefly to assign view-transition-name for cross-document view transitions (ChromeStatus motivation; originating proposal csswg-drafts #11801) |
| Milestone listing | Chrome 156 — listed under “Enabled by default” in the milestone=156 listing (fetched 2026-11-01; the listing is authoritative for filing). Ship targets: desktop 156, Android 156, WebView 156 per the ChromeStatus API record |
| Runtime feature | NavigationSourcePseudoClass — status: "stable" (and implied_by: ["RouteMatching"]) in runtime_enabled_features.json5 at trunk, verified 2026-11-01 — on by default, no flag needed |
| Intent to Ship | blink-dev: Intent to Ship — CSS pseudo-class for navigation source element (posted 2026-09-03; three LGTMs 2026-09-08/09) |
| ChromeStatus | 6327898878377984 — CSS pseudo-class for navigation source element (blink component Blink>CSS; tracking bug 530210946) |
| Vendor positions | Firefox: requested, no signal (mozilla/standards-positions #1447). Safari: requested, no signal (WebKit/standards-positions #715) |
why it exists
Cross-document view transitions can morph an element on the old page into an element on the new page, but only if the old page tags the element with a view-transition-name before it unloads. Until now that meant JavaScript: listen for clicks or navigate events, find the trigger, set the name. csswg-drafts issue #11801 (opened by Bramus, 2025-02-28, as :navigation-trigger) proposed doing it in pure CSS; the CSS Working Group resolved to adopt it, broadened it beyond links to forms and buttons, and landed it in the CSS Navigation Matching draft via PR #14122 (merged 2026-07-01) under the final name :navigation-source. The ChromeStatus record’s web-developer signal is “Strongly positive”, quoting Jeremy Keith on the wider CSS Navigation Matching spec: “This would absolutely turbo-charge cross-document view transitions with nary a line of JavaScript in sight.”
syntax
:navigation-source is a plain, argument-less pseudo-class (css-navigation-1 §2.2). Like every pseudo-class it contributes class-level specificity (0,1,0) to a compound selector (Selectors Level 4 §17).
/* the trigger element itself */
:navigation-source { … }
/* scoped to a specific element kind */
a:navigation-source { … }
form:navigation-source { … }
/* descendants of the trigger */
a:navigation-source .thumb { … }
Feature-detect it with the selector() form of @supports / CSS.supports():
@supports selector(:navigation-source) {
/* safe to rely on the pseudo-class */
}
Source: css-navigation-1 §2.2; selectors-4 specificity; css-conditional-4 selector()
what it matches
Quoting the spec’s matching rule verbatim: “The :navigation-source pseudo-class matches any element el where the current navigation state is not null, and el is its source element.” The trigger element can be an <a>, <area>, <form>, an <input type="submit">, or a <button> (css-navigation-1 §2.2).
- Link navigations — clicking an
<a>or<area>: that element matches. - Form submissions — the
<form>element is the source; where the submission was initiated by a submit button, that<input type="submit">or<button>can be the source element. - Script navigations —
location.assign(),navigation.navigate()and friends have no triggering element, so the source element is null and nothing matches.
While :navigation-source matches, the element is an ordinary selector target: any declaration can apply, and the headline pattern is assigning view-transition-name so the old-page snapshot participates in a cross-document view transition. Because the selector stays matched “throughout the navigation” (ChromeStatus summary), it also works for same-document feedback such as loading indicators on the clicked link or submitted form.
lifecycle — the navigation state behind the match
Matching is driven by the document’s current navigation state, a spec-level struct (css-navigation-1 §4, Processing model) holding the old and new URLs, the NavigationType, the old and new history indices, a phase (loading → ready → committed), and the source element (null or an Element). The algorithm that computes it:
- A document that is not fully active has no navigation state — the pseudo-class never matches there.
- While a navigation is ongoing, the state is derived from the Navigation API’s ongoing
navigateevent: the source element is that event’ssourceElement, and the phase advances fromloadingtocommittedas the event’s interception state progresses. This is the window in which:navigation-sourcematches — it starts when the navigation starts and ends when the navigation finishes (on cross-document navigations, when the old document is torn down). - On the destination document before it has been revealed, the state is reconstructed from
navigation.activationwith the source element explicitly null — so the pseudo-class matches in the outgoing document only; it does not carry over into the new page. The spec also notes that navigations occurring before reveal (for examplepushState()in<head>) do not reflect in CSS at all.
There is no way to cancel or re-trigger the match from CSS; it tracks the navigation’s own lifetime. A second navigation replaces the current navigation state, moving the match to the new trigger element.
Source: css-navigation-1 §4; HTML —NavigateEvent.sourceElement
where it applies
The selector is usable in any CSS context in a document that supports the Navigation API’s navigation state — style rules, @supports selector(), querySelector(). It needs no flag, permission, policy, or secure-context opt-in in Chrome 156: the runtime feature record NavigationSourcePseudoClass is status: "stable" (verified at trunk 2026-11-01). It matches only within the navigating document itself (a fully active document mid-navigation); it is not exposed to other documents, including same-origin iframes, except through their own navigations.
errors and graceful degradation
CSS selectors don’t throw, but an unknown pseudo-class makes the whole selector list invalid in browsers that don’t support it: per Selectors Level 4 §3.9, “a selector list containing an invalid selector is invalid”, and the rule is dropped entirely. Two safe patterns:
/* 1. Keep :navigation-source rules in their own rule,
never comma-joined with selectors you need everywhere: */
a:navigation-source .thumb { view-transition-name: active-image; }
/* 2. Or isolate it inside :where() / :is(), whose forgiving
parsing ignores the unsupported part instead of dropping
the rule (selectors-4 §4.1–4.2): */
a:where(:navigation-source) .thumb { view-transition-name: active-image; }
Because the fallback behavior is simply “the declaration never applies”, progressive enhancement is natural: pages without support lose the transition polish, not the navigation. In supporting browsers, selectors that can start matching mid-navigation restyle the page at an unusual moment — keep the applied declarations cheap (names, outlines, opacity) rather than layout-shifting.
Source: selectors-4 §3.9 (invalid selectors); selectors-4:is()/:where()
examples
The spec’s own two examples, quoted from css-navigation-1 §2.2 (reformatted): a thumbnail that becomes the shared element of a cross-document view transition, and submit feedback on a form.
/* Set the view-transition-name for an image thumbnail that is a
child of the link that triggers the current navigation. */
a:navigation-source .thumb {
view-transition-name: active-image;
}
/* Forms and submit buttons: */
form:navigation-source .submit,
.submit:navigation-source {
outline: 3px solid green;
}
browser compatibility
Per-version data from BCD css/selectors/navigation-source.json (fetched 2026-11-01; the entry is marked experimental: true, standard-track).
| Browser | :navigation-source |
|---|---|
| Chrome | 156 |
| Chrome Android / WebView | 156 (mirrors Chrome; the ChromeStatus record lists Android and WebView at 156 explicitly) |
| Edge | 156 (BCD mirror) |
| Firefox | No support (version_added: false); position requested at mozilla/standards-positions #1447, no signal |
| Safari | No support (version_added: false); position requested at WebKit/standards-positions #715, no signal |
security and privacy
The spec’s own Privacy Considerations and Security Considerations sections are both placeholders (“To be written”, checked 2026-11-01) — the draft is early. What the observable surface itself implies:
- No cross-document exposure — the selector reflects state the document already owns: the source element lives in the navigating document, and the destination document’s reconstructed state carries
source element: null(§4), so nothing about the trigger leaks to the next page via CSS. - Same information as the Navigation API — everything the pseudo-class can style was already script-observable through
NavigateEvent.sourceElement; this adds a declarative spelling, not a new capability. - Pre-reveal navigations are deliberately invisible — state from before the page is revealed does not reflect in CSS, which avoids exposing activation details during prerendering (§4 note).
specifications
| Document | Status |
|---|---|
CSS Navigation Matching Level 1 — §2.2 The :navigation-source pseudo-class | Editor’s Draft (CSSWG; chromestatus maturity: “Working draft”) — fetched 2026-11-01 |
| csswg-drafts #11801 — Add pseudo-class selector to target the element that initiated the outgoing navigation | The originating proposal (Bramus, 2025-02-28); closed as completed 2026-07-01 by PR #14122 |
| Route-matching explainer — link matching (WICG/declarative-partial-updates) | Explainer linked from the ChromeStatus record |
| blink-dev — Intent to Ship: CSS pseudo-class for navigation source element | Posted 2026-09-03; approved with three LGTMs (2026-09-08/09) |
see also
- Chrome Platform Status — CSS pseudo-class for navigation source element (API record)
- MDN —
NavigateEvent.sourceElement— the Navigation API property this selector reflects (MDN has no page for:navigation-sourceitself: 404, checked 2026-11-01) - MDN — View Transition API — the headline consumer, via
view-transition-name - CSS Navigation Matching Level 1 — the wider spec:
@location,@navigation, and thenavigation()function share the same navigation state - Chrome Platform Showcase — interactive demos for this feature