Skip to content

Commit

Permalink
Remove "compatibility caseless" matching
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
domenic committed Oct 24, 2016
1 parent 2b93f9e commit 6acdb21
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -4193,10 +4193,6 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
in the range U+0061 to U+007A (i.e. LATIN SMALL LETTER A to LATIN SMALL LETTER Z) are considered
to also match.</p>

<p>Comparing two strings in a <dfn>compatibility caseless</dfn> manner means using the Unicode
<i>compatibility caseless match</i> operation to compare the two strings, with no
language-specific tailorings. <ref spec=UNICODE></p>

<p>Except where otherwise stated, string comparisons must be performed in a
<span>case-sensitive</span> manner.</p>

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

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

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

<!--
IE is also doing case-insensitive id="" matching.
Tests:
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
...except that doesn't explain why this fails:
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
maybe they just don't know about combining dot above?
-->
<!-- History behind case-sensitive matching above: https://github.com/whatwg/html/issues/1666 -->

</ol>

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

<li>They both have a <code data-x="attr-fe-name">name</code> attribute, their <code
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
caseless</span> match for the value of <var>b</var>'s <code
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 equals the value of <var>b</var>'s <code
data-x="attr-fe-name">name</code> attribute.</li>

<!-- Historical details of case-sensitivity: https://github.com/whatwg/html/issues/1666 -->

</ul>

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

0 comments on commit 6acdb21

Please sign in to comment.