Web Inspector: Remove unused and mostly untested Page domain commands and events
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2016 19:31:08 +0000 (19:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2016 19:31:08 +0000 (19:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=165507

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-12-07
Reviewed by Brian Burg.

Source/JavaScriptCore:

Remove unused and unsupported commands and events.

  - Page.setDocumentContent
  - Page.getScriptExecutionStatus
  - Page.setScriptExecutionDisabled
  - Page.handleJavaScriptDialog
  - Page.javascriptDialogOpening
  - Page.javascriptDialogClosed
  - Page.scriptsEnabled

* inspector/protocol/Page.json:

Source/WebCore:

Remove any code associated with the commands/events being removed.

* inspector/DOMPatchSupport.cpp:
* inspector/DOMPatchSupport.h:
* inspector/InspectorClient.h:
(WebCore::InspectorClient::handleJavaScriptDialog): Deleted.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::scriptsEnabledImpl): Deleted.
(WebCore::InspectorInstrumentation::willRunJavaScriptDialogImpl): Deleted.
(WebCore::InspectorInstrumentation::didRunJavaScriptDialogImpl): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::scriptsEnabled): Deleted.
(WebCore::InspectorInstrumentation::willRunJavaScriptDialog): Deleted.
(WebCore::InspectorInstrumentation::didRunJavaScriptDialog): Deleted.
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
(WebCore::InspectorPageAgent::didPaint):
(WebCore::InspectorPageAgent::buildObjectForFrame):
(WebCore::InspectorPageAgent::archive):
(WebCore::createXHRTextDecoder): Deleted.
(WebCore::InspectorPageAgent::getScriptExecutionStatus): Deleted.
(WebCore::InspectorPageAgent::setScriptExecutionDisabled): Deleted.
(WebCore::InspectorPageAgent::willRunJavaScriptDialog): Deleted.
(WebCore::InspectorPageAgent::didRunJavaScriptDialog): Deleted.
(WebCore::InspectorPageAgent::scriptsEnabled): Deleted.
(WebCore::InspectorPageAgent::handleJavaScriptDialog): Deleted.
* inspector/InspectorPageAgent.h:
* page/Chrome.cpp:
(WebCore::Chrome::runBeforeUnloadConfirmPanel):
(WebCore::Chrome::runJavaScriptAlert):
(WebCore::Chrome::runJavaScriptConfirm):
(WebCore::Chrome::runJavaScriptPrompt):
* page/Settings.cpp:
(WebCore::Settings::setScriptEnabled):

Source/WebInspectorUI:

* UserInterface/Protocol/PageObserver.js:
(WebInspector.PageObserver.prototype.javascriptDialogOpening):
(WebInspector.PageObserver.prototype.javascriptDialogClosed):
(WebInspector.PageObserver.prototype.scriptsEnabled):
Keep stub in case legacy backends dispatch the event to the frontend.

* UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
* Versions/Inspector-iOS-10.0.json:
* Versions/Inspector-iOS-7.0.json:
* Versions/Inspector-iOS-8.0.json:
* Versions/Inspector-iOS-9.0.json:
* Versions/Inspector-iOS-9.3.json:
Remove handleJavaScriptDialog command from legacy backends because it
doesn't appear as if the iOS backend handled it at all.

LayoutTests:

* inspector/page/javascriptDialogEvents-expected.txt: Removed.
* inspector/page/javascriptDialogEvents.html: Removed.
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
Remove test skipped by all platforms.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209465 268f45cc-cd09-0410-ab3c-d52691b4dbfc

29 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/page/javascriptDialogEvents-expected.txt [deleted file]
LayoutTests/inspector/page/javascriptDialogEvents.html [deleted file]
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/protocol/Page.json
Source/WebCore/ChangeLog
Source/WebCore/inspector/DOMPatchSupport.cpp
Source/WebCore/inspector/DOMPatchSupport.h
Source/WebCore/inspector/InspectorClient.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/InspectorPageAgent.h
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/Settings.cpp
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/PageObserver.js
Source/WebInspectorUI/Versions/Inspector-iOS-10.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-8.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-9.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-9.3.json

index 249c34e..6e8a1fd 100644 (file)
@@ -1,3 +1,16 @@
+2016-12-07  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove unused and mostly untested Page domain commands and events
+        https://bugs.webkit.org/show_bug.cgi?id=165507
+
+        Reviewed by Brian Burg.
+
+        * inspector/page/javascriptDialogEvents-expected.txt: Removed.
+        * inspector/page/javascriptDialogEvents.html: Removed.
+        * platform/gtk/TestExpectations:
+        * platform/mac/TestExpectations:
+        Remove test skipped by all platforms.
+
 2016-12-07  Dave Hyatt  <hyatt@apple.com>
 
         Fix a bad result that I landed by accident.
