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 22826 - [Shadow]: Clarify how getComputedStyle with unprojected elements works
Summary: [Shadow]: Clarify how getComputedStyle with unprojected elements works
Status: RESOLVED WONTFIX
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Hayato Ito
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 23062
  Show dependency treegraph
 
Reported: 2013-07-29 02:00 UTC by Takashi Sakamoto
Modified: 2014-05-29 08:28 UTC (History)
1 user (show)

See Also:


Attachments

Description Takashi Sakamoto 2013-07-29 02:00:28 UTC
Originates from http://crbug.com/260502

If you have something like:

div
  #shadow-root
    <content>
  div#testCase

then remove the content element:

div
  #shadow-root
  div#testCase

then getComputedStyle(testCase) is empty - i.e. no styles are computed, even though the element is in the tree and should inherit.

On the other hand, if the content element is never inserted, styles are computed for testCase.
Comment 1 Takashi Sakamoto 2013-07-29 02:14:19 UTC
Talking about current Blink, when running the testcase with followings:

console.log(getComputedStyle(div#testCase));
console.log(getComputedStyle(div#testCase).display);
console.log(getComputedStyle(div#testCase).backgroundColor);

(a) Before removing <content>:

CONSOLE MESSAGE: line 23: [object CSSStyleDeclaration]
CONSOLE MESSAGE: line 24: block
CONSOLE MESSAGE: line 25: rgba(0, 0, 0, 0)


(b) After removing <content>:

CONSOLE MESSAGE: line 32: [object CSSStyleDeclaration]
CONSOLE MESSAGE: line 33:
CONSOLE MESSAGE: line 34:

---

So unprojected elements have empty styles? Or unprojected elements have some styles with display: none?
Comment 2 Hayato Ito 2014-05-29 08:28:33 UTC
Let me close this. I think css-scoping spec should have addressed that.