Changeset 83892 in webkit


Ignore:
Timestamp:
Apr 14, 2011 1:53:21 PM (13 years ago)
Author:
alexis.menard@openbossa.org
Message:

2011-01-26 Ragner Magalhaes <ragner.magalhaes@openbossa.org>

Reviewed by Antonio Gomes.

[Qt] Web Inspector does not highlight elements
https://bugs.webkit.org/show_bug.cgi?id=35125

Adjust Web inspector to highlight elements on the page when the mouse
hovers the element on DOM inspector.

  • Api/qwebframe.cpp: (QWebFramePrivate::renderRelativeCoords):
  • WebCoreSupport/InspectorClientQt.cpp: (WebCore::InspectorClientQt::highlight): (WebCore::InspectorClientQt::hideHighlight):

2011-04-14 Ragner Magalhaes <ragner.magalhaes@openbossa.org>

Reviewed by Antonio Gomes.

[Qt] Web Inspector does not highlight elements
https://bugs.webkit.org/show_bug.cgi?id=35125

We should call drawNodeHighlight() just if a highlighted node exists
to avoid do save()/restore() on the Graphics Context unnecessarily.

Added highlightedNode() method to check if we need to call drawNodeHighlight()
and only on this case do save()/restore() on the Graphics Context.

  • inspector/InspectorAgent.h: (WebCore::InspectorAgent::highlightedNode):
Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r83891 r83892  
     12011-04-14  Ragner Magalhaes  <ragner.magalhaes@openbossa.org>
     2
     3        Reviewed by Antonio Gomes.
     4
     5        [Qt] Web Inspector does not highlight elements
     6        https://bugs.webkit.org/show_bug.cgi?id=35125
     7
     8        We should call drawNodeHighlight() just if a highlighted node exists
     9        to avoid do save()/restore() on the Graphics Context unnecessarily.
     10
     11        Added highlightedNode() method to check if we need to call drawNodeHighlight()
     12        and only on this case do save()/restore() on the Graphics Context.
     13
     14        * inspector/InspectorAgent.h:
     15        (WebCore::InspectorAgent::highlightedNode):
     16
    1172011-04-14  Adrienne Walker  <enne@google.com>
    218
  • trunk/Source/WebCore/inspector/InspectorController.cpp

    r83599 r83892  
    255255}
    256256
     257Node* InspectorController::highlightedNode() const
     258{
     259    return m_inspectorAgent->domAgent()->highlightedNode();
     260}
     261
    257262#if ENABLE(JAVASCRIPT_DEBUGGER)
    258263void InspectorController::enableProfiler()
  • trunk/Source/WebCore/inspector/InspectorController.h

    r81673 r83892  
    8181    void drawNodeHighlight(GraphicsContext&) const;
    8282    void hideHighlight();
     83    Node* highlightedNode() const;
    8384
    8485    void evaluateForTestInFrontend(long callId, const String& script);
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.h

    r83706 r83892  
    135135    void highlightFrame(ErrorString*, const String& frameId);
    136136    void hideFrameHighlight(ErrorString* error) { hideHighlight(error); }
     137    Node* highlightedNode() const { return m_highlightedNode.get(); }
    137138
    138139    // Methods called from the InspectorInstrumentation.
  • trunk/Source/WebKit/qt/Api/qwebframe.cpp

    r83579 r83892  
    387387    }
    388388    renderFrameExtras(context, layers, clip);
     389#if ENABLE(INSPECTOR)
     390    if (frame->page()->inspectorController()->highlightedNode()) {
     391        context->save();
     392        frame->page()->inspectorController()->drawNodeHighlight(*context);
     393        context->restore();
     394    }
     395#endif
    389396}
    390397
  • trunk/Source/WebKit/qt/ChangeLog

    r83620 r83892  
     12011-01-26  Ragner Magalhaes  <ragner.magalhaes@openbossa.org>
     2
     3        Reviewed by Antonio Gomes.
     4
     5        [Qt] Web Inspector does not highlight elements
     6        https://bugs.webkit.org/show_bug.cgi?id=35125
     7
     8        Adjust Web inspector to highlight elements on the page when the mouse
     9        hovers the element on DOM inspector.
     10
     11        * Api/qwebframe.cpp:
     12        (QWebFramePrivate::renderRelativeCoords):
     13        * WebCoreSupport/InspectorClientQt.cpp:
     14        (WebCore::InspectorClientQt::highlight):
     15        (WebCore::InspectorClientQt::hideHighlight):
     16
    1172011-04-12  George Guo  <George.Guo@nokia.com>
    218
  • trunk/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp

    r82059 r83892  
    3333
    3434#include "Frame.h"
     35#include "FrameView.h"
    3536#include "InspectorController.h"
    3637#include "InspectorFrontend.h"
     
    263264void InspectorClientQt::highlight(Node*)
    264265{
    265     notImplemented();
     266    hideHighlight();
    266267}
    267268
    268269void InspectorClientQt::hideHighlight()
    269270{
    270     notImplemented();
     271    WebCore::Frame* frame = m_inspectedWebPage->d->page->mainFrame();
     272    if (frame) {
     273        QRect rect = m_inspectedWebPage->mainFrame()->geometry();
     274        if (!rect.isEmpty())
     275            frame->view()->invalidateRect(rect);
     276    }
    271277}
    272278
Note: See TracChangeset for help on using the changeset viewer.