diff --git a/LayoutTests/inspector/page/javascriptDialogEvents-expected.txt b/LayoutTests/inspector/page/javascriptDialogEvents-expected.txt
deleted file mode 100644 (file)
index a74872d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-CONFIRM NAVIGATION: beforeunload in javascriptDialogEvents
-ALERT: alert
-CONFIRM: confirm
-PROMPT: prompt, default text: 
-Opening with message: beforeunload in javascriptDialogEvents
-Closed
-Opening with message: alert
-Closed
-Opening with message: confirm
-Closed
-Opening with message: prompt
-Closed
-
diff --git a/LayoutTests/inspector/page/javascriptDialogEvents.html b/LayoutTests/inspector/page/javascriptDialogEvents.html
deleted file mode 100644 (file)
index ef6d389..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<html>
-<head>
-<script type="text/javascript" src="../../http/tests/inspector/resources/protocol-test.js"></script>
-<script>
-
-window.addEventListener("beforeunload", onBeforeUnload);
-
-function onBeforeUnload()
-{
-    window.removeEventListener("beforeunload", onBeforeUnload);
-    return "beforeunload in javascriptDialogEvents";
-}
-
-function test()
-{
-    InspectorProtocol.eventHandler["Page.javascriptDialogOpening"] = onOpening;
-    InspectorProtocol.eventHandler["Page.javascriptDialogClosed"] = onClosed;
-    InspectorProtocol.sendCommand("Page.enable", {});
-
-    function onOpening(event)
-    {
-        ProtocolTest.log("Opening with message: " + event.params.message);
-    }
-    function onClosed()
-    {
-        ProtocolTest.log("Closed");
-    }
-
-    InspectorProtocol.sendCommand("Page.navigate", { "url": "nosuchurl" });
-    InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "alert('alert')" });
-    InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "confirm('confirm')" });
-    InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "prompt('prompt')" }, onDone);
-
-    function onDone()
-    {
-        ProtocolTest.completeTest();
-    }
-}
-
-</script>
-</head>
-<body onload="runTest()">
-</body>
-</html>
index de35cfe..f113db9 100644 (file)
@@ -1470,7 +1470,6 @@ webkit.org/b/122571 inspector/dom/request-child-nodes-depth.html [ Timeout Pass
 webkit.org/b/122571 inspector/dom/focus.html [ Failure Timeout Pass ]
 webkit.org/b/122571 inspector/runtime/getProperties.html [ Timeout Pass Crash ]
 webkit.org/b/122571 inspector/runtime/saveResult.html [ Timeout Pass Crash ]
-webkit.org/b/122571 inspector/page/javascriptDialogEvents.html [ Timeout Pass ]
 webkit.org/b/122571 inspector/page/frameStartedLoading.html [ Timeout Pass ]
 webkit.org/b/122571 inspector/page/frameScheduledNavigation.html [ Timeout Pass Crash ]
 webkit.org/b/122571 inspector/page/setEmulatedMedia.html [ Timeout Pass ]
index 27c2620..6f3faaf 100644 (file)
@@ -620,8 +620,6 @@ webkit.org/b/105777 editing/mac/spelling/autocorrection-in-textarea.html [ Failu
 # Enable when support drag-and-drop autoscrolling
 webkit.org/b/39725 fast/events/drag-and-drop-autoscroll.html [ Skip ]
 
-webkit.org/b/110186 inspector/page/javascriptDialogEvents.html [ Skip ]
-
 # Need support for ResourceHandle::didChangePriority and DRT support
 webkit.org/b/111016 http/tests/loading/promote-img-preload-priority.html [ Failure ]
 
index 43673b0..6ed757c 100644 (file)
@@ -1,3 +1,22 @@
+2016-12-07  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove unused and mostly untested Page domain commands and events
+        https://bugs.webkit.org/show_bug.cgi?id=165507
+
+        Reviewed by Brian Burg.
+
+        Remove unused and unsupported commands and events.
+
+          - Page.setDocumentContent
+          - Page.getScriptExecutionStatus
+          - Page.setScriptExecutionDisabled
+          - Page.handleJavaScriptDialog
+          - Page.javascriptDialogOpening
+          - Page.javascriptDialogClosed
+          - Page.scriptsEnabled
+
+        * inspector/protocol/Page.json:
+
 2016-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [JSC] Merge PromiseReactions
index e00b95b..6d41f13 100644 (file)
             ]
         },
         {
-            "name": "setDocumentContent",
-            "description": "Sets given markup as the document's HTML.",
-            "parameters": [
-                { "name": "frameId", "$ref": "Network.FrameId", "description": "Frame id to set HTML for." },
-                { "name": "html", "type": "string", "description": "HTML content to set."  }
-            ]
-        },
-        {
             "name": "setShowPaintRects",
             "description": "Requests that backend shows paint rectangles",
             "parameters": [
             ]
         },
         {
-            "name": "getScriptExecutionStatus",
-            "description": "Determines if scripts can be executed in the page.",
-            "returns": [
-                { "name": "result", "type": "string", "enum": ["allowed", "disabled", "forbidden"], "description": "Script execution status: \"allowed\" if scripts can be executed, \"disabled\" if script execution has been disabled through page settings, \"forbidden\" if script execution for the given page is not possible for other reasons." }
-            ]
-        },
-        {
-            "name": "setScriptExecutionDisabled",
-            "description": "Switches script execution in the page.",
-            "parameters": [
-                { "name": "value", "type": "boolean", "description": "Whether script execution should be disabled in the page." }
-            ]
-        },
-        {
             "name": "setEmulatedMedia",
             "description": "Emulates the given media for CSS media queries.",
             "parameters": [
             ]
         },
         {
-            "name": "handleJavaScriptDialog",
-            "description": "Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).",
-            "parameters": [
-                { "name": "accept", "type": "boolean", "description": "Whether to accept or dismiss the dialog." },
-                { "name": "promptText", "type": "string", "optional": true, "description": "The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog." }
-            ]
-        },
-        {
             "name": "archive",
             "description": "Grab an archive of the page.",
             "returns": [
             "parameters": [
                 { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has cleared its scheduled navigation." }
             ]
-        },
-        {
-            "name": "javascriptDialogOpening",
-            "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.",
-            "parameters": [
-                { "name": "message", "type": "string", "description": "Message that will be displayed by the dialog." }
-            ]
-        },
-        {
-            "name": "javascriptDialogClosed",
-            "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been closed."
-        },
-        {
-            "name": "scriptsEnabled",
-            "description": "Fired when the JavaScript is enabled/disabled on the page",
-            "parameters": [
-                { "name": "isEnabled", "type": "boolean", "description": "Whether script execution is enabled or disabled on the page." }
-            ]
         }
     ]
 }
