Bug 59263

Summary: WebKit2: Web Inspector: Support highlighting page elements
Product: WebKit Reporter: Brian Weinstein <bweinstein>
Component: Web Inspector (Deprecated)Assignee: Brian Weinstein <bweinstein>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, webkit.review.bot, yurys
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Fix alice.barraclough: review+

Description Brian Weinstein 2011-04-22 17:54:49 PDT
The Web Inspector in WebKit2 should support highlighting page elements when they are moused-over in the inspector.

<rdar://problem/8767659>
Comment 1 Brian Weinstein 2011-04-22 17:59:19 PDT
Created attachment 90819 [details]
[PATCH] Fix
Comment 2 WebKit Review Bot 2011-04-22 18:01:24 PDT
Attachment 90819 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit..." exit_code: 1

Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h:36:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Adam Roben (:aroben) 2011-04-24 23:32:23 PDT
Comment on attachment 90819 [details]
[PATCH] Fix

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

> Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h:73
> +    PageOverlay* m_highlightOverlay;

Holding a bare pointer doesn't seem safe. If someone else calls WebPage::installPageOverlay when you aren't expecting it, m_highlightOverlay will then become a dangling pointer.
Comment 4 Brian Weinstein 2011-04-25 09:31:21 PDT
(In reply to comment #3)
> (From update of attachment 90819 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=90819&action=review
> 
> > Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h:73
> > +    PageOverlay* m_highlightOverlay;
> 
> Holding a bare pointer doesn't seem safe. If someone else calls WebPage::installPageOverlay when you aren't expecting it, m_highlightOverlay will then become a dangling pointer.

It looks like FindController does the same thing. Is that code wrong as well? It looks like WebPage.h holds a RefPtr to a single overlay.
Comment 5 Brian Weinstein 2011-04-25 10:03:22 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > (From update of attachment 90819 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=90819&action=review
> > 
> > > Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h:73
> > > +    PageOverlay* m_highlightOverlay;
> > 
> > Holding a bare pointer doesn't seem safe. If someone else calls WebPage::installPageOverlay when you aren't expecting it, m_highlightOverlay will then become a dangling pointer.
> 
> It looks like FindController does the same thing. Is that code wrong as well? It looks like WebPage.h holds a RefPtr to a single overlay.

I'm going to land this with Alice's r+, and we can discuss a better way to clean this and FindController up.
Comment 6 Brian Weinstein 2011-04-25 10:13:13 PDT
Landed in r84781. Filed http://webkit.org/b/59329 to track the raw PageOverlay pointers in WebInspectorClient and FindController.