Bug 182661 - Web Inspector: Styles: Completion popover should hide when resizing or scrolling
Summary: Web Inspector: Styles: Completion popover should hide when resizing or scrolling
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-02-09 15:57 PST by Nikita Vasilyev
Modified: 2018-02-14 14:45 PST (History)
4 users (show)

See Also:


Attachments
[Animated GIF] Bug (1.36 MB, image/gif)
2018-02-09 15:57 PST, Nikita Vasilyev
no flags Details
[Animated GIF] WIP (841.25 KB, image/gif)
2018-02-10 19:50 PST, Nikita Vasilyev
no flags Details
Patch (5.47 KB, patch)
2018-02-11 17:26 PST, Nikita Vasilyev
timothy: review+
Details | Formatted Diff | Diff
[Animated GIF] With patch applied (241.27 KB, image/gif)
2018-02-11 17:28 PST, Nikita Vasilyev
no flags Details
Patch (5.47 KB, patch)
2018-02-14 12:03 PST, Nikita Vasilyev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2018-02-09 15:57:11 PST
Created attachment 333530 [details]
[Animated GIF] Bug

CompletionSuggestionsView's popover doesn't update when:
1. Sidebar is resized.
2. Sidebar is scrolled.
3. When web page is reloaded by pressing Command-R!

In "Bug 182619 - Web Inspector: Styles: Loses focus when editing a property while page is being loaded"
you can see the completion popover not hiding when the anchor node is removed from DOM.

I recently fixed "Bug 182464 - Web Inspector: Styles: completion popover doesn't hide when switching panels",
by adding a bunch of code to hide the popover when the anchor element becomes hidden.

---

Instead of fixing these issues one by one, CompletionSuggestionsView should be smarter by default.

The popover should hide when the anchor node:
- detaches from DOM.
- becomes invisible.

The popover should update its position when the anchor node moves.
Comment 1 Radar WebKit Bug Importer 2018-02-09 15:57:34 PST
<rdar://problem/37408559>
Comment 2 Nikita Vasilyev 2018-02-10 19:50:17 PST
Created attachment 333567 [details]
[Animated GIF] WIP

On the animated GIF you can see the popover still being visible when the anchor node is behind the sidebar navigation bar. It also looks jittery.

I think it's good enough to hide the popover when resizing or scrolling.
Comment 3 Nikita Vasilyev 2018-02-11 17:26:10 PST
Created attachment 333574 [details]
Patch
Comment 4 Nikita Vasilyev 2018-02-11 17:28:35 PST
Created attachment 333575 [details]
[Animated GIF] With patch applied
Comment 5 Nikita Vasilyev 2018-02-11 17:38:56 PST
> CompletionSuggestionsView's popover doesn't update when:
> 1. Sidebar is resized.
> 2. Sidebar is scrolled.
> 3. When web page is reloaded by pressing Command-R!

My patch fixes these cases.


> In "Bug 182619 - Web Inspector: Styles: Loses focus when editing a property
> while page is being loaded"
> you can see the completion popover not hiding when the anchor node is
> removed from DOM.

My patch mitigates this issue by hiding the popover. The bug with losing focus still needs to be fixed in bug 182619.

> I recently fixed "Bug 182464 - Web Inspector: Styles: completion popover
> doesn't hide when switching panels",
> by adding a bunch of code to hide the popover when the anchor element
> becomes hidden.

Again, my patch mitigates the issue by hiding the popover, but doesn't fix it completely. When switching panels, we still need to manually trigger blur event, or it's possible to continue typing in a text field of a a hidden panel :(
We can't revert bug 182464.
Comment 6 Timothy Hatcher 2018-02-14 11:57:19 PST
Comment on attachment 333574 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js:168
> +        }
> +        this.show(this._anchorBounds);

Nit: New line between these lines.
Comment 7 Nikita Vasilyev 2018-02-14 12:03:20 PST
Created attachment 333827 [details]
Patch
Comment 8 WebKit Commit Bot 2018-02-14 14:45:55 PST
Comment on attachment 333827 [details]
Patch

Clearing flags on attachment: 333827

Committed r228487: <https://trac.webkit.org/changeset/228487>
Comment 9 WebKit Commit Bot 2018-02-14 14:45:57 PST
All reviewed patches have been landed.  Closing bug.