index 7430a75..fb54a02 100644 (file)
@@ -1,3 +1,46 @@
+2016-12-07  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove unused and mostly untested Page domain commands and events
+        https://bugs.webkit.org/show_bug.cgi?id=165507
+
+        Reviewed by Brian Burg.
+
+        Remove any code associated with the commands/events being removed.
+
+        * inspector/DOMPatchSupport.cpp:
+        * inspector/DOMPatchSupport.h:
+        * inspector/InspectorClient.h:
+        (WebCore::InspectorClient::handleJavaScriptDialog): Deleted.
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::scriptsEnabledImpl): Deleted.
+        (WebCore::InspectorInstrumentation::willRunJavaScriptDialogImpl): Deleted.
+        (WebCore::InspectorInstrumentation::didRunJavaScriptDialogImpl): Deleted.
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::scriptsEnabled): Deleted.
+        (WebCore::InspectorInstrumentation::willRunJavaScriptDialog): Deleted.
+        (WebCore::InspectorInstrumentation::didRunJavaScriptDialog): Deleted.
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::disable):
+        (WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
+        (WebCore::InspectorPageAgent::didPaint):
+        (WebCore::InspectorPageAgent::buildObjectForFrame):
+        (WebCore::InspectorPageAgent::archive):
+        (WebCore::createXHRTextDecoder): Deleted.
+        (WebCore::InspectorPageAgent::getScriptExecutionStatus): Deleted.
+        (WebCore::InspectorPageAgent::setScriptExecutionDisabled): Deleted.
+        (WebCore::InspectorPageAgent::willRunJavaScriptDialog): Deleted.
+        (WebCore::InspectorPageAgent::didRunJavaScriptDialog): Deleted.
+        (WebCore::InspectorPageAgent::scriptsEnabled): Deleted.
+        (WebCore::InspectorPageAgent::handleJavaScriptDialog): Deleted.
+        * inspector/InspectorPageAgent.h:
+        * page/Chrome.cpp:
+        (WebCore::Chrome::runBeforeUnloadConfirmPanel):
+        (WebCore::Chrome::runJavaScriptAlert):
+        (WebCore::Chrome::runJavaScriptConfirm):
+        (WebCore::Chrome::runJavaScriptPrompt):
+        * page/Settings.cpp:
+        (WebCore::Settings::setScriptEnabled):
+
 2016-12-07  Jer Noble  <jer.noble@apple.com>
 
         [pointer-lock] Cursor should become visible when exiting pointer-lock via ESC key.
index a3ae1d0..6acd8bc 100644 (file)
@@ -64,14 +64,6 @@ struct DOMPatchSupport::Digest {
     Vector<std::unique_ptr<Digest>> children;
 };
 
-void DOMPatchSupport::patchDocument(Document& document, const String& markup)
-{
-    InspectorHistory history;
-    DOMEditor domEditor { history };
-    DOMPatchSupport patchSupport(domEditor, document);
-    patchSupport.patchDocument(markup);
-}
-
 DOMPatchSupport::DOMPatchSupport(DOMEditor& domEditor, Document& document)
     : m_domEditor(domEditor)
     , m_document(document)
index de927ad..d26c6f4 100644 (file)
@@ -43,8 +43,6 @@ class Node;
 
 class DOMPatchSupport final {
 public:
-    static void patchDocument(Document&, const String& markup);
-
     DOMPatchSupport(DOMEditor&, Document&);
 
     void patchDocument(const String& markup);
index 87fd118..4de356c 100644 (file)
@@ -61,8 +61,6 @@ public:
     virtual void didSetSearchingForNode(bool) { }
     virtual void elementSelectionChanged(bool) { }
 
-    virtual bool handleJavaScriptDialog(bool, const String*) { return false; }
-
     WEBCORE_EXPORT static void doDispatchMessageOnFrontendPage(Page* frontendPage, const String& message);
 };
 
index d7cea2e..a3e6ef8 100644 (file)
@@ -434,12 +434,6 @@ void InspectorInstrumentation::didEvaluateScriptImpl(const InspectorInstrumentat
         timelineAgent->didEvaluateScript(frame);
 }
 
-void InspectorInstrumentation::scriptsEnabledImpl(InstrumentingAgents& instrumentingAgents, bool isEnabled)
-{
-    if (InspectorPageAgent* pageAgent = instrumentingAgents.inspectorPageAgent())
-        pageAgent->scriptsEnabled(isEnabled);
-}
-
 InspectorInstrumentationCookie InspectorInstrumentation::willFireTimerImpl(InstrumentingAgents& instrumentingAgents, int timerId, ScriptExecutionContext& context)
 {
     pauseOnNativeEventIfNeeded(instrumentingAgents, false, timerFiredEventName, false);
@@ -846,19 +840,6 @@ void InspectorInstrumentation::frameClearedScheduledNavigationImpl(Instrumenting
         inspectorPageAgent->frameClearedScheduledNavigation(frame);
 }
 
-InspectorInstrumentationCookie InspectorInstrumentation::willRunJavaScriptDialogImpl(InstrumentingAgents& instrumentingAgents, const String& message)
-{
-    if (InspectorPageAgent* inspectorPageAgent = instrumentingAgents.inspectorPageAgent())
-        inspectorPageAgent->willRunJavaScriptDialog(message);
-    return InspectorInstrumentationCookie(instrumentingAgents, 0);
-}
-
-void InspectorInstrumentation::didRunJavaScriptDialogImpl(const InspectorInstrumentationCookie& cookie)
-{
-    if (InspectorPageAgent* inspectorPageAgent = cookie.instrumentingAgents()->inspectorPageAgent())
-        inspectorPageAgent->didRunJavaScriptDialog();
-}
-
 void InspectorInstrumentation::willDestroyCachedResourceImpl(CachedResource& cachedResource)
 {
     if (!s_instrumentingAgentsSet)
index 490fe93..afbcf4f 100644 (file)
@@ -134,7 +134,6 @@ public:
     static void didDispatchEventOnWindow(const InspectorInstrumentationCookie&);
     static InspectorInstrumentationCookie willEvaluateScript(Frame&, const String& url, int lineNumber);
     static void didEvaluateScript(const InspectorInstrumentationCookie&, Frame&);
-    static void scriptsEnabled(Page&, bool isEnabled);
     static InspectorInstrumentationCookie willFireTimer(ScriptExecutionContext&, int timerId);
     static void didFireTimer(const InspectorInstrumentationCookie&);
     static void didInvalidateLayout(Frame&);
@@ -179,8 +178,6 @@ public:
     static void frameStoppedLoading(Frame&);
     static void frameScheduledNavigation(Frame&, double delay);
     static void frameClearedScheduledNavigation(Frame&);
-    static InspectorInstrumentationCookie willRunJavaScriptDialog(Page&, const String& message);
-    static void didRunJavaScriptDialog(const InspectorInstrumentationCookie&);
     static void willDestroyCachedResource(CachedResource&);
 
     static void addMessageToConsole(Page&, std::unique_ptr<Inspector::ConsoleMessage>);
@@ -307,7 +304,6 @@ private:
     static void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie&);
     static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents&, Frame&, const String& url, int lineNumber);
     static void didEvaluateScriptImpl(const InspectorInstrumentationCookie&, Frame&);
-    static void scriptsEnabledImpl(InstrumentingAgents&, bool isEnabled);
     static InspectorInstrumentationCookie willFireTimerImpl(InstrumentingAgents&, int timerId, ScriptExecutionContext&);
     static void didFireTimerImpl(const InspectorInstrumentationCookie&);
     static void didInvalidateLayoutImpl(InstrumentingAgents&, Frame&);
@@ -353,8 +349,6 @@ private:
     static void frameStoppedLoadingImpl(InstrumentingAgents&, Frame&);
     static void frameScheduledNavigationImpl(InstrumentingAgents&, Frame&, double delay);
     static void frameClearedScheduledNavigationImpl(InstrumentingAgents&, Frame&);
-    static InspectorInstrumentationCookie willRunJavaScriptDialogImpl(InstrumentingAgents&, const String& message);
-    static void didRunJavaScriptDialogImpl(const InspectorInstrumentationCookie&);
     static void willDestroyCachedResourceImpl(CachedResource&);
 
     static void addMessageToConsoleImpl(InstrumentingAgents&, std::unique_ptr<Inspector::ConsoleMessage>);
@@ -733,12 +727,6 @@ inline void InspectorInstrumentation::didEvaluateScript(const InspectorInstrumen
         didEvaluateScriptImpl(cookie, frame);
 }
 
-inline void InspectorInstrumentation::scriptsEnabled(Page& page, bool isEnabled)
-{
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    return scriptsEnabledImpl(instrumentingAgentsForPage(page), isEnabled);
-}
-
 inline InspectorInstrumentationCookie InspectorInstrumentation::willFireTimer(ScriptExecutionContext& context, int timerId)
 {
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
@@ -1014,19 +1002,6 @@ inline void InspectorInstrumentation::frameClearedScheduledNavigation(Frame& fra
         frameClearedScheduledNavigationImpl(*instrumentingAgents, frame);
 }
 
-inline InspectorInstrumentationCookie InspectorInstrumentation::willRunJavaScriptDialog(Page& page, const String& message)
-{
-    FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
-    return willRunJavaScriptDialogImpl(instrumentingAgentsForPage(page), message);
-}
-
-inline void InspectorInstrumentation::didRunJavaScriptDialog(const InspectorInstrumentationCookie& cookie)
-{
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.isValid())
-        didRunJavaScriptDialogImpl(cookie);
-}
-
 inline void InspectorInstrumentation::willDestroyCachedResource(CachedResource& cachedResource)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
index 05d2b8b..248d63a 100644 (file)
@@ -40,7 +40,6 @@
 #include "CachedScript.h"
 #include "Cookie.h"
 #include "CookieJar.h"
-#include "DOMPatchSupport.h"
 #include "DOMWrapperWorld.h"
 #include "Document.h"
 #include "DocumentLoader.h"
@@ -373,8 +372,6 @@ void InspectorPageAgent::enable(ErrorString&)
     auto stopwatch = m_environment.executionStopwatch();
     stopwatch->reset();
     stopwatch->start();
-
-    m_originalScriptExecutionDisabled = !mainFrame().settings().isScriptEnabled();
 }
 
 void InspectorPageAgent::disable(ErrorString&)
