Re: [Imports]: Styleshet cascading order clarification

----- Original Message -----
> From: "Tab Atkins Jr." <jackalmage@gmail.com>
> To: "Gabor Krizsanits" <gkrizsanits@mozilla.com>
> Cc: "Hajime Morrita" <morrita@google.com>, "public-webapps" <public-webapps@w3.org>
> Sent: Monday, November 3, 2014 7:12:27 PM
> Subject: Re: [Imports]: Styleshet cascading order clarification
> 
> On Mon, Nov 3, 2014 at 7:28 AM, Gabor  Krizsanits
> <gkrizsanits@mozilla.com> wrote:
> > During our last meeting we all seemed to agree on that
> > defining/implementing
> > order for style-sheets is imports is super hard (if possible) and will
> > bring more
> > pain than it's worth for the web (aka. let's not make an already
> > over-complicated
> > system twice as complicated for very little benefits). And the consensus
> > was that we
> > should just not allow global styles in imports.
> >
> > Some months has passed but I still don't see any update on the spec. in
> > this regard,
> > so I'm just double checking that we still planning to do this or if
> > anything changed
> > since then.
> 
> Out of curiosity, why is it hard?  Without much background in the
> implementation matters, it doesn't seem that a <link rel=import> that
> contains a <link rel=stylesheet> should be any different than a <link
> rel=stylesheet> that contains an @import rule.
> 
> ~TJ
> 

See my comments here: https://www.w3.org/Bugs/Public/show_bug.cgi?id=24756

I think the difference is the de-duping mechanism in HTML imports. Importing
the same import from multiple places in the import graph can change the import
order hence the underlying style-sheet order too. So just because link import A
is before link import B in the document does not necessary say anything about
the order of their stylesheet... 

My concern is that in complex projects it will be even harder to track down
css related issues, given that adding an extra link to the import tree can
significantly change the order of the imports. 

The other concern is performance related. We will have to rearrange the rules
all the time the import graph changes during the import parsing. But one could
argue that it's just an implementation detail...

Then again, maybe all these issues can be outweighed by some important use cases... 

 - Gabor

Received on Tuesday, 4 November 2014 18:37:51 UTC