Changeset 145342 in webkit


Ignore:
Timestamp:
Mar 11, 2013 12:16:56 AM (11 years ago)
Author:
apavlov@chromium.org
Message:

Web Inspector: [Elements] XSLT transformation result from the xml-stylesheet PI not rendered
https://bugs.webkit.org/show_bug.cgi?id=111313

Reviewed by Vsevolod Vlasov.

Source/WebCore:

Frame document update upon XSL transformation was never instrumented.
This change instruments the Document::applyXSLTransform() method to that end.

Test: http/tests/inspector/styles/xsl-transformed.xml

  • dom/Document.cpp:

(WebCore::Document::applyXSLTransform): Instrumented.

  • inspector/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::frameDocumentUpdated): Invoked upon applyXSLTransform().

  • inspector/InspectorDOMAgent.h:
  • inspector/InspectorInstrumentation.cpp:

(WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl): Added.

  • inspector/InspectorInstrumentation.h:

(WebCore::InspectorInstrumentation::didCommitLoad): Drive-by: simplified.
(WebCore::InspectorInstrumentation::frameDocumentUpdated): Added.

LayoutTests:

  • http/tests/inspector/styles/resources/xsl-transformed.xsl: Added.
  • http/tests/inspector/styles/xsl-transformed-expected.txt: Added.
  • http/tests/inspector/styles/xsl-transformed.xml: Added.
Location:
trunk
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r145340 r145342  
     12013-03-07  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [Elements] XSLT transformation result from the xml-stylesheet PI not rendered
     4        https://bugs.webkit.org/show_bug.cgi?id=111313
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        * http/tests/inspector/styles/resources/xsl-transformed.xsl: Added.
     9        * http/tests/inspector/styles/xsl-transformed-expected.txt: Added.
     10        * http/tests/inspector/styles/xsl-transformed.xml: Added.
     11
    1122013-03-10  Matt Falkenhagen  <falken@chromium.org>
    213
  • trunk/Source/WebCore/ChangeLog

    r145340 r145342  
     12013-03-07  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [Elements] XSLT transformation result from the xml-stylesheet PI not rendered
     4        https://bugs.webkit.org/show_bug.cgi?id=111313
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        Frame document update upon XSL transformation was never instrumented.
     9        This change instruments the Document::applyXSLTransform() method to that end.
     10
     11        Test: http/tests/inspector/styles/xsl-transformed.xml
     12
     13        * dom/Document.cpp:
     14        (WebCore::Document::applyXSLTransform): Instrumented.
     15        * inspector/InspectorDOMAgent.cpp:
     16        (WebCore::InspectorDOMAgent::frameDocumentUpdated): Invoked upon applyXSLTransform().
     17        * inspector/InspectorDOMAgent.h:
     18        * inspector/InspectorInstrumentation.cpp:
     19        (WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl): Added.
     20        * inspector/InspectorInstrumentation.h:
     21        (WebCore::InspectorInstrumentation::didCommitLoad): Drive-by: simplified.
     22        (WebCore::InspectorInstrumentation::frameDocumentUpdated): Added.
     23
    1242013-03-10  Matt Falkenhagen  <falken@chromium.org>
    225
  • trunk/Source/WebCore/dom/Document.cpp

    r145126 r145342  
    42424242        return;
    42434243    // FIXME: If the transform failed we should probably report an error (like Mozilla does).
    4244     processor->createDocumentFromSource(newSource, resultEncoding, resultMIMEType, this, frame());
     4244    Frame* ownerFrame = frame();
     4245    processor->createDocumentFromSource(newSource, resultEncoding, resultMIMEType, this, ownerFrame);
     4246    InspectorInstrumentation::frameDocumentUpdated(ownerFrame);
    42454247}
    42464248
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r144624 r145342  
    16731673}
    16741674
     1675void InspectorDOMAgent::frameDocumentUpdated(Frame* frame)
     1676{
     1677    Document* document = frame->document();
     1678    if (!document)
     1679        return;
     1680
     1681    Page* page = frame->page();
     1682    ASSERT(page);
     1683    if (frame != page->mainFrame())
     1684        return;
     1685
     1686    // Only update the main frame document, nested frame document updates are not required
     1687    // (will be handled by loadEventFired()).
     1688    setDocument(document);
     1689}
     1690
    16751691Node* InspectorDOMAgent::nodeForPath(const String& path)
    16761692{
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.h

    r144624 r145342  
    172172    void didPushShadowRoot(Element* host, ShadowRoot*);
    173173    void willPopShadowRoot(Element* host, ShadowRoot*);
     174    void frameDocumentUpdated(Frame*);
    174175
    175176    int pushNodeToFrontend(ErrorString*, int documentNodeId, Node*);
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r145061 r145342  
    938938}
    939939
     940void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents* instrumentingAgents, Frame* frame)
     941{
     942    InspectorAgent* inspectorAgent = instrumentingAgents->inspectorAgent();
     943    if (!inspectorAgent || !inspectorAgent->developerExtrasEnabled())
     944        return;
     945
     946    if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent())
     947        domAgent->frameDocumentUpdated(frame);
     948}
     949
    940950void InspectorInstrumentation::loaderDetachedFromFrameImpl(InstrumentingAgents* instrumentingAgents, DocumentLoader* loader)
    941951{
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.h

    r145061 r145342  
    214214    static void frameDetachedFromParent(Frame*);
    215215    static void didCommitLoad(Frame*, DocumentLoader*);
     216    static void frameDocumentUpdated(Frame*);
    216217    static void loaderDetachedFromFrame(Frame*, DocumentLoader*);
    217218    static void frameStartedLoading(Frame*);
     
    416417    static void frameDetachedFromParentImpl(InstrumentingAgents*, Frame*);
    417418    static void didCommitLoadImpl(InstrumentingAgents*, Page*, DocumentLoader*);
     419    static void frameDocumentUpdatedImpl(InstrumentingAgents*, Frame*);
    418420    static void loaderDetachedFromFrameImpl(InstrumentingAgents*, DocumentLoader*);
    419421    static void frameStartedLoadingImpl(InstrumentingAgents*, Frame*);
     
    16421644{
    16431645#if ENABLE(INSPECTOR)
    1644     if (!frame)
    1645         return;
    1646     Page* page = frame->page();
    1647     if (!page)
    1648         return;
    1649     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1650         didCommitLoadImpl(instrumentingAgents, page, loader);
     1646    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
     1647        didCommitLoadImpl(instrumentingAgents, frame->page(), loader);
    16511648#else
    16521649    UNUSED_PARAM(frame);
    16531650    UNUSED_PARAM(loader);
     1651#endif
     1652}
     1653
     1654inline void InspectorInstrumentation::frameDocumentUpdated(Frame* frame)
     1655{
     1656#if ENABLE(INSPECTOR)
     1657    FAST_RETURN_IF_NO_FRONTENDS(void());
     1658    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
     1659        frameDocumentUpdatedImpl(instrumentingAgents, frame);
     1660#else
     1661    UNUSED_PARAM(frame);
    16541662#endif
    16551663}
Note: See TracChangeset for help on using the changeset viewer.