Skip to content

Commit

Permalink
Selectors: attr name in any NS on HTML elements are case-insensitive.
Browse files Browse the repository at this point in the history
On elements in the HTML namespace in HTML documents,
selector matching of attribute names is ASCII-case insensitive
regardless of the attribute’s namespace.

This is a change proposed in whatwg/html#2694.
In the HTML spec before that change, this case-insensitivity only
applies to namespace-less attributes.

(Note that the HTML parser never crates namespaced attributes
on HTML elements, so using the DOM’s `setAttributeNS` is necessary
to create a situation where this change is observable.)

This change matches Firefox 53 and Chromium 58:
the number of passing/failing sub-tests didn’t change.
  • Loading branch information
SimonSapin authored and zcorpan committed Jun 5, 2017
1 parent 4839a0a commit f2a30cc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dom/nodes/ParentNode-querySelector-All-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<div class="attr-presence-div2" id="attr-presence-div2" align=""></div>
<div class="attr-presence-div3" id="attr-presence-div3" valign="center"></div>
<div class="attr-presence-div4" id="attr-presence-div4" alignv="center"></div>
<p id="attr-presence-p1"><a id="attr-presence-a1" tItLe=""></a><span id="attr-presence-span1" TITLE="attr-presence-span1"></span></p>
<p id="attr-presence-p1"><a id="attr-presence-a1" tItLe=""></a><span id="attr-presence-span1" TITLE="attr-presence-span1"></span><i id="attr-presence-i1"></i></p>
<pre id="attr-presence-pre1" data-attr-presence="pre1"></pre>
<blockquote id="attr-presence-blockquote1" data-attr-presence="blockquote1"></blockquote>
<ul id="attr-presence-ul1" data-中文=""></ul>
Expand Down
2 changes: 1 addition & 1 deletion dom/nodes/ParentNode-querySelector-All-content.xht
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="attr-presence-div2" id="attr-presence-div2" align=""></div>
<div class="attr-presence-div3" id="attr-presence-div3" valign="center"></div>
<div class="attr-presence-div4" id="attr-presence-div4" alignv="center"></div>
<p id="attr-presence-p1"><a id="attr-presence-a1" tItLe=""></a><span id="attr-presence-span1" TITLE="attr-presence-span1"></span></p>
<p id="attr-presence-p1"><a id="attr-presence-a1" tItLe=""></a><span id="attr-presence-span1" TITLE="attr-presence-span1"></span><i id="attr-presence-i1"></i></p>
<pre id="attr-presence-pre1" data-attr-presence="pre1"></pre>
<blockquote id="attr-presence-blockquote1" data-attr-presence="blockquote1"></blockquote>
<ul id="attr-presence-ul1" data-中文=""></ul>
Expand Down
3 changes: 3 additions & 0 deletions dom/nodes/ParentNode-querySelector-All.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ function setupSpecialElements(doc, parent) {

parent.appendChild(anyNS);
parent.appendChild(noNS);

var span = doc.getElementById("attr-presence-i1");
span.setAttributeNS("http://www.example.org/ns", "title", "");
}

/*
Expand Down
20 changes: 10 additions & 10 deletions dom/nodes/selectors.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f2a30cc

Please sign in to comment.