Title: [161380] trunk
Revision
161380
Author
[email protected]
Date
2014-01-06 15:35:52 -0800 (Mon, 06 Jan 2014)

Log Message

Web Inspector: Get rid of DOM.setFileInputFiles from Protocol
https://bugs.webkit.org/show_bug.cgi?id=126312

Reviewed by Joseph Pecoraro.

Source/WebCore:

No new tests, No changes in behavior.

It is a dead code as all ports in WebKit don't support it.
And this patch removes all things related to DOM.setFileInputFiles in Frontend.

* inspector/InspectorClient.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::InspectorDOMAgent):
* inspector/InspectorDOMAgent.h:
(WebCore::InspectorDOMAgent::create):
* inspector/protocol/DOM.json:

Source/WebInspectorUI:

Update InspectorWebBackendCommands.js after removing DOM.setFileInputFiles.

* UserInterface/InspectorWebBackendCommands.js:

LayoutTests:

* inspector-protocol/dom/setFileInputFiles-expected.txt: Removed.
* inspector-protocol/dom/setFileInputFiles.html: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (161379 => 161380)


--- trunk/LayoutTests/ChangeLog	2014-01-06 23:28:15 UTC (rev 161379)
+++ trunk/LayoutTests/ChangeLog	2014-01-06 23:35:52 UTC (rev 161380)
@@ -1,3 +1,13 @@
+2014-01-06  Seokju Kwon  <[email protected]>
+
+        Web Inspector: Get rid of DOM.setFileInputFiles from Protocol
+        https://bugs.webkit.org/show_bug.cgi?id=126312
+
+        Reviewed by Joseph Pecoraro.
+
+        * inspector-protocol/dom/setFileInputFiles-expected.txt: Removed.
+        * inspector-protocol/dom/setFileInputFiles.html: Removed.
+
 2014-01-06  Brent Fulgham  <[email protected]>
 
         Unreviewed test update after r161375.

Deleted: trunk/LayoutTests/inspector-protocol/dom/setFileInputFiles-expected.txt (161379 => 161380)


--- trunk/LayoutTests/inspector-protocol/dom/setFileInputFiles-expected.txt	2014-01-06 23:28:15 UTC (rev 161379)
+++ trunk/LayoutTests/inspector-protocol/dom/setFileInputFiles-expected.txt	2014-01-06 23:35:52 UTC (rev 161380)
@@ -1,4 +0,0 @@
- 
-Received error: Cannot set file input files
-Received error: Cannot set file input files
-

Deleted: trunk/LayoutTests/inspector-protocol/dom/setFileInputFiles.html (161379 => 161380)


--- trunk/LayoutTests/inspector-protocol/dom/setFileInputFiles.html	2014-01-06 23:28:15 UTC (rev 161379)
+++ trunk/LayoutTests/inspector-protocol/dom/setFileInputFiles.html	2014-01-06 23:35:52 UTC (rev 161380)
@@ -1,69 +0,0 @@
-<html>
-<head>
-<script type="text/_javascript_" src=""
-<script>
-
-function onLoad()
-{
-    document.querySelector("input").addEventListener("change", onChange);
-
-    function onChange(event)
-    {
-        var files = event.target.files;
-        log("File count: " + files.length);
-        for (var i = 0; i < files.length; i++) {
-            log("Name: " + files[i].name);
-        }
-    }
-
-    runTest();
-}
-
-function test()
-{
-    function abortOnError(message)
-    {
-        if (message.error) {
-            InspectorTest.log(message.error.message);
-            InspectorTest.completeTest();
-        }
-    }
-
-    InspectorTest.sendCommand("DOM.getDocument", {}, onGotDocument);
-
-    function onGotDocument(message)
-    {
-        abortOnError(message);
-        var node = message.result.root;
-        InspectorTest.sendCommand("DOM.querySelectorAll", { "nodeId": node.nodeId, "selector": "input" }, onQuerySelectorAll);
-    }
-
-    function onQuerySelectorAll(message)
-    {
-        abortOnError(message);
-        var ids = message.result.nodeIds;
-        InspectorTest.sendCommand("DOM.setFileInputFiles", { "nodeId": ids[0], "files": ["file1", "file2"] }, onSetFiles);
-        InspectorTest.sendCommand("DOM.setFileInputFiles", { "nodeId": ids[1], "files": ["file1", "file2"] }, onBadSetFiles);
-    }
-
-    function onSetFiles(message)
-    {
-        if (message.error) {
-            InspectorTest.log("Received error: " + message.error.message);
-        }
-    }
-
-    function onBadSetFiles(message)
-    {
-        InspectorTest.log("Received error: " + message.error.message);
-        InspectorTest.completeTest();
-    }
-}
-
-</script>
-</head>
-<body _onload_="onLoad()">
-<input type="file"></input>
-<input type="text"></input>
-</body>
-</html>

Modified: trunk/Source/WebCore/ChangeLog (161379 => 161380)


--- trunk/Source/WebCore/ChangeLog	2014-01-06 23:28:15 UTC (rev 161379)
+++ trunk/Source/WebCore/ChangeLog	2014-01-06 23:35:52 UTC (rev 161380)
@@ -1,3 +1,24 @@
+2014-01-06  Seokju Kwon  <[email protected]>
+
+        Web Inspector: Get rid of DOM.setFileInputFiles from Protocol
+        https://bugs.webkit.org/show_bug.cgi?id=126312
+
+        Reviewed by Joseph Pecoraro.
+
+        No new tests, No changes in behavior.
+
+        It is a dead code as all ports in WebKit don't support it.
+        And this patch removes all things related to DOM.setFileInputFiles in Frontend.
+
+        * inspector/InspectorClient.h:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::InspectorDOMAgent):
+        * inspector/InspectorDOMAgent.h:
+        (WebCore::InspectorDOMAgent::create):
+        * inspector/protocol/DOM.json:
+
 2014-01-06  Brent Fulgham  <[email protected]>
 
         [WebGL] Revise String Concatenation (Follow-up to r161247)

Modified: trunk/Source/WebCore/inspector/InspectorClient.h (161379 => 161380)


--- trunk/Source/WebCore/inspector/InspectorClient.h	2014-01-06 23:28:15 UTC (rev 161379)
+++ trunk/Source/WebCore/inspector/InspectorClient.h	2014-01-06 23:35:52 UTC (rev 161380)
@@ -95,8 +95,6 @@
 
     virtual bool handleJavaScriptDialog(bool, const String*) { return false; }
 
-    virtual bool canSetFileInputFiles() { return false; }
-
     static bool doDispatchMessageOnFrontendPage(Page* frontendPage, const String& message);
 };
 

Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (161379 => 161380)


--- trunk/Source/WebCore/inspector/InspectorController.cpp	2014-01-06 23:28:15 UTC (rev 161379)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp	2014-01-06 23:35:52 UTC (rev 161380)
@@ -101,7 +101,7 @@
     m_pageAgent = pageAgentPtr.get();
     m_agents.append(pageAgentPtr.release());
 
-    OwnPtr<InspectorDOMAgent> domAgentPtr(InspectorDOMAgent::create(m_instrumentingAgents.get(), pageAgent, m_injectedScriptManager.get(), m_overlay.get(), inspectorClient));
+    OwnPtr<InspectorDOMAgent> domAgentPtr(InspectorDOMAgent::create(m_instrumentingAgents.get(), pageAgent, m_injectedScriptManager.get(), m_overlay.get()));
     m_domAgent = domAgentPtr.get();
     m_agents.append(domAgentPtr.release());
 

Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (161379 => 161380)


--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2014-01-06 23:28:15 UTC (rev 161379)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2014-01-06 23:35:52 UTC (rev 161380)
@@ -57,18 +57,14 @@
 #include "EventListener.h"
 #include "EventNames.h"
 #include "EventTarget.h"
-#include "File.h"
-#include "FileList.h"
 #include "FrameTree.h"
 #include "HTMLElement.h"
 #include "HTMLFrameOwnerElement.h"
-#include "HTMLInputElement.h"
 #include "HTMLNames.h"
 #include "HTMLTemplateElement.h"
 #include "HitTestResult.h"
 #include "IdentifiersFactory.h"
 #include "InjectedScriptManager.h"
-#include "InspectorClient.h"
 #include "InspectorHistory.h"
 #include "InspectorNodeFinder.h"
 #include "InspectorOverlay.h"
@@ -213,12 +209,11 @@
     return "";
 }
 
-InspectorDOMAgent::InspectorDOMAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay, InspectorClient* client)
+InspectorDOMAgent::InspectorDOMAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay)
     : InspectorAgentBase(ASCIILiteral("DOM"), instrumentingAgents)
     , m_pageAgent(pageAgent)
     , m_injectedScriptManager(injectedScriptManager)
     , m_overlay(overlay)
-    , m_client(client)
     , m_domListener(0)
     , m_lastNodeId(1)
     , m_lastBackendNodeId(-1)
@@ -1188,34 +1183,6 @@
     element->focus();
 }
 
-void InspectorDOMAgent::setFileInputFiles(ErrorString* errorString, int nodeId, const RefPtr<InspectorArray>& files)
-{
-    if (!m_client->canSetFileInputFiles()) {
-        *errorString = "Cannot set file input files";
-        return;
-    }
-
-    Node* node = assertNode(errorString, nodeId);
-    if (!node)
-        return;
-    HTMLInputElement* element = node->toInputElement();
-    if (!element || !element->isFileUpload()) {
-        *errorString = "Node is not a file input element";
-        return;
-    }
-
-    RefPtr<FileList> fileList = FileList::create();
-    for (InspectorArray::const_iterator iter = files->begin(); iter != files->end(); ++iter) {
-        String path;
-        if (!(*iter)->asString(&path)) {
-            *errorString = "Files must be strings";
-            return;
-        }
-        fileList->append(File::create(path));
-    }
-    element->setFiles(fileList);
-}
-
 void InspectorDOMAgent::resolveNode(ErrorString* errorString, int nodeId, const String* const objectGroup, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result)
 {
     String objectGroupName = objectGroup ? *objectGroup : "";

Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.h (161379 => 161380)


--- trunk/Source/WebCore/inspector/InspectorDOMAgent.h	2014-01-06 23:28:15 UTC (rev 161379)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.h	2014-01-06 23:35:52 UTC (rev 161380)
@@ -61,7 +61,6 @@
 class Document;
 class Element;
 class Event;
-class InspectorClient;
 class InspectorHistory;
 class InspectorOverlay;
 class InspectorPageAgent;
@@ -105,9 +104,9 @@
         virtual void didModifyDOMAttr(Element*) = 0;
     };
 
