The Web Inspector in WebKit2 should support highlighting page elements when they are moused-over in the inspector. <rdar://problem/8767659>
Created attachment 90819 [details] [PATCH] Fix
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 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.
(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.
(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.
Landed in r84781. Filed http://webkit.org/b/59329 to track the raw PageOverlay pointers in WebInspectorClient and FindController.