Re: coping with overlapping elements in the DOM

On Tue, 5 Aug 1997, Lauren Wood wrote:

I think that page authors need to learn to write good HTML.  Back when
netscape released version 2.0 which had much more strict parsing of HTML
thousands of pages broke, and many "Tricks" ceased to work.  But after the
release most people's HTML got better.  Which is a good thing.

I think that if there are errors in your HTML you should clean them up
before trying to manipulate them with the DOM.  Most pages that will be
relying on using dom will probably be new, or will be older pages that
will be re-produced, or fixed to ensure compatibility. HTML mistakes can
be fixed there.

> One of these classes of mistakes is overlapping elements, 
> of the form
> <P><B>This is <EM> not </B> a good idea</EM></P>
> 
> We are thinking of defining nodes that would effectively change
> the above example into
> <P><B>This is <EM> not </EM></B><EM> a good idea</EM></P>

This fix would be bad as it separates the percieved structure from the
"physical" strucutre of the HTML file.  This would add extra elements into
the strucutre and would cause strange workarounds.  Better to know that
your HTML is broke so you can fix it, rather than having to place all
kinds of workarounds in your scripting because this particular page "acts
all wierd".

> Since we don't really want to encourage people to write broken 
> documents, there is also the problem of whether we should do 
> anything for overlapping elements at all. The choices are:
> 1) don't do anything for overlapping elements
> 2) do something and deprecate it immediately, so it will be in level 
> one but not level two
> 3) put it in without deprecating.

I'd be in favor of number 1.  Or maybe even return an error status to the
UA.

---------------------------------------------------------------------------
---     "How long have you been wanting me to talking like a bot?"      ---
---------------------------------------------------------------------------
                                                          taylor@taylor.org

Received on Tuesday, 5 August 1997 19:30:14 UTC