[whatwg] Re: Rendering Unknown Elements and IE Support

Lachlan Hunt wrote:
> Matthew Raymond wrote:
>> <concurrent style="display: none" />
>> <exclusive style="display: none" />
>> ...
> 
>   No, they don't.  The contents of an unknown element still render's on 
> screen, so it doesn't get the style of display: none;.
> 
> eg.
>   <p>a paragraph <unknown>containing unknown</unknown> elements</p>
> 
> would render as:
> 
>    a paragraph containing unknown elements
> 
> which is the same as
> 
>   <p>a paragraph <span>containing unknown</span> elements</p>
> 
> but not the same as
> 
>   <p>a paragraph <span style="display: none;">containing unknown</span>
>      elements</p>

    You misinterpreted my example. Internet Explorer treats this...

<p>a paragraph <unknown>containing unknown</unknown> elements</p>

    ...like this...

<p>a paragraph
<unknown1 style="display: none;" />
containing unknown
<unknown2 style="display: none;" />
elements</p>

    In IE, NO UNKNOWN ELEMENT HAS CHILDREN, NO UNKNOWN ELEMENT HAS A 
CLOSING TAG, and NO UNKNOWN ELEMENT CAN BE STYLED OR DISPLAYED. Although 
they can exist in the DOM as stand-alone elements, they effectively 
don't exist unless you use Javascript to replace them with known 
elements and restore the parent/child relationships.

    Wait! Actually, there's a way to get IE to properly process unknown 
elements. I found it in a Dean Edwards demo page as I was writing this. 
It will even allow you to style the element. Here's how it works:

1) Declare the HTML namespace:

<html xmlns:html="http://www.w3.org/1999/xhtml">

2) Put "html:" in front of the element name:

<html:concurrent>
   <html:exclusive>
     ...
   </html:exclusive>
   <html:exclusive>
     ...
   </html:exclusive>
</html:concurrent>

3) For styling, do this in CSS:

    html\:concurrent, concurrent { ... }
    html\:exclusive, exclusive { ... }

    And that's it. I'll bet even IE's "behavior" property will work on 
them. In that case, new elements can degrade gracefully in IE when using 
the above format.  In light of this, I'm no longer considering features 
that cannot be used in a way that degrades gracefully in IE. I wasn't 
thrilled about the idea anyway.

Received on Sunday, 4 July 2004 08:04:54 UTC