W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2006

[whatwg] href on any element

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Tue, 29 Aug 2006 17:28:57 +1000
Message-ID: <44F3ECB9.9050201@lachy.id.au>
Andrew Fedoniouk wrote:
> Lachlan Hunt wrote:
>> Andrew Fedoniouk wrote:
>>> Ian Hickson wrote:
>>>>   <a href="">
>>>>    <h2>...</h2>
>>>>    <p>...</p>
>>>>   </a>
>>> If we will change model of A from
>>> <!ELEMENT A - - (%inline;)* -(A)       -- anchor -->
>>> to something else then it will create implications for parser.
>> What implications?  Changing the formal content model of an element 
>> doesn't change the way a parser needs to work.  Ian's example above is 
>> very similar to some real world examples I've seen and browser's 
>> already handle it just fine.
> These are non-conformant browsers :)

No, in this case, they're just handling the non-conformant content in 
the most sane way, which I believe (in this case) is correct handling 
according to traditional SGML rules.

See the Parse Tree produced by the validator for that construct
(ignore the 2 expected validation errors):

> A simply cannot have content other than inline constructions.

According to the formal content model, yes, but when a browser 
encounters a real world document has that construct, what do you think 
the browser should do with it?

> What UA should do in this case is not specified. Using this
> is as bad as violation of following:

See section 8 of the Web Apps 1.0 spec.

>> The DOM looks like this:
>> A
>> +-H2
>> + P
> And what is semantical meaning of that? Some hyperlinked section?

The A element is just defined as a hyperlink.  Whether or not it's a 
section is irrelevant.

> If yes then let it be just :
> <section href="...">
>  <h2>...
>  <p>...
> </section>

But that isn't backwards compatible.

Lachlan Hunt
Received on Tuesday, 29 August 2006 00:28:57 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:48 UTC