Bug 59263 - WebKit2: Web Inspector: Support highlighting page elements
Summary: WebKit2: Web Inspector: Support highlighting page elements
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: Brian Weinstein
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-04-22 17:54 PDT by Brian Weinstein
Modified: 2011-04-25 10:13 PDT (History)
11 users (show)

See Also:


Attachments
[PATCH] Fix (4.97 KB, patch)
2011-04-22 17:59 PDT, Brian Weinstein
alice.barraclough: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.