Bug 202218

Summary: Web Inspector: "Toggle Visibility" does not work for element inside Shadow DOM
Product: WebKit Reporter: Tim Guan-tin Chien [:timdream] <timdream>
Component: Web InspectorAssignee: Devin Rousso <drousso>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, drousso, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Macintosh   
OS: macOS 10.13   
Attachments:
Description Flags
Patch
bburg: review+, bburg: commit-queue-
Patch none

Description Tim Guan-tin Chien [:timdream] 2019-09-25 11:55:37 PDT
STR:

1. Load this URL which insert an open shadow root under <body>

data:text/html,<script>window.onload%20=%20()%20=>%20{%20sr%20=%20document.body.attachShadow({mode:%20"open"});%20sr.innerHTML%20=%20"<div>Hello</div>";%20}</script>

2. Inspect the element containing the word "Hello"
3. Right click and select "Toggle Visibility

Expected:

1. The element is hidden

Actual:

1. The element is not hidden.

Note:

Happens to me on Safari 13 (Version 13.0.1 (14608.2.11.1.11))
You will not be able to repro this bug on STP 92 because of bug 202217.
Comment 1 Radar WebKit Bug Importer 2019-09-25 11:55:57 PDT
<rdar://problem/55713078>
Comment 2 Devin Rousso 2019-11-04 10:58:38 PST
Created attachment 382750 [details]
Patch
Comment 3 Brian Burg 2019-11-04 15:15:13 PST
Comment on attachment 382750 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=382750&action=review

r=me

> Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:354
> +                else

Please add '// Inside Shadow DOM.'  to the else branch.
Comment 4 Devin Rousso 2019-11-04 15:20:40 PST
Created attachment 382779 [details]
Patch
Comment 5 WebKit Commit Bot 2019-11-04 16:18:25 PST
Comment on attachment 382779 [details]
Patch

Clearing flags on attachment: 382779

Committed r252026: <https://trac.webkit.org/changeset/252026>
Comment 6 WebKit Commit Bot 2019-11-04 16:18:27 PST
All reviewed patches have been landed.  Closing bug.