[Bug 24756] [imports]: Cascading order for stylesheets of imported documents should be stated more clearly

https://www.w3.org/Bugs/Public/show_bug.cgi?id=24756

--- Comment #13 from Morrita Hajime <morrita@google.com> ---
(In reply to Gabor Krizsanits from comment #12)
> (In reply to Morrita Hajime from comment #7)
> > (In reply to Gabor Krizsanits from comment #3)
> > Well, right. This is another story how de-dup complicates things and
> > I don't have good answer for this either :-(
> > Actually same things can be said for <script>.
> > So I don't think this is style specific problem.
> 
> Could you elaborate on this? I don't see what you mean here...
> 

If you have: (Think all <link>s are imports)

- index.html
  <link href=a.html>
  <link href=b.html>

- a.html
  <link id=ac href=c.html>
  <link id=ad href=d.html>

- b.html
  <link id=bd href=d.html>
  <link id=bc href=c.html>

- c.html
  <script id=cs>...</script>

- d.html
  <script id=ds>...</script>

Even b.html expect script ds to run before cs, it doesn't because a.html
let c.html be imported before d.html. This sample might appear irrelevant
but the point is that different import can disagree the order of its dependency
and that can be problem for both script and stylesheets.
Having such disagreements is undesirable and developers should avoid that,
but that could happen. Does this make sense?

> > 
> > Just a random idea: UAs could emit some warning if an import has a
> > stylesheet link
> > that is de-duped in some unexpected way.
> 
> Hmm... this might be a good idea actually, regardless of what we do about
> style-sheets! But does not seem to fix all the variation of the problem:
> 
> <link href=style.css>
> <link href=a.html>
> 
> Who comes first? We don't know for sure... Same for inline styles or
> scripts. But yeah this is indeed a generic problem for de-duping. (And maybe
> that's what you were referring to...) Would it be a stupid idea to
> introduce/define an extended version of CompareDocumentPosition and use that
> to answer all these questions?

Yeah, that's exactly what I meant in the spec - It'd be ideal to have
cross-import 
document order comparison between nodes, and use it to define style ordering.
I tried to do that in less annoying way, avoiding copy-and-patch the "document
order" definition[1]
but apparently I haven't done good job there :-/

Probably we should have that extended ordering after all. Let me try to write
it down.


[1] http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 6 August 2014 22:05:33 UTC