From 1187770f9963b4ad02b9a46cbc52288709f64e2d Mon Sep 17 00:00:00 2001 From: Anders Hartvoll Ruud Date: Fri, 3 Jan 2025 09:35:34 -0800 Subject: [PATCH] [attr] Look up attribute by local-name and null-namespace When the namespace part of the is omitted, it defaults to the null-namespace. We currently implement this with Element:: getAttribute, which gives the wrong result, since it returns the first attribute with the given qualified name [1]. Note: the lookup is now effectively the same as what "old" (non-substitution) attr() did. Note: while Element::getAttribute lower-cases the attribute name (for HTML documents), Element::getAttributeNS does not [2]. [1] https://dom.spec.whatwg.org/#concept-element-attributes-get-by-name [2] https://dom.spec.whatwg.org/#concept-element-attributes-get-by-namespace Issue: 387281256 Change-Id: If42dbe210402b95f03c3d7419c161970b6c3f612 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6140914 Reviewed-by: Rune Lillesveen Commit-Queue: Anders Hartvoll Ruud Cr-Commit-Position: refs/heads/main@{#1401853} --- css/css-values/attr-null-namespace.xhtml | 76 ++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 css/css-values/attr-null-namespace.xhtml diff --git a/css/css-values/attr-null-namespace.xhtml b/css/css-values/attr-null-namespace.xhtml new file mode 100644 index 00000000000000..a9bf9b0adddcb8 --- /dev/null +++ b/css/css-values/attr-null-namespace.xhtml @@ -0,0 +1,76 @@ + + + + CSS Values: attr() substitution with implicit null namespace + + + + + +
+ Test +
+ + + +