Re: HTML ID case question

11.07.01 17:22:06, Terje Bless <link@tss.no> wrote:

>This strikes me as pure sillyness; a convoluted mess of interacting rules
>from different parts of the prose that result in a completely illogical set
>of legal combinations. Valid HTML that is labelled Invalid by the Validator
>is a Very Very Bad Thing.

I remember this from my time as an author when I considered this a 
lose/lose. I had to take care of case sensitivity for my links, but I 
couldn't make mnemonic two-way links, e.g.

   Main text, here comes a footnote [<a name="foot1" href="#FOOT1">1</a>].
   ----
   [<a name="FOOT1" href="#foot1">1</a>] Footnote 1: ...



If I recall correctly, the reason for the fudge was that IE was case 
insensitive and NN was case sensitive. That was several years ago, so I made 
an impromptu test for the current state of three browsers (below). Test 
results:

Test 1 (duplicate ids): Opera chooses the last id of the bunch, Moz and IE 
the first. It is undefined, so both options are reasonable, as is not 
chosing any at all.

Test 2 (idref case error): Neither Opera nor Moz choose id="three" when 
href="#THREE", IE does and that is wrong (in HTML 4.01 too).

Test 3: All do the same (if for different reasons in the case of IE).

Test 4: Opera and Moz go to id="ONE" with href="#ONE", IE goes to id="one".

I haven't checked whether IE6 in "standards compliant mode" does any better.


Jonny Axelsson
Documentation,
Opera software

----------------------

<html>
<head>
<title>The current id case case</title>
<style type="text/css">
div {
	height: 300px; 
	background: #efe; 
	padding: 1em;
	margin: 1em;
	border: 2px solid #060; 
	font: 12px/16px sans-serif;
}
code{
	display: block;
	font: 20px/40px bold monospace;
}
td, th {
	background: #fff;
}
</style>
</head>

<body>
<h1>Case sensitivity and id, tests</h1>
<div>This tests current case-sensitivity on different browsers. This table 
lists 
  result for the link targets for three browsers (href &lt;target&gt;). 
<table>
  <tr> 
    <th>Test</th>
    <th>Opera 5.12</th>
    <th>Mozilla 0.9.2</th>
    <th>IE 5.5</th>
  </tr>
  <tr> 
    <th>Test 1</th>
    <td>Second "two"</td>
    <td>First "two"</td>
    <td>First "two"</td>
  </tr>
  <tr> 
    <th>Test 2</th>
    <td>nowhere</td>
    <td>nowhere</td>
    <td>"three"</td>
  </tr>
  <tr> 
    <th>Test 3</th>
    <td>"one"</td>
    <td>"one"</td>
    <td>"one"</td>
  </tr>
  <tr> 
    <th>Test 4</th>
    <td>"ONE"</td>
    <td>"ONE"</td>
    <td>"one"</td>
  </tr>
</table>
</div>
<div id="one"><p><code>TEST 1: id="one" (href <a href="#two">two</a>)</code> 
This id 
  differ from the next by case. Link to duplicate.</p></div>

<div id="ONE"><p><code>TEST 2: id="ONE" (href <a 
href="#THREE">THREE</a>)</code>This id differ from the previous by case. 
Broken link to id, but same case intransitively.</p></div>
<div id="two"><p><code>TEST 3: id="two" (href <a 
href="#one">one</a>)</code>This and the next id identical.</p></div>
<div id="two"><p><code>TEST 4: id="two" (href <a 
href="#ONE">ONE</a>)</code></p></div>
<div id="three"><p><code>id="three"</code></p></div>
<div id="four"><p><code>id="four"</code></p></div>
</body>
</html>

Received on Wednesday, 11 July 2001 12:35:44 UTC