Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make <style> work in shadow trees #1137

Merged
merged 1 commit into from
Apr 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 16 additions & 23 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -13884,31 +13884,25 @@ c-end = "-->"</pre>

<div w-nodev>

<!--CLEANUP--><!-- consider moving the trailing <p> into the leading <p> and making the list be its
own thing rather than part of the extended sentence -->
<p>Whenever one of the following conditions occur for an element whose <span>node document</span>
has a <span data-x="concept-document-bc">browsing context</span>:</p>
<p>The user agent must run the <dfn>update a <code>style</code> block</dfn> algorithm that applies
for the style sheet language specified by the <code>style</code> element's <code
data-x="attr-style-type">type</code> attribute, passing it the element's <dfn>style
data</dfn>, whenever one of the following conditions occur:</p>
<!-- note that a browsing context isn't needed:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2739 -->

<ul>
<li>The element is popped off the <span>stack of open elements</span> of an <span>HTML
parser</span> or <span>XML parser</span>.

<li>the element is popped off the <span>stack of open elements</span> of an <span>HTML
parser</span> or <span>XML parser</span>,

<li>the element is not on the <span>stack of open elements</span> of an <span>HTML parser</span>
or <span>XML parser</span>, and it is <span data-x="node is inserted into a document">inserted
into a document</span> or <span data-x="node is removed from a document">removed from a
document</span>,

<li>the element is not on the <span>stack of open elements</span> of an <span>HTML parser</span>
or <span>XML parser</span>, and one of its child nodes is modified by a script,
<li>The element is not on the <span>stack of open elements</span> of an <span>HTML parser</span>
or <span>XML parser</span>, and it is <span data-x="node is connected">connected</span> or <span
data-x="node is disconnected">disconnected</span>.

<li>The element is not on the <span>stack of open elements</span> of an <span>HTML parser</span>
or <span>XML parser</span>, and one of its child nodes is modified by a script.
</ul>

<p>...the user agent must run the <dfn>update a <code>style</code>
block</dfn> algorithm that applies for the style sheet language specified by the element's <code
data-x="attr-style-type">type</code> attribute, passing it the element's <dfn>style
data</dfn>.</p>

<p>For styling languages that consist of pure text (as opposed to XML), a <code>style</code>
element's <span>style data</span> is the <span>child text content</span> of the <code>style</code>
element. For XML-based styling languages, the <span>style data</span> consists of all the child
Expand All @@ -13924,16 +13918,14 @@ own thing rather than part of the extended sentence -->
<li><p>If <var>element</var> has an <span>associated CSS style sheet</span>, <span
data-x="remove a CSS style sheet">remove the CSS style sheet</span> in question.</p></li>

<li><p>If <var>element</var> is not <span>in a <code>Document</code></span>, then abort
these steps.</p></li> <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2740 -->
<li><p>If <var>element</var> is not <span>in a shadow-including document</span>, then abort these
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would mean that shadowRoot.stylesheets would not include a stylesheet when the shadow root is disconnected from a document. That doesn't reflect what we discussed in WICG/webcomponents#56.

It looks like we need a separate bug for CSS OM as well: https://drafts.csswg.org/cssom/#extensions-to-the-document-interface

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #1194 to track this.

steps.</p></li> <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2740 -->

<li><p>If the <span>Should element's inline behavior be blocked by Content Security
Policy?</span> algorithm returns "<code data-x="">Blocked</code>" when executed upon the
<code>style</code> element, "<code data-x="">style</code>", and the <code>style</code>
element's <code>style data</code>, then abort these steps. <ref spec="CSP"></p></li>

<!-- note that the browsing context isn't needed: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2739 -->

<li>

<p><span>Create a CSS style sheet</span> with the following properties:</p>
Expand Down Expand Up @@ -14011,6 +14003,7 @@ own thing rather than part of the extended sentence -->
the <code>style</code> element. Non-network errors in processing the style sheet or its
subresources (e.g. CSS parse errors, PNG decoding errors) are not failures for the purposes of
this paragraph.</p>
<!-- Shadow TODO: events need to be scoped -->

<p>The <span>task source</span> for these <span data-x="concept-task">tasks</span> is the <span>DOM
manipulation task source</span>.</p>
Expand Down