forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
::slotted doesn't work in nested shadow trees
https://bugs.webkit.org/show_bug.cgi?id=154765 <rdar://problem/24870995> Reviewed by Ryosuke Niwa. Source/WebCore: See WICG/webcomponents#331 (comment) Test: fast/shadow-dom/css-scoping-shadow-slotted-nested.html * css/ElementRuleCollector.cpp: (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules): Collect ::slotted rules from all the nested shadow trees instead of just the host's. LayoutTests: * fast/shadow-dom/css-scoping-shadow-slotted-nested-expected.html: Added. * fast/shadow-dom/css-scoping-shadow-slotted-nested.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@197316 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
antti@apple.com
committed
Feb 29, 2016
1 parent
608dcdc
commit 594c2f0
Showing
5 changed files
with
119 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
LayoutTests/fast/shadow-dom/css-scoping-shadow-slotted-nested-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<p>Test passes if you see a single 100px by 100px green box below.</p> | ||
<div style="width: 100px; height: 100px; background: green;"></div> | ||
</body> | ||
</html> |
66 changes: 66 additions & 0 deletions
66
LayoutTests/fast/shadow-dom/css-scoping-shadow-slotted-nested.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Scoping - ::slotted pseudo element rule must apply to an element that got slotted via another slot</title> | ||
<link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/> | ||
<link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model"> | ||
<link rel="match" href="reference/green-box.html"/> | ||
</head> | ||
<body> | ||
<style> | ||
outer-host { | ||
display: block; | ||
width: 100px; | ||
height: 100px; | ||
background: red; | ||
} | ||
outer-host > * { | ||
display: block; | ||
width: 100px; | ||
height: 25px; | ||
} | ||
</style> | ||
<p>Test passes if you see a single 100px by 100px green box below.</p> | ||
<outer-host> | ||
<span slot="outer">FAIL1</span> | ||
<span slot="inner">FAIL2</span> | ||
<span slot="both">FAIL3</span> | ||
</outer-host> | ||
<template id="outer-host-template"> | ||
<inner-host> | ||
<style> | ||
::slotted([slot=outer]) { background: green; color: green; } | ||
::slotted([slot=both]) { background: green; } | ||
span { display: block; width: 100px; height: 25px; } | ||
</style> | ||
<slot name="outer"></slot> | ||
<slot name="inner"></slot> | ||
<slot name="both"></slot> | ||
<span slot="inner">FAIL4</span> | ||
</inner-host> | ||
</template> | ||
<template id="inner-host-template"> | ||
<style> | ||
::slotted([slot=inner]) { background: green; color: green; } | ||
::slotted([slot=both]) { color: green; } | ||
</style> | ||
<slot></slot> | ||
<slot name="inner"></slot> | ||
</template> | ||
<script> | ||
|
||
try { | ||
var outerHost = document.querySelector('outer-host'); | ||
outerShadow = outerHost.attachShadow({mode: 'closed'}); | ||
outerShadow.appendChild(document.getElementById('outer-host-template').content.cloneNode(true)); | ||
|
||
var innerHost = outerShadow.querySelector('inner-host'); | ||
innerShadow = innerHost.attachShadow({mode: 'closed'}); | ||
innerShadow.appendChild(document.getElementById('inner-host-template').content.cloneNode(true)); | ||
} catch (exception) { | ||
document.body.appendChild(document.createTextNode(exception)); | ||
} | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters