Bug 105404 - [Shadow DOM]: Wrong type of CSSRule when @Host rule is used
Summary: [Shadow DOM]: Wrong type of CSSRule when @Host rule is used
Status: RESOLVED DUPLICATE of bug 102344
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 63606 103230
  Show dependency treegraph
 
Reported: 2012-12-19 01:36 PST by Sergey G. Grekhov
Modified: 2012-12-19 03:07 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey G. Grekhov 2012-12-19 01:36:32 PST
When @Host rule is used not in shadow root then CSSRule object returned by cssRules property, not CSSHostRule

Chrome 25.0.1364.0 canary. Test: 

<html>
<head>
<script type="text/javascript">
function test() {
	var d = document;
    var host = d.createElement('div');
    d.body.appendChild(host);
    
    var style = d.createElement('style');
    style.innerHTML = '' + 
            'span { color: blue; }' +
            '@host {' +
            'div { color: red; }' +
            '}';
    d.head.appendChild(style);
    
    alert('Expected 1001, actual ' + d.styleSheets[0].cssRules[1].type);
 }
</script>
</head>
<body onload="test()">
</body>
</html>
Comment 2 Takashi Sakamoto 2012-12-19 03:07:26 PST
Hello,

Since CSSHostRule has not been implemented yet, currently CSSUnknownRule is used instead.
I'm now trying to fix this issue on bug 102344.

Best regards,
Takashi Sakamoto

*** This bug has been marked as a duplicate of bug 102344 ***