@@ -384,7 +381,6 @@ void InspectorPageAgent::disable(ErrorString&)
     m_instrumentingAgents.setInspectorPageAgent(nullptr);
 
     ErrorString unused;
-    setScriptExecutionDisabled(unused, m_originalScriptExecutionDisabled);
     setShowPaintRects(unused, false);
     setEmulatedMedia(unused, emptyString());
 }
@@ -656,20 +652,6 @@ void InspectorPageAgent::searchInResources(ErrorString&, const String& text, con
         networkAgent->searchOtherRequests(regex, result);
 }
 
-void InspectorPageAgent::setDocumentContent(ErrorString& errorString, const String& frameId, const String& html)
-{
-    Frame* frame = assertFrame(errorString, frameId);
-    if (!frame)
-        return;
-
-    Document* document = frame->document();
-    if (!document) {
-        errorString = ASCIILiteral("No Document instance to set HTML for");
-        return;
-    }
-    DOMPatchSupport::patchDocument(*document, html);
-}
-
 void InspectorPageAgent::setShowPaintRects(ErrorString&, bool show)
 {
     m_showPaintRects = show;
@@ -681,31 +663,6 @@ void InspectorPageAgent::setShowPaintRects(ErrorString&, bool show)
     m_overlay->setShowingPaintRects(show);
 }
 
