Bug 179402

Summary: ::slotted() styles should be applied only after flattening
Product: WebKit Reporter: Keanu Lee <webkit>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: koivisto, rniwa
Priority: P2    
Version: Safari 11   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=178237
Bug Depends on:    
Bug Blocks: 148695    

Description Keanu Lee 2017-11-07 17:11:09 PST
Per the spec https://drafts.csswg.org/css-scoping/#slotted-pseudo, the ::slotted() selector should only be applied to elements after flattening.

Example: https://jsbin.com/ruwesaj/edit?html,output

The following style:

::slotted(.hide) {
  display: none;
}

should not apply to the intermediate:

<slot class="hide"></slot>