Skip to content
Permalink
Browse files

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.
  • Loading branch information...
domenic committed Oct 20, 2016
1 parent 2b93f9e commit 6acdb2122298d2bb7bb839c0a61b4e1f9b0f9bc9
Showing with 8 additions and 19 deletions.
  1. +8 −19 source
27 source
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>


<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
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>

<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>
<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

0 comments on commit 6acdb21

Please sign in to comment.
You can’t perform that action at this time.