Bug 97120 - Web Inspector: yellow on-hover pop-up won't go if another pane asynchronously opens
Summary: Web Inspector: yellow on-hover pop-up won't go if another pane asynchronously...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Mirela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-19 10:41 PDT by Peter Rybin
Modified: 2012-09-25 09:22 PDT (History)
13 users (show)

See Also:


Attachments
Add mouseout event listener on popover element. (1.99 KB, patch)
2012-09-24 08:29 PDT, Mirela
no flags Details | Formatted Diff | Diff
Update the patch based on the review. (1.96 KB, patch)
2012-09-25 01:46 PDT, Mirela
apavlov: review-
Details | Formatted Diff | Diff
New patch update (2.12 KB, patch)
2012-09-25 08:44 PDT, Mirela
apavlov: review-
Details | Formatted Diff | Diff
Address review comments (2.11 KB, patch)
2012-09-25 09:01 PDT, Mirela
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Rybin 2012-09-19 10:41:47 PDT
General steps:
- in Sources tab provoke yellow inspect pop-up window by hovering over some variable in text
- in previous step learn the timing for hover to trigger evaluation
- manage to provoke inspect evaluation, but open ||> drawer (sources list) before the pop-up actually appears
- yellow pop-up appears above ||> drawer

Expected:
pointing away from pop-up makes it go

Actual:
the pop-up remains fixed as long as you move mouse inside the opened ||> drawer. User have to learn that not only he has to point away from the pop-up, but also point to the original half-visible pane of source text. This is pretty much unintuitive.

Hints for reproducing
Enable pause on exceptions. Open http://design.ru Execution will stop on widgets.js with TypeError. A "window" variable is references in left-top corner of the text, which is handy for starting heavy evaluate and making it to open ||>
Comment 1 Mirela 2012-09-20 02:00:22 PDT
I will try looking into this bug.
Comment 2 Mirela 2012-09-24 08:29:07 PDT
Created attachment 165388 [details]
Add mouseout event listener on popover element.
Comment 3 Alexander Pavlov (apavlov) 2012-09-25 01:16:52 PDT
Comment on attachment 165388 [details]
Add mouseout event listener on popover element.

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

> Source/WebCore/ChangeLog:3
> +        Fix for bug 97210

Please remove this auto-added line

> Source/WebCore/inspector/front-end/Popover.js:242
> +        if (event.target === this._hoverElement || 

WebKit has no limit for the line length, so the entire condition can be placed on a single line. And we definitely do not observe closing parentheses on a separate line.

> Source/WebCore/inspector/front-end/Popover.js:243
> +            (this.isPopoverVisible() && !event.toElement.isSelfOrDescendant(this._popover._contentDiv))

IIRC, event.toElement can be null/undefined if you are moving the pointer outside the browser window quickly (which is confirmed by http://trac.webkit.org/browser/trunk/Source/WebCore/dom/MouseEvent.cpp#L137). Also, "toElement" is an MSIE extension. The spec'ed way is "event.relatedTarget".
Comment 4 Mirela 2012-09-25 01:46:42 PDT
Created attachment 165556 [details]
Update the patch based on the review.
Comment 5 Alexander Pavlov (apavlov) 2012-09-25 04:28:17 PDT
Comment on attachment 165556 [details]
Update the patch based on the review.

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

> Source/WebCore/ChangeLog:3
> +        Fix for bug 97210

Hmm, please remove this auto-generated line...

> Source/WebCore/inspector/front-end/Popover.js:242
> +        if (event.target === this._hoverElement || (this.isPopoverVisible() && !event.relatedTarget.isSelfOrDescendant(this._popover._contentDiv)))

Please check event.relatedTarget for null-ity to avoid throwing a JS exception.
Comment 6 Mirela 2012-09-25 08:44:40 PDT
Created attachment 165619 [details]
New patch update
Comment 7 Alexander Pavlov (apavlov) 2012-09-25 08:53:11 PDT
Comment on attachment 165619 [details]
New patch update

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

Two small nits to fix, and the patch will be ready to land

> Source/WebCore/inspector/front-end/Popover.js:244
> +            && event.relatedTarget !== null

WebKit coding style guidelines require that null/0/undefined/whatever checks be performed by casting to a bool (e.g. ... && event.relatedTarget && ...) unless we need to disambiguate the actual value (e.g. null vs. undefined vs. "" vs. 0) - see http://www.webkit.org/coding/coding-style.html#zero-comparison

> Source/WebCore/inspector/front-end/Popover.js:246
> +        if (event.target === this._hoverElement || isPopoverMouseOut )

Extraneous whitespace before ')'
Comment 8 Mirela 2012-09-25 09:01:48 PDT
Created attachment 165621 [details]
Address review comments
Comment 9 Alexander Pavlov (apavlov) 2012-09-25 09:03:18 PDT
Comment on attachment 165621 [details]
Address review comments

r=me
Comment 10 WebKit Review Bot 2012-09-25 09:22:37 PDT
Comment on attachment 165621 [details]
Address review comments

Clearing flags on attachment: 165621

Committed r129516: <http://trac.webkit.org/changeset/129516>
Comment 11 WebKit Review Bot 2012-09-25 09:22:41 PDT
All reviewed patches have been landed.  Closing bug.