This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24616 - [imports]: Stylesheets in imported documents should be loaded
Summary: [imports]: Stylesheets in imported documents should be loaded
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 20683 23170
  Show dependency treegraph
 
Reported: 2014-02-11 01:33 UTC by Morrita Hajime
Modified: 2014-02-20 22:54 UTC (History)
4 users (show)

See Also:


Attachments

Description Morrita Hajime 2014-02-11 01:33:27 UTC
This is a spin-off from Bug 23170.
Sharing defaultView could have big implication and may need better framework
on HTML side so that such a conceptulization can fit in the picture.

For the first cut, it might be better to cover which should be loaded
for imports feature-by-feature, instead of describing it in abstract way.
Comment 1 Morrita Hajime 2014-02-11 01:42:48 UTC
By the way, why should stylesheets be loaded?

It's because this allows script-supported CSS framework like Bootstrap
being an import. Also, UI framework can pack its default "theme" as an import
in addition to the script itself.
Comment 2 Morrita Hajime 2014-02-12 02:17:19 UTC
Working on this...
https://github.com/w3c/webcomponents/commit/99d0f1d8b1d6a993e811c8e9ea670396b783aff3

Turns out de-dup for stylesheet is tricky to define,
especially because there is a demand that wants to define
the order or appearance based on the position of <link> element.

Think about this example:

- index.html
  <link> - a.html
  <style id="s0">
  <link> - a.html

In this case, should styles in a.html win styles in s0?

If we styles in imports behave like scripts, it shouldn't and s0 should win
because a.html is already imported and second a.html is just skipped.

But style behaves differently in general.
For example, unlike <script>, DOM mutation matters for <style>.
If it is moved in different location, the order of the style changes.
So saying "already imported" doesn't provide good mental model.
Comment 3 Morrita Hajime 2014-02-20 22:54:49 UTC
Closing as it is dumped into the ToT [1].

We certainly need more polish though. I'll do it by filing finer-grained bugs (starting from Bug 24756), so that it makes the point clear.

[1] http://w3c.github.io/webcomponents/spec/imports/#style-imports