CKTIS / HTML
HTML concept: navigation
HTML navigation covers URL resolution, hyperlink activation, target navigable selection, opener/referrer policy, and updates to documents and session history.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
hyperlink activation → URL resolution → navigable/history updateAn href value is parsed relative to base, not concatenated as ordinary text. The target attribute chooses a named context or keyword such as _self or _blank; a name can reuse an existing context, and a blocked or inactive document might not navigate.
rel="noopener" disconnects a new context from its opener, and _blank implies noopener unless explicit rel="opener" restores the relationship. referrerpolicy controls referrer information but does not replace request rules or destination policy.
history.pushState() and history.replaceState() change an entry without fetching a document; their url argument is optional and may be null, and the same-origin constraint applies only to a supplied url that is not null. History traversal is asynchronous and can fire popstate. The download attribute is a limited-scope hint, while popups and some actions require real user activation.
The example activates the fragment link #chapter, waits for hashchange, and confirms its target. Calling click() runs default hyperlink following and produces an untrusted event; the test does not infer the surrounding environment’s activation state.
Examples
<!doctype html>
<meta charset="utf-8">
<a id="jump" href="#chapter">Jump</a>
<h2 id="chapter">Chapter</h2>
<output id="result"></output>
<script>
const jump = document.querySelector("#jump");
let clickTrusted = null;
jump.addEventListener("click", event => { clickTrusted = event.isTrusted; });
addEventListener("hashchange", () => {
const target = document.getElementById(location.hash.slice(1));
result.textContent = `hash=${location.hash}; target=${target.textContent}; clickTrusted=${clickTrusted}`;
}, { once: true });
jump.click();
</script>
Result
hash=#chapter; target=Chapter; clickTrusted=false
The executed example verifies same-document navigation and an untrusted programmatic click; it does not test an activation-gated action, open a new context, fetch a resource, or traverse backward.