-void InspectorPageAgent::getScriptExecutionStatus(ErrorString&, Inspector::PageBackendDispatcherHandler::Result* status)
-{
-    bool disabledByScriptController = false;
-    bool disabledInSettings = false;
-    disabledByScriptController = mainFrame().script().canExecuteScripts(NotAboutToExecuteScript);
-    disabledInSettings = !mainFrame().settings().isScriptEnabled();
-
-    if (!disabledByScriptController) {
-        *status = Inspector::PageBackendDispatcherHandler::Result::Allowed;
-        return;
-    }
-
-    if (disabledInSettings)
-        *status = Inspector::PageBackendDispatcherHandler::Result::Disabled;
-    else
-        *status = Inspector::PageBackendDispatcherHandler::Result::Forbidden;
-}
-
-void InspectorPageAgent::setScriptExecutionDisabled(ErrorString&, bool value)
-{
-    m_ignoreScriptsEnabledNotification = true;
-    mainFrame().settings().setScriptEnabled(!value);
-    m_ignoreScriptsEnabledNotification = false;
-}
-
 void InspectorPageAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld& world)
 {
     if (&world != &mainThreadNormalWorld())
@@ -846,16 +803,6 @@ void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame)
     m_frontendDispatcher->frameClearedScheduledNavigation(frameId(&frame));
 }
 
-void InspectorPageAgent::willRunJavaScriptDialog(const String& message)
-{
-    m_frontendDispatcher->javascriptDialogOpening(message);
-}
-
-void InspectorPageAgent::didRunJavaScriptDialog()
-{
-    m_frontendDispatcher->javascriptDialogClosed();
-}
-
 void InspectorPageAgent::didPaint(RenderObject& renderer, const LayoutRect& rect)
 {
     if (!m_enabled || !m_showPaintRects)
@@ -902,14 +849,6 @@ void InspectorPageAgent::didRecalculateStyle()
         m_overlay->update();
 }
 
-void InspectorPageAgent::scriptsEnabled(bool isEnabled)
-{
-    if (m_ignoreScriptsEnabledNotification)
-        return;
-
-    m_frontendDispatcher->scriptsEnabled(isEnabled);
-}
-
 Ref<Inspector::Protocol::Page::Frame> InspectorPageAgent::buildObjectForFrame(Frame* frame)
 {
     ASSERT_ARG(frame, frame);
@@ -1042,12 +981,6 @@ void InspectorPageAgent::snapshotRect(ErrorString& errorString, int x, int y, in
     *outDataURL = snapshot->toDataURL(ASCIILiteral("image/png"));
 }
 
-void InspectorPageAgent::handleJavaScriptDialog(ErrorString& errorString, bool accept, const String* promptText)
-{
-    if (!m_client->handleJavaScriptDialog(accept, promptText))
-        errorString = ASCIILiteral("Could not handle JavaScript dialog");
-}
-
 void InspectorPageAgent::archive(ErrorString& errorString, String* data)
 {
 #if ENABLE(WEB_ARCHIVE) && USE(CF)
index 564203a..506c462 100644 (file)
@@ -98,16 +98,12 @@ public:
     void getResourceContent(ErrorString&, const String& frameId, const String& url, String* content, bool* base64Encoded) override;
     void searchInResource(ErrorString&, const String& frameId, const String& url, const String& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, const String* optionalRequestId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>&) override;
     void searchInResources(ErrorString&, const String&, const bool* caseSensitive, const bool* isRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Page::SearchResult>>&) override;
-    void setDocumentContent(ErrorString&, const String& frameId, const String& html) override;
     void setShowPaintRects(ErrorString&, bool show) override;
-    void getScriptExecutionStatus(ErrorString&, Inspector::PageBackendDispatcherHandler::Result*) override;
-    void setScriptExecutionDisabled(ErrorString&, bool) override;
     void setEmulatedMedia(ErrorString&, const String&) override;
     void getCompositingBordersVisible(ErrorString&, bool* out_param) override;
     void setCompositingBordersVisible(ErrorString&, bool) override;
     void snapshotNode(ErrorString&, int nodeId, String* outDataURL) override;
     void snapshotRect(ErrorString&, int x, int y, int width, int height, const String& coordinateSystem, String* outDataURL) override;
-    void handleJavaScriptDialog(ErrorString&, bool accept, const String* promptText) override;
     void archive(ErrorString&, String* data) override;
 
     // InspectorInstrumentation
@@ -121,14 +117,11 @@ public:
     void frameStoppedLoading(Frame&);
     void frameScheduledNavigation(Frame&, double delay);
     void frameClearedScheduledNavigation(Frame&);
-    void willRunJavaScriptDialog(const String& message);
-    void didRunJavaScriptDialog();
     void applyEmulatedMedia(String&);
     void didPaint(RenderObject&, const LayoutRect&);
     void didLayout();
     void didScroll();
     void didRecalculateStyle();
-    void scriptsEnabled(bool isEnabled);
 
     // Inspector Controller API
     void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
@@ -137,7 +130,6 @@ public:
     // Cross-agents API
     Page& page() { return m_page; }
     MainFrame& mainFrame();
-    String createIdentifier();
     Frame* frameForId(const String& frameId);
     WEBCORE_EXPORT String frameId(Frame*);
     bool hasIdForFrame(Frame*) const;
@@ -170,8 +162,6 @@ private:
     HashMap<DocumentLoader*, String> m_loaderToIdentifier;
     bool m_enabled { false };
     bool m_isFirstLayoutAfterOnLoad { false };
-    bool m_originalScriptExecutionDisabled { false };
-    bool m_ignoreScriptsEnabledNotification { false };
     bool m_showPaintRects { false };
     String m_emulatedMedia;
     RefPtr<Inspector::InspectorObject> m_scriptsToEvaluateOnLoad;
index d9eac00..5c02544 100644 (file)
@@ -50,7 +50,6 @@
 #include "WindowFeatures.h"
 #include <runtime/VM.h>
 #include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
 #include <wtf/SetForScope.h>
 #include <wtf/Vector.h>
 
@@ -284,10 +283,7 @@ bool Chrome::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
     // otherwise cause the load to continue while we're in the middle of executing JavaScript.
     PageGroupLoadDeferrer deferrer(m_page, true);
 
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJavaScriptDialog(m_page, message);
-    bool ok = m_client.runBeforeUnloadConfirmPanel(message, frame);
-    InspectorInstrumentation::didRunJavaScriptDialog(cookie);
-    return ok;
+    return m_client.runBeforeUnloadConfirmPanel(message, frame);
 }
 
 void Chrome::closeWindowSoon()
@@ -305,9 +301,7 @@ void Chrome::runJavaScriptAlert(Frame* frame, const String& message)
     notifyPopupOpeningObservers();
     String displayMessage = frame->displayStringModifiedByEncoding(message);
 
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJavaScriptDialog(m_page, displayMessage);
     m_client.runJavaScriptAlert(frame, displayMessage);
-    InspectorInstrumentation::didRunJavaScriptDialog(cookie);
 }
 
 bool Chrome::runJavaScriptConfirm(Frame* frame, const String& message)
@@ -320,10 +314,7 @@ bool Chrome::runJavaScriptConfirm(Frame* frame, const String& message)
     notifyPopupOpeningObservers();
     String displayMessage = frame->displayStringModifiedByEncoding(message);
 
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJavaScriptDialog(m_page, displayMessage);
-    bool ok = m_client.runJavaScriptConfirm(frame, displayMessage);
-    InspectorInstrumentation::didRunJavaScriptDialog(cookie);
-    return ok;
+    return m_client.runJavaScriptConfirm(frame, displayMessage);
 }
 
 bool Chrome::runJavaScriptPrompt(Frame* frame, const String& prompt, const String& defaultValue, String& result)