-    static PassOwnPtr<InspectorDOMAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay, InspectorClient* client)
+    static PassOwnPtr<InspectorDOMAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay)
     {
-        return adoptPtr(new InspectorDOMAgent(instrumentingAgents, pageAgent, injectedScriptManager, overlay, client));
+        return adoptPtr(new InspectorDOMAgent(instrumentingAgents, pageAgent, injectedScriptManager, overlay));
     }
 
     static String toErrorString(const ExceptionCode&);
@@ -155,7 +154,6 @@
     virtual void redo(ErrorString*);
     virtual void markUndoableState(ErrorString*);
     virtual void focus(ErrorString*, int nodeId);
-    virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr<Inspector::InspectorArray>& files);
 
     void getEventListeners(Node*, Vector<EventListenerInfo>& listenersArray, bool includeAncestors);
 
@@ -215,7 +213,7 @@
     InspectorPageAgent* pageAgent() { return m_pageAgent; }
 
 private:
-    InspectorDOMAgent(InstrumentingAgents*, InspectorPageAgent*, InjectedScriptManager*, InspectorOverlay*, InspectorClient*);
+    InspectorDOMAgent(InstrumentingAgents*, InspectorPageAgent*, InjectedScriptManager*, InspectorOverlay*);
 
     void setSearchingForNode(ErrorString*, bool enabled, Inspector::InspectorObject* highlightConfig);
     PassOwnPtr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString*, Inspector::InspectorObject* highlightInspectorObject);
@@ -250,7 +248,6 @@
     InspectorPageAgent* m_pageAgent;
     InjectedScriptManager* m_injectedScriptManager;
     InspectorOverlay* m_overlay;
-    InspectorClient* m_client;
     std::unique_ptr<Inspector::InspectorDOMFrontendDispatcher> m_frontendDispatcher;
     RefPtr<Inspector::InspectorDOMBackendDispatcher> m_backendDispatcher;
     DOMListener* m_domListener;

Modified: trunk/Source/WebCore/inspector/protocol/DOM.json (161379 => 161380)


--- trunk/Source/WebCore/inspector/protocol/DOM.json	2014-01-06 23:28:15 UTC (rev 161379)
+++ trunk/Source/WebCore/inspector/protocol/DOM.json	2014-01-06 23:35:52 UTC (rev 161380)
@@ -377,14 +377,6 @@
                 { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to focus." }
             ],
             "description": "Focuses the given element."
-        },
-        {
-            "name": "setFileInputFiles",
-            "parameters": [
-                { "name": "nodeId", "$ref": "NodeId", "description": "Id of the file input node to set files for." },
-                { "name": "files", "type": "array", "items": { "type": "string" }, "description": "Array of file paths to set." }
-            ],
-            "description": "Sets files for the given file input element."
         }
     ],
     "events": [

Modified: trunk/Source/WebInspectorUI/ChangeLog (161379 => 161380)


--- trunk/Source/WebInspectorUI/ChangeLog	2014-01-06 23:28:15 UTC (rev 161379)
+++ trunk/Source/WebInspectorUI/ChangeLog	2014-01-06 23:35:52 UTC (rev 161380)
@@ -1,3 +1,14 @@
+2014-01-06  Seokju Kwon  <[email protected]>
+
+        Web Inspector: Get rid of DOM.setFileInputFiles from Protocol
+        https://bugs.webkit.org/show_bug.cgi?id=126312
+
+        Reviewed by Joseph Pecoraro.
+
+        Update InspectorWebBackendCommands.js after removing DOM.setFileInputFiles.
+
+        * UserInterface/InspectorWebBackendCommands.js:
+
 2013-12-22  Martin Robinson  <[email protected]>
 
         [GTK][CMake] Integrate GResource for inspector files (and others?)

Modified: trunk/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js (161379 => 161380)


--- trunk/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js	2014-01-06 23:28:15 UTC (rev 161379)
+++ trunk/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js	2014-01-06 23:35:52 UTC (rev 161380)
@@ -126,7 +126,6 @@
 InspectorBackend.registerCommand("DOM.redo", [], []);
 InspectorBackend.registerCommand("DOM.markUndoableState", [], []);
 InspectorBackend.registerCommand("DOM.focus", [{"name": "nodeId", "type": "number", "optional": false}], []);
-InspectorBackend.registerCommand("DOM.setFileInputFiles", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "files", "type": "object", "optional": false}], []);
 
 // DOMDebugger.
 InspectorBackend.registerEnum("DOMDebugger.DOMBreakpointType", {SubtreeModified: "subtree-modified", AttributeModified: "attribute-modified", NodeRemoved: "node-removed"});
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to