v150 · HTML · Anchor Matching Demo
Anchor Matching Demo
Test fragment navigation against named anchors with different case. The left side is this standards-mode page; the right side is a real no-doctype iframe in quirks mode. Chrome 150+ should use exact-case matching in both.
Detecting browser support...
test fragment navigation
<a name="lowercase-section">
name="lowercase-section"<a name="CamelCase-section">
name="CamelCase-section"<a name="UPPERCASE-SECTION">
name="UPPERCASE-SECTION"
Standards document target
Waiting for fragment...
Quirks iframe target
Waiting for iframe...
standards mode
document.compatMode: -
doctype: <!doctype html>
matching rule: exact-case fragment lookup
quirks mode
iframe.contentDocument.compatMode: loading...
doctype: none
Chrome 150+ rule: exact-case fragment lookup
live result matrix
| Fragment | Chrome 150+ expected | Standards actual | Quirks actual |
|---|
what is being tested
// The quirks fixture is written without a doctype.
iframe.contentDocument.open();
iframe.contentDocument.write("<html>...<a name='CamelCase-section'>...");
iframe.contentDocument.close();
iframe.contentWindow.location.hash = "camelcase-section";
const target = iframe.contentDocument.querySelector(":target");
// Chrome 150+: no target, because the case does not match.
// Pre-150 Chrome quirks mode can still target name="CamelCase-section".