Skip to content

Commit 6acdb21

Browse files
committedOct 24, 2016
Remove "compatibility caseless" matching
This fixes #1666. As discussed there, browsers are not interoperable about what type of Unicode case-insensitivity they implement here, with WebKit even using case-sensitive matching for the radio button case (but not for the image map case). Data from Blink's use counters reveals however that the Unicode case-insensitivity is never triggered, and even ASCII case-insensitivity is triggered extraordinarily rarely. Additionally, the semantics of these attributes is more like an identifier than anything else, and so case-insensitive comparison never really made sense in the first place (it was only done for legacy Internet Explorer compatibility). As such, we move to converge on case-sensitive matching in all cases.
1 parent 2b93f9e commit 6acdb21

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed
 

Diff for: ‎source

+8-19
Original file line numberDiff line numberDiff line change
@@ -4193,10 +4193,6 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
41934193
in the range U+0061 to U+007A (i.e. LATIN SMALL LETTER A to LATIN SMALL LETTER Z) are considered
41944194
to also match.</p>
41954195

4196-
<p>Comparing two strings in a <dfn>compatibility caseless</dfn> manner means using the Unicode
4197-
<i>compatibility caseless match</i> operation to compare the two strings, with no
4198-
language-specific tailorings. <ref spec=UNICODE></p>
4199-
42004196
<p>Except where otherwise stated, string comparisons must be performed in a
42014197
<span>case-sensitive</span> manner.</p>
42024198

@@ -6702,9 +6698,8 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
67026698

67036699
<li>
67046700
<p>Return the first element of type <var>type</var> in <var>scope</var>'s <span>tree</span>, in
6705-
<span>tree order</span>, that has an <code data-x="attr-id">id</code> attribute whose value is
6706-
a <span>case-sensitive</span> match for <var>s</var> or a <code data-x="">name</code> attribute
6707-
whose value is a <span>compatibility caseless</span> match for <var>s</var>.</p>
6701+
<span>tree order</span>, that has an <code data-x="attr-id">id</code> or <code
6702+
data-x="">name</code> attribute whose value is <var>s</var>.</p>
67086703

67096704
<p class="note">Although <code data-x="attr-id">id</code> attributes are accounted for when
67106705
parsing, they are not used in determining whether a value is a <span><em>valid</em> hash-name
@@ -6713,14 +6708,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
67136708
data-x="">name</code> attribute with the same value).</p>
67146709
</li>
67156710

6716-
<!--
6717-
IE is also doing case-insensitive id="" matching.
6718-
Tests:
6719-
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cmap%20name%3D%22T%26eacute%3B%26%23x01F1%3B%26%23x2075%3B%22%3E%3Carea%20href%3D%22%2F%22%20shape%3Drect%20coords%3D0%2C0%2C200%2C200%3E%3C%2Fmap%3E%0A%3Cimg%20usemap%3D%22%23t%26Eacute%3BDZ5%22%20src%3Dimage%3E
6720-
...except that doesn't explain why this fails:
6721-
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cmap%20name%3D%22T%26eacute%3B%26%23x01F1%3B%26%23x2075%3B%26%23xFB01%3B%22%3E%3Carea%20href%3D%22%2F%22%20shape%3Drect%20coords%3D0%2C0%2C200%2C200%3E%3C%2Fmap%3E%0A%3Cimg%20usemap%3D%22%23t%26Eacute%3BDZ5F%26%23x0131%3B%26%23x0307%3B%22%20src%3Dimage%3E
6722-
maybe they just don't know about combining dot above?
6723-
-->
6711+
<!-- History behind case-sensitive matching above: https://github.com/whatwg/html/issues/1666 -->
67246712

67256713
</ol>
67266714

@@ -37130,8 +37118,7 @@ interface <dfn>HTMLMapElement</dfn> : <span>HTMLElement</span> {
3713037118
<p>The <dfn><code data-x="attr-map-name">name</code></dfn> attribute gives the map a name so that
3713137119
it can be referenced. The attribute must be present and must have a non-empty value with no <span
3713237120
data-x="space character">space characters</span>. The value of the <code
37133-
data-x="attr-map-name">name</code> attribute must not be a <span data-x="compatibility
37134-
caseless">compatibility-caseless</span> match for the value of the <code
37121+
data-x="attr-map-name">name</code> attribute must not be equal to the value of the <code
3713537122
data-x="attr-map-name">name</code> attribute of another <code>map</code> element in the same
3713637123
<span>tree</span>. If the <code data-x="attr-id">id</code> attribute is also specified, both
3713737124
attributes must have the same value.</p>
@@ -45878,10 +45865,12 @@ ldh-str = &lt; as defined in <a href="https://tools.ietf.org/html/rfc1034#
4587845865
<li>Both <var>a</var> and <var>b</var> are in the same <span>tree</span>.</li>
4587945866

4588045867
<li>They both have a <code data-x="attr-fe-name">name</code> attribute, their <code
45881-
data-x="attr-fe-name">name</code> attributes are not empty, and the value of <var>a</var>'s <code data-x="attr-fe-name">name</code> attribute is a <span>compatibility
45882-
caseless</span> match for the value of <var>b</var>'s <code
45868+
data-x="attr-fe-name">name</code> attributes are not empty, and the value of <var>a</var>'s <code
45869+
data-x="attr-fe-name">name</code> attribute equals the value of <var>b</var>'s <code
4588345870
data-x="attr-fe-name">name</code> attribute.</li>
4588445871

45872+
<!-- Historical details of case-sensitivity: https://github.com/whatwg/html/issues/1666 -->
45873+
4588545874
</ul>
4588645875

4588745876
<p>A <span>tree</span> must not contain an <code>input</code> element whose <i data-x="radio

0 commit comments

Comments
 (0)
Please sign in to comment.