W3C home > Mailing lists > Public > public-html@w3.org > June 2008

Re: Fragment Identifiers for HTML5

From: Michael A. Puls II <shadow2531@gmail.com>
Date: Sat, 21 Jun 2008 11:21:23 -0400
Message-ID: <6b9c91b20806210821p11dfc2c1n53874e5607c5e728@mail.gmail.com>
To: "Julian Reschke" <julian.reschke@gmx.de>
Cc: "public-html@w3.org" <public-html@w3.org>

Ah, that reminds me. I was also wondering if this fragid situation is
covered anywhere in HTML5:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style>
            div {
                position: absolute;
                top: 1000px;
            }
        </style>
        <script>
            //window.onload = function() {
                //alert(document.links[0].href);
                //alert(document.links[1].href);
            //};
        </script>
    </head>
    <body>
        <div id="&#8730; next">bottom</div>
        <p><a href="#%E2%88%9A%20next">Go to bottom</a></p>
        <p><a href="#&#8730; next">Go to the bottom 2</a></p>
    </body>
</html>

In both FF and Safari, clicking both the Go to bottom and Go to bottom
2 links take you to the bottom div.  In Opera and IE neither one
works.

What's the correct behavior here?

I expect both ways to work like in FF and Safari and definitely expect
everything after # in .href to be percent-decoded before trying to
find a match. But, Opera and IE don't seem to do that.

I can't remember where at the moment, but I've seen at least a few
sites use <a href="#with%20spaces" and expect it to match "with
spaces", and it does it FF and Safari, but breaks elsewhere.

-- 
Michael
Received on Saturday, 21 June 2008 15:21:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:18 GMT