Bug 197726 - attachShadow should support attaching a shadow root to a main element
Summary: attachShadow should support attaching a shadow root to a main element
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 12
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
Keywords: InRadar
Depends on:
Blocks: 148695
  Show dependency treegraph
Reported: 2019-05-08 16:32 PDT by Steven
Modified: 2019-10-06 19:30 PDT (History)
10 users (show)

See Also:

Fixes the bug (40.54 KB, patch)
2019-10-04 20:41 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
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.