W3C home > Mailing lists > Public > public-appformats@w3.org > August 2006

Re: [XBL2] Problems with 3.3: Loading Style Sheets

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 17 Aug 2006 23:47:20 +0000 (UTC)
To: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Cc: public-appformats@w3.org
Message-ID: <Pine.LNX.4.62.0608172328040.25313@dhalsim.dreamhost.com>

On Thu, 17 Aug 2006, Lachlan Hunt wrote:
> 
> 1. It is unclear whether or not a style element with a src attribute, in 
> a binding document declaring a non-XML stylesheet, but which also 
> contains child elements is in error.
> 
> In the paragraph beginning with (emphasis added):
> 
>   "For non-XML styling languages, *if the content is inline*, ..."
> 
> the final sentence states that:
> 
>   "A style element labelled as containing a style sheet in a non-XML
>    language yet containing element nodes is in error."
> 
> This seems to suggest that that statement only applies to style elements 
> containing inline styles, not those referencing external stylesheets. 
> Although, I don't believe that is the intention.

Yeah, that wasn't clear. Fixed by explicitly giving the content model for 
the "with src attribute" case separately in the element definition.

Also fixed for <script> and <implementation>.


> 2. The spec fails to explicitly describe how a style element that is in 
> error is to be treated for both inline and external style sheets.

If a style _element_ is in error, it is ignored. However, having bad 
children doesn't make it in error, it makes its children in error.


> I would expect that it is to be ignored, such that the styles would not 
> be applied to anything.  However, if that were the case, the example 
> given in this section would be erroneous because it contains html:script 
> and html:p elements, and thus the style sheet would not be applied at 
> all.

No, in this case the <style> element isn't in error (though its children 
are).


> 3. For a style element that is in error and which is referencing an 
> external stylesheet, should the external stylesheet still be fetched? 

If the style element is actually in error, then no, because it is ignored 
(see section 2). But the examples given here haven't had their style 
element be in error.


> 4. The spec states:
>    "If the content was in another file, and that file's Content-Type
>     [...] was of the type *specified* on the xbl element, [...]"
> 
> If the the style-type attribute was not explicitly specified on the xbl 
> element, thus using the default value of text/css, and the external 
> stylesheet is delivered with a different Content-Type, does that 
> statement still apply?

Added "(or implied by its absence) in appropriate places.


> 5. The spec fails to state what should be done when the Content-Type is 
> different from that specifed by the style-type attribute.  I assume it 
> should say "Otherwise, the style must be ignored.", as it does for the 
> equivalent section in loading scripts.

Added.


> 6. The final sentence of this section states:
>    "The src attribute must only be examined once all of the element's
>     children have been processed (if any)."
> 
> I think this needs further explanation or an example to explain why this 
> is the case.  After a little thought, the only reason I could think of 
> is in case the src attribute were modified by a script inside it.
> 
> e.g.
>   <style src="example.css" id="test">
>     <script xmlns="http://www.w3.org/1999/xhtml">
>       document.getElementById("test").setAttribute("src", "other.css");
>     </script>
>   </style>
> 
> In this case, since the src attribute won't be examined until after the 
> script has been executed, "other.css" will be fetched instead of 
> "example.css".

It's a requirement there just to define the timing. It's not supposed to 
be used by authors and therefore I don't really want to give an example 
(every time we include an example that is invalid, an author will go ahead 
and kill a kitten).

Cheers,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 17 August 2006 23:47:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:10:20 GMT