Re: The SCRIPT element

On Wed, 16 Jul 2008 18:19:27 +0200, Brad Kemper <brkemper@comcast.net>  
wrote:
>> That sounds correct for HTML, since <script> is not parsed like any  
>> other element.
>
> That seems to contradict your earlier statement:

Why? HTML parsing is completely orthogonal to CSS layout.


> On Jul 16, 2008, at 8:28 AM, Anne van Kesteren wrote:
>> It's not really special in any particular way when it comes to CSS  
>> layout.
>
> If what you say is true about it being like any other element, then if  
> the script tag is set to display:block, shouldn't the comment part be  
> hidden, while still allowing borders and padding and such on the script  
> element?

No, the comment is part of the contents. As if you typed

   <span>&lt;!-- --></span>

or some such. (Check the DOM, you'll see that in the <script><!--  
--></script> case the <!-- --> part is actually a Text node, not a Comment  
node. (This is of course vastly different in XML.))


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>

Received on Wednesday, 16 July 2008 16:29:28 UTC