Bug 197726

Summary: attachShadow should support attaching a shadow root to a main element
Product: WebKit Reporter: Steven <steven>
Component: DOMAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, cmarcelo, dbates, esprehn+autocc, ews-watchlist, kangil.han, koivisto, rniwa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 12   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 148695    
Attachments:
Description Flags
Fixes the bug none

Description Steven 2019-05-08 16:32:35 PDT
When trying to call `attachShadow` on a `<main>` element, Safari v12.1 and Safari Technology Preview throw an error: `NotSupportedError: The operation is not supported` even though `<main>` is a valid `attachShadow` target (https://dom.spec.whatwg.org/#dom-element-attachshadow).

Test case: https://codepen.io/straker/pen/eapxaw
Comment 1 Radar WebKit Bug Importer 2019-05-10 18:33:04 PDT
<rdar://problem/50685550>
Comment 2 Ryosuke Niwa 2019-10-04 20:41:43 PDT
Created attachment 380275 [details]
Fixes the bug
Comment 3 Ryosuke Niwa 2019-10-04 20:51:21 PDT
It's weird that this test never existed. I swear I wrote one and contributed to WPT but I don't see it anymore...
Comment 4 Ryosuke Niwa 2019-10-04 20:53:17 PDT
Hm... it looks like I either failed to merge it into WPT or someone else had "refactored" the tests and got rid of my test cases :(
Comment 5 Ryosuke Niwa 2019-10-06 19:30:42 PDT
Comment on attachment 380275 [details]
Fixes the bug

Clearing flags on attachment: 380275

Committed r250770: <https://trac.webkit.org/changeset/250770>
Comment 6 Ryosuke Niwa 2019-10-06 19:30:44 PDT
All reviewed patches have been landed.  Closing bug.