W3C home > Mailing lists > Public > public-html@w3.org > February 2009

Re: fragid navigation and pct-encoded

From: Michael A. Puls II <shadow2531@gmail.com>
Date: Wed, 18 Feb 2009 02:39:48 -0500
To: "Ian Hickson" <ian@hixie.ch>
Cc: "Boris Zbarsky" <bzbarsky@mit.edu>, "HTML WG" <public-html@w3.org>
Message-ID: <op.upjd8myc1ejg13@sandra-svwliu01>
On Wed, 18 Feb 2009 01:51:46 -0500, Ian Hickson <ian@hixie.ch> wrote:

> On Wed, 18 Feb 2009, Michael A. Puls II wrote:
>> On Wed, 18 Feb 2009 00:30:25 -0500, Ian Hickson <ian@hixie.ch> wrote:
>>
>> > Given:
>> >   <a href="#a a">...</a>
>>
>> FWIW, here's how I expect it to work (whether it does or not) and makes
>> the most sense to me:
>>
>> <a href="#a a">...</a> gets normalized to <a href="#a%20a">...</a>
>> (author should have used "#a%20a" in the first place and not have left
>> the space unencoded). This makes the fragid uri component "a%20a". Then,
>> to get a string from that, "a%20a" needs to be percent-decoded to "a a".
>> Then, it should match name="a a" or id="a a".
>>
>> If you want to match name="a%20a" or id="a%20a", you'd need <a
>> href="#a%2520a">...</a>.
>>
>> I think of it the same way as if a fragid hvalue in a query string were
>> to match @name and @id. For example, href="?fragid=a a" would be
>> normalized to href="fragid=a%20a". Then, if you wanted to get the fragid
>> value that the percent-encoded fragid hvalue represents, you'd have to
>> percent-decode "a%20a" to "a a" first and then look for a match.
>
> I agree with you in principle, but in practice we are required by legacy
> content to have a mechanism which will have this:
>
>    <a href="#%3F">...</a>
>
> ...match:
>
>    <a name="%3F"></a>
>
> The question is how to achieve this while staying as close as possible to
> existing specifications and sanity.

So, you're saying it needs to be something like:

@id matches with the percent-decoded (according to document encoding) value that the percent-encoded fragid URI component represents.

and 

@name on HTMLAnchorElement matches with the literal, non-normalized, as the author specified, fragid URI component substring.

?

If so, implementing that in JS for clicking links (need something for address field too) seems like you'd have to use .href and parse for the fragid hvalue and decode for @id matching and getAttribute("href") and parse for the fragid for @name matching. (assuming getAttribute("href") in the browser returns the href as authored)

-- 
Michael
Received on Wednesday, 18 February 2009 07:40:23 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:01 UTC