@@ -336,10 +327,7 @@ bool Chrome::runJavaScriptPrompt(Frame* frame, const String& prompt, const Strin
     notifyPopupOpeningObservers();
     String displayPrompt = frame->displayStringModifiedByEncoding(prompt);
 
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJavaScriptDialog(m_page, displayPrompt);
     bool ok = m_client.runJavaScriptPrompt(frame, displayPrompt, frame->displayStringModifiedByEncoding(defaultValue), result);
-    InspectorInstrumentation::didRunJavaScriptDialog(cookie);
-
     if (ok)
         result = frame->displayStringModifiedByEncoding(result);
 
index 49175fb..1dd02d4 100644 (file)
@@ -39,7 +39,6 @@
 #include "FrameView.h"
 #include "HTMLMediaElement.h"
 #include "HistoryItem.h"
-#include "InspectorInstrumentation.h"
 #include "MainFrame.h"
 #include "Page.h"
 #include "PageCache.h"
@@ -389,7 +388,6 @@ void Settings::setScriptEnabled(bool isScriptEnabled)
 #if PLATFORM(IOS)
     m_page->setNeedsRecalcStyleInAllFrames();
 #endif
-    InspectorInstrumentation::scriptsEnabled(*m_page, m_isScriptEnabled);
 }
 
 void Settings::setJavaEnabled(bool isJavaEnabled)
index b48c3b5..4f05b62 100644 (file)
@@ -1,3 +1,29 @@
+2016-12-07  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove unused and mostly untested Page domain commands and events
+        https://bugs.webkit.org/show_bug.cgi?id=165507
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Protocol/PageObserver.js:
+        (WebInspector.PageObserver.prototype.javascriptDialogOpening):
+        (WebInspector.PageObserver.prototype.javascriptDialogClosed):
+        (WebInspector.PageObserver.prototype.scriptsEnabled):
+        Keep stub in case legacy backends dispatch the event to the frontend.
+
+        * UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
+        * UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js:
+        * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
+        * UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
+        * UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
+        * Versions/Inspector-iOS-10.0.json:
+        * Versions/Inspector-iOS-7.0.json:
+        * Versions/Inspector-iOS-8.0.json:
+        * Versions/Inspector-iOS-9.0.json:
+        * Versions/Inspector-iOS-9.3.json:
+        Remove handleJavaScriptDialog command from legacy backends because it
+        doesn't appear as if the iOS backend handled it at all.
+
 2016-12-06  Alexey Proskuryakov  <ap@apple.com>
 
         Correct SDKROOT values in xcconfig files
