Changeset 253166 in webkit


Ignore:
Timestamp:
Dec 5, 2019 12:35:24 PM (4 years ago)
Author:
yurys@chromium.org
Message:

Web Inspector: Avoid using Runtime.executionContextCreated to figure out the iframe's contentDocument node.
https://bugs.webkit.org/show_bug.cgi?id=122764
<rdar://problem/15222136>

Reviewed by Devin Rousso.

Source/WebCore:

Force execution context creation on frame navigation similar to what inspector already
does for all known contexts when Runtime.enable is called. This is a prerequisite for
the injected script to work.

Test: inspector/runtime/execution-context-in-scriptless-page.html

  • inspector/InspectorInstrumentation.cpp:

(WebCore::InspectorInstrumentation::didCommitLoadImpl):

  • inspector/agents/page/PageRuntimeAgent.cpp:

(WebCore::PageRuntimeAgent::frameNavigated):

  • inspector/agents/page/PageRuntimeAgent.h:

LayoutTests:

Test that execution context is created and reported for pages without JavaScript.

  • inspector/runtime/execution-context-in-scriptless-page-expected.txt: Added.
  • inspector/runtime/execution-context-in-scriptless-page.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r253153 r253166  
     12019-12-05  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Web Inspector: Avoid using Runtime.executionContextCreated to figure out the iframe's contentDocument node.
     4        https://bugs.webkit.org/show_bug.cgi?id=122764
     5        <rdar://problem/15222136>
     6
     7        Reviewed by Devin Rousso.
     8
     9        Test that execution context is created and reported for pages without JavaScript.
     10
     11        * inspector/runtime/execution-context-in-scriptless-page-expected.txt: Added.
     12        * inspector/runtime/execution-context-in-scriptless-page.html: Added.
     13
    1142019-12-05  youenn fablet  <youenn@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r253163 r253166  
     12019-12-05  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Web Inspector: Avoid using Runtime.executionContextCreated to figure out the iframe's contentDocument node.
     4        https://bugs.webkit.org/show_bug.cgi?id=122764
     5        <rdar://problem/15222136>
     6
     7        Reviewed by Devin Rousso.
     8
     9        Force execution context creation on frame navigation similar to what inspector already
     10        does for all known contexts when Runtime.enable is called. This is a prerequisite for
     11        the injected script to work.
     12
     13        Test: inspector/runtime/execution-context-in-scriptless-page.html
     14
     15        * inspector/InspectorInstrumentation.cpp:
     16        (WebCore::InspectorInstrumentation::didCommitLoadImpl):
     17        * inspector/agents/page/PageRuntimeAgent.cpp:
     18        (WebCore::PageRuntimeAgent::frameNavigated):
     19        * inspector/agents/page/PageRuntimeAgent.h:
     20
    1212019-12-05  Chris Dumez  <cdumez@apple.com>
    222
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r252030 r253166  
    718718    }
    719719
     720    if (auto* pageRuntimeAgent = instrumentingAgents.pageRuntimeAgent())
     721        pageRuntimeAgent->frameNavigated(frame);
     722
    720723    if (InspectorCanvasAgent* canvasAgent = instrumentingAgents.inspectorCanvasAgent())
    721724        canvasAgent->frameNavigated(frame);
  • trunk/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp

    r251620 r253166  
    8686
    8787    InspectorRuntimeAgent::disable(errorString);
     88}
     89
     90void PageRuntimeAgent::frameNavigated(Frame& frame)
     91{
     92    // Ensure execution context is created for the frame even if it doesn't have scripts.
     93    mainWorldExecState(&frame);
    8894}
    8995
  • trunk/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h

    r251620 r253166  
    6161
    6262    // InspectorInstrumentation
     63    void frameNavigated(Frame&);
    6364    void didClearWindowObjectInWorld(Frame&);
    6465
Note: See TracChangeset for help on using the changeset viewer.