Bug 113563

Summary: Web Inspector: ability to use AnchorBox as an anchor for Popover
Product: WebKit Reporter: Andrey Lushnikov <lushnikov>
Component: Web Inspector (Deprecated)Assignee: Andrey Lushnikov <lushnikov>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, keishi, loislo, pfeldman, pmuellr, vsevik, web-inspector-bugs, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Andrey Lushnikov 2013-03-29 02:40:53 PDT
Ability to use AnchorBox instead of Element as an anchor for Popover.
Comment 1 Andrey Lushnikov 2013-03-29 02:43:31 PDT
Created attachment 195711 [details]
Patch
Comment 2 Eugene Klyuchnikov 2013-03-29 02:55:54 PDT
Comment on attachment 195711 [details]
Patch

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

> Source/WebCore/inspector/front-end/Popover.js:56
> +     * @param {Element|AnchorBox} anchor

Vsevolod wont accept this annotation =(
Comment 3 Andrey Lushnikov 2013-03-29 03:11:27 PDT
Comment on attachment 195711 [details]
Patch

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

>> Source/WebCore/inspector/front-end/Popover.js:56
>> +     * @param {Element|AnchorBox} anchor
> 
> Vsevolod wont accept this annotation =(

How about a bet? :)
Comment 4 Ilya Tikhonovsky 2013-03-29 04:28:08 PDT
Comment on attachment 195711 [details]
Patch

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

>>> Source/WebCore/inspector/front-end/Popover.js:56
>>> +     * @param {Element|AnchorBox} anchor
>> 
>> Vsevolod wont accept this annotation =(
> 
> How about a bet? :)

You can move anchorElement.boxInWindow(window); call to the topmost functions like show and showView
and implement another top level method showForBox
In that case you will have better api.
Comment 5 Pavel Feldman 2013-03-29 04:46:18 PDT
Comment on attachment 195711 [details]
Patch

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

> Source/WebCore/inspector/front-end/Popover.js:159
> +        var anchorBox = anchorElement.constructor === AnchorBox ? anchorElement : anchorElement.boxInWindow(window);

Please use instanceof
Comment 6 Andrey Lushnikov 2013-03-29 05:03:17 PDT
Created attachment 195724 [details]
Patch
Comment 7 WebKit Review Bot 2013-03-29 05:39:56 PDT
Comment on attachment 195724 [details]
Patch

Clearing flags on attachment: 195724

Committed r147209: <http://trac.webkit.org/changeset/147209>
Comment 8 WebKit Review Bot 2013-03-29 05:40:00 PDT
All reviewed patches have been landed.  Closing bug.