Bug 210197

Summary: REGRESSION (r251254): Web Inspector: Text insertion point is invisible when editing DOM nodes
Product: WebKit Reporter: Michael Bailey <bugzilla>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: chris, hi, inspector-bugzilla-changes, me, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: All   
OS: All   
See Also: http://bugs.webkit.org/show_bug.cgi?id=216095
Attachments:
Description Flags
Video showing bug
none
[Image] Memory issue
none
Patch
none
[Video] With patch applied
none
[Image] Before/after
none
Patch
hi: review+
Patch none

Michael Bailey
Reported 2020-04-08 10:09:11 PDT
Created attachment 395828 [details] Video showing bug Sometime between Safari 13.0 and 13.1, the blinking text insertion point cursor became invisible when editing DOM nodes. See attached video for an example. The insertion point is still visible as expected when editing style rules, in the console and other areas of the Inspector—it's just when editing DOM nodes that it's invisible. This issue reproduces in the shipping Safari 13.1 (15609.1.20.111.8) and Safari Technology Preview 104 (Safari 13.2, WebKit 15610.1.8.3).
Attachments
Video showing bug (23.64 MB, video/quicktime)
2020-04-08 10:09 PDT, Michael Bailey
no flags
[Image] Memory issue (209.28 KB, image/png)
2020-06-16 11:27 PDT, Nikita Vasilyev
no flags
Patch (3.81 KB, patch)
2020-06-16 11:42 PDT, Nikita Vasilyev
no flags
[Video] With patch applied (2.71 MB, video/quicktime)
2020-06-16 11:44 PDT, Nikita Vasilyev
no flags
[Image] Before/after (1.30 MB, image/png)
2020-06-17 14:58 PDT, Nikita Vasilyev
no flags
Patch (4.01 KB, patch)
2020-09-02 12:55 PDT, Nikita Vasilyev
hi: review+
Patch (4.04 KB, patch)
2020-09-02 13:54 PDT, Nikita Vasilyev
no flags
Radar WebKit Bug Importer
Comment 1 2020-04-08 16:49:48 PDT
Nikita Vasilyev
Comment 2 2020-06-15 17:54:04 PDT
Bisecting shows that this regressed in Bug 203057 - Web Inspector: Elements: selection shouldn't be dimmed by shadow trees.
Nikita Vasilyev
Comment 3 2020-06-16 11:27:12 PDT
Created attachment 402025 [details] [Image] Memory issue Another issue with https://trac.webkit.org/changeset/251254 is that it introduced a layer for every DOM node.
Nikita Vasilyev
Comment 4 2020-06-16 11:42:36 PDT
Nikita Vasilyev
Comment 5 2020-06-16 11:44:22 PDT
Created attachment 402030 [details] [Video] With patch applied
Devin Rousso
Comment 6 2020-06-16 14:29:02 PDT
Comment on attachment 402029 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=402029&action=review > Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css:55 > + z-index: -1; This reintroduces the bug that r251254 solved, which is that the selection background is shaded by the semi-transparent shadow DOM background, which is not ideal (especially when selecting something inside multiple nested shadow DOM subtrees). Why is it that adding `z-index: 1;` causes the cursor to disappear? That seems like the real bug here 🤔
Nikita Vasilyev
Comment 7 2020-06-16 15:29:27 PDT
(In reply to Devin Rousso from comment #6) > Comment on attachment 402029 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=402029&action=review > > > Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css:55 > > + z-index: -1; > > This reintroduces the bug that r251254 solved, which is that the selection > background is shaded by the semi-transparent shadow DOM background, which is > not ideal (especially when selecting something inside multiple nested shadow > DOM subtrees). To a smaller extend, but yes. > > Why is it that adding `z-index: 1;` causes the cursor to disappear? That > seems like the real bug here 🤔 This seems like a contentEditable WebKit bug although I haven't been able to make a reduction yet.
Nikita Vasilyev
Comment 8 2020-06-17 14:58:26 PDT
Created attachment 402156 [details] [Image] Before/after Actually, I wouldn't say it re-introduced the bug that r251254 solved. Screenshot attached. The text to background contrast of the selected item is pretty good!
Devin Rousso
Comment 9 2020-06-17 17:10:31 PDT
(In reply to Nikita Vasilyev from comment #8) > Created attachment 402156 [details] > [Image] Before/after > > Actually, I wouldn't say it re-introduced the bug that r251254 solved. Screenshot attached. The text to background contrast of the selected item is pretty good! I agree that it looks better than it did before r251254, but r251254 was specifically about "selection shouldn't be dimmed by shadow trees" which is still happening with this patch and is something I think we should avoid if possible.
Nikita Vasilyev
Comment 10 2020-06-17 17:39:02 PDT Comment hidden (obsolete)
Nikita Vasilyev
Comment 11 2020-09-02 12:55:02 PDT
Created attachment 407788 [details] Patch Updated the Changelog and rebaselined. I think we should land this now. When "Bug 213501 - contentEditable: Text caret is invisible on position relative elements" is resolved, we should revert this change (if the memory issue in Comment 3 isn't actually an issue).
Devin Rousso
Comment 12 2020-09-02 13:29:25 PDT
Comment on attachment 407788 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407788&action=review r=me Please make a new bug for fixing the non-solid issue that's blocked by bug 213501. > Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css:47 > + --shadow-background-color: hsla(0, 0%, 0%, 0.05); this could use a better name, like `--shadow-subtree-background-color` > Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css:-77 > -.tree-outline.dom li > :not(.selection-area) { (note for the future) we probably only need to do this when inside a `.shadow`
Nikita Vasilyev
Comment 13 2020-09-02 13:54:58 PDT
EWS
Comment 14 2020-09-02 19:08:15 PDT
Committed r266499: <https://trac.webkit.org/changeset/266499> All reviewed patches have been landed. Closing bug and clearing flags on attachment 407800 [details].
Nikita Vasilyev
Comment 15 2020-09-04 09:01:52 PDT
*** Bug 208310 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.