index 902bf6c..2a6da81 100644 (file)
@@ -338,7 +338,6 @@ InspectorBackend.registerCommand("Page.getCompositingBordersVisible", [], ["resu
 InspectorBackend.registerCommand("Page.setCompositingBordersVisible", [{"name": "visible", "type": "boolean", "optional": false}], []);
 InspectorBackend.registerCommand("Page.snapshotNode", [{"name": "nodeId", "type": "number", "optional": false}], ["dataURL"]);
 InspectorBackend.registerCommand("Page.snapshotRect", [{"name": "x", "type": "number", "optional": false}, {"name": "y", "type": "number", "optional": false}, {"name": "width", "type": "number", "optional": false}, {"name": "height", "type": "number", "optional": false}, {"name": "coordinateSystem", "type": "string", "optional": false}], ["dataURL"]);
-InspectorBackend.registerCommand("Page.handleJavaScriptDialog", [{"name": "accept", "type": "boolean", "optional": false}, {"name": "promptText", "type": "string", "optional": true}], []);
 InspectorBackend.registerCommand("Page.archive", [], ["data"]);
 InspectorBackend.activateDomain("Page", "web");
 
index 571662c..f55c974 100644 (file)
@@ -70,7 +70,6 @@ InspectorBackend.registerCommand("Page.setScriptExecutionDisabled", [{"name": "v
 InspectorBackend.registerCommand("Page.setEmulatedMedia", [{"name": "media", "type": "string", "optional": false}], []);
 InspectorBackend.registerCommand("Page.getCompositingBordersVisible", [], ["result"]);
 InspectorBackend.registerCommand("Page.setCompositingBordersVisible", [{"name": "visible", "type": "boolean", "optional": false}], []);
-InspectorBackend.registerCommand("Page.handleJavaScriptDialog", [{"name": "accept", "type": "boolean", "optional": false}, {"name": "promptText", "type": "string", "optional": true}], []);
 InspectorBackend.activateDomain("Page");
 
 // Runtime.
index 1083250..5e4d78c 100644 (file)
@@ -328,7 +328,6 @@ InspectorBackend.registerCommand("Page.getCompositingBordersVisible", [], ["resu
 InspectorBackend.registerCommand("Page.setCompositingBordersVisible", [{"name": "visible", "type": "boolean", "optional": false}], []);
 InspectorBackend.registerCommand("Page.snapshotNode", [{"name": "nodeId", "type": "number", "optional": false}], ["dataURL"]);
 InspectorBackend.registerCommand("Page.snapshotRect", [{"name": "x", "type": "number", "optional": false}, {"name": "y", "type": "number", "optional": false}, {"name": "width", "type": "number", "optional": false}, {"name": "height", "type": "number", "optional": false}, {"name": "coordinateSystem", "type": "string", "optional": false}], ["dataURL"]);
-InspectorBackend.registerCommand("Page.handleJavaScriptDialog", [{"name": "accept", "type": "boolean", "optional": false}, {"name": "promptText", "type": "string", "optional": true}], []);
 InspectorBackend.registerCommand("Page.archive", [], ["data"]);
 InspectorBackend.activateDomain("Page", "web");
 
index 283cce1..4796124 100644 (file)
@@ -298,7 +298,6 @@ InspectorBackend.registerCommand("Page.getCompositingBordersVisible", [], ["resu
 InspectorBackend.registerCommand("Page.setCompositingBordersVisible", [{"name": "visible", "type": "boolean", "optional": false}], []);
 InspectorBackend.registerCommand("Page.snapshotNode", [{"name": "nodeId", "type": "number", "optional": false}], ["dataURL"]);
 InspectorBackend.registerCommand("Page.snapshotRect", [{"name": "x", "type": "number", "optional": false}, {"name": "y", "type": "number", "optional": false}, {"name": "width", "type": "number", "optional": false}, {"name": "height", "type": "number", "optional": false}, {"name": "coordinateSystem", "type": "string", "optional": false}], ["dataURL"]);
-InspectorBackend.registerCommand("Page.handleJavaScriptDialog", [{"name": "accept", "type": "boolean", "optional": false}, {"name": "promptText", "type": "string", "optional": true}], []);
 InspectorBackend.registerCommand("Page.archive", [], ["data"]);
 InspectorBackend.activateDomain("Page", "web");
 
index 4cd679a..00af666 100644 (file)
@@ -309,7 +309,6 @@ InspectorBackend.registerCommand("Page.getCompositingBordersVisible", [], ["resu
 InspectorBackend.registerCommand("Page.setCompositingBordersVisible", [{"name": "visible", "type": "boolean", "optional": false}], []);
 InspectorBackend.registerCommand("Page.snapshotNode", [{"name": "nodeId", "type": "number", "optional": false}], ["dataURL"]);
 InspectorBackend.registerCommand("Page.snapshotRect", [{"name": "x", "type": "number", "optional": false}, {"name": "y", "type": "number", "optional": false}, {"name": "width", "type": "number", "optional": false}, {"name": "height", "type": "number", "optional": false}, {"name": "coordinateSystem", "type": "string", "optional": false}], ["dataURL"]);
-InspectorBackend.registerCommand("Page.handleJavaScriptDialog", [{"name": "accept", "type": "boolean", "optional": false}, {"name": "promptText", "type": "string", "optional": true}], []);
 InspectorBackend.registerCommand("Page.archive", [], ["data"]);
 InspectorBackend.activateDomain("Page", "web");
 
index 981972d..c136e53 100644 (file)
@@ -69,16 +69,16 @@ WebInspector.PageObserver = class PageObserver
 
     javascriptDialogOpening(message)
     {
-        // Not handled yet.
+        // COMPATIBILITY (iOS 10): Page.javascriptDialogOpening was removed after iOS 10.
     }
 
     javascriptDialogClosed()
     {
-        // Not handled yet.
+        // COMPATIBILITY (iOS 10): Page.javascriptDialogClosed was removed after iOS 10.
     }
 
     scriptsEnabled(enabled)
     {
-        // Not handled yet.
+        // COMPATIBILITY (iOS 10): Page.scriptsEnabled was removed after iOS 10.
     }
 };
index 76499fa..d90885f 100644 (file)
             ]
         },
         {
-            "name": "handleJavaScriptDialog",
-            "description": "Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).",
-            "parameters": [
-                { "name": "accept", "type": "boolean", "description": "Whether to accept or dismiss the dialog." },
-                { "name": "promptText", "type": "string", "optional": true, "description": "The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog." }
-            ]
-        },
-        {
             "name": "archive",
             "description": "Grab an archive of the page.",
             "returns": [
index 3980d29..dbf6e5a 100644 (file)
                 "parameters": [
                     { "name": "visible", "type": "boolean", "description": "True for showing compositing borders." }
                 ]
-            },
-            {
-                "name": "handleJavaScriptDialog",
-                "description": "Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).",
-                "parameters": [
-                    { "name": "accept", "type": "boolean", "description": "Whether to accept or dismiss the dialog." },
-                    { "name": "promptText", "type": "string", "optional": true, "description": "The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog." }
-                ]
             }
         ],
         "events": [
index ff7eb7c..f787559 100644 (file)
             ]
         },
         {
-            "name": "handleJavaScriptDialog",
-            "description": "Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).",
-            "parameters": [
-                { "name": "accept", "type": "boolean", "description": "Whether to accept or dismiss the dialog." },
-                { "name": "promptText", "type": "string", "optional": true, "description": "The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog." }
-            ]
-        },
-        {
             "name": "archive",
             "description": "Grab an archive of the page.",
             "returns": [
index bac6095..be40adc 100644 (file)
             ]
         },
         {
-            "name": "handleJavaScriptDialog",
-            "description": "Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).",
-            "parameters": [
-                { "name": "accept", "type": "boolean", "description": "Whether to accept or dismiss the dialog." },
-                { "name": "promptText", "type": "string", "optional": true, "description": "The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog." }
-            ]
-        },
-        {
             "name": "archive",
             "description": "Grab an archive of the page.",
             "returns": [
index 4f6e4f3..d13ee80 100644 (file)
             ]
         },
         {
-            "name": "handleJavaScriptDialog",
-            "description": "Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).",
-            "parameters": [
-                { "name": "accept", "type": "boolean", "description": "Whether to accept or dismiss the dialog." },
-                { "name": "promptText", "type": "string", "optional": true, "description": "The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog." }
-            ]
-        },
-        {
             "name": "archive",
             "description": "Grab an archive of the page.",
             "returns": [