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

[XBL2] Problems with 3.3: Loading Style Sheets

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Thu, 17 Aug 2006 03:04:13 +1000
Message-ID: <44E3500D.5070803@lachy.id.au>
To: public-appformats@w3.org

   The following comments apply to section 3.3 Loading Style Sheets [1].

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.

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.  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.

3. For a style element that is in error and which is referencing an 
external stylesheet, should the external stylesheet still be fetched? 
This would depend upon the answer to the previous question, since if its 
styles weren't going to apply to anything, there would be no point in 
fetching it.

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?

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.

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.

   <style src="example.css" id="test">
     <script xmlns="http://www.w3.org/1999/xhtml">
       document.getElementById("test").setAttribute("src", "other.css");

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 


Lachlan Hunt
Received on Wednesday, 16 August 2006 17:04:36 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:50:05 UTC