Re: [css3-mediaqueries] Width/Height Clarifications

Tab Atkins Jr. wrote:
>
>
> On Mon, Jun 9, 2008 at 2:40 PM, Andrew Fedoniouk 
> <news@terrainformatica.com <mailto:news@terrainformatica.com>> wrote:
>
>     Consider following css resource:
>     --- a.css ---
>       @media screen
>       {
>           a { color:green; }
>       }   --- end of a.css ---
>
>     And following markup:
>
>     <html>
>      <style>
>       @import url(a.css) print;
>      </style>
>      <body> <a href="#">test</a> </body>
>     </html>
>
>     that is loaded in UA on media screen.
>
>     What color that <a> should have?
>     If you say that you load and parse everything disregarding of
>     media type
>     then <a> should have  a { color:green; } applied.
>     Neither Mozilla nor Opera do that as far as I can tell.
>
>
> Load and parse, certainly, but not necessarily apply.  If that was the 
> case, media queries would be entirely useless, as you must have noted 
> when constructing your example.
> The a.css file gets loaded on page load, but its contents are only 
> applied when you try to print.  So, the <a> isn't green on the screen, 
> nor is it green in the printout (since at that point it's wrapped in a 
> screen query, and thus won't apply).
>
That is far from what specification says:

"Style sheets are only imported if the media query on the |'@import' 
<http://www.w3.org/TR/css3-cascade/#import>| (if any) matches the media 
for which the UA renders the document.
If an |'@import' <http://www.w3.org/TR/css3-cascade/#import>| is 
skipped, then all |'@import' 
<http://www.w3.org/TR/css3-cascade/#import>|s inside the style sheet it 
points to are also skipped, no matter what their names."

Source: http://www.w3.org/TR/css3-cascade/#at-import

All wordings in CSS2.1. and CSS3 implies that @import is handled at 
parse time only - so no dynamic adjustments are required.
That is why I am asking: are we changing paradigm or not?

--
Andrew Fedoniouk.

http://terrainformatica.com

Received on Monday, 9 June 2008 22:36:37 UTC