diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index a4c5af9817fc..9098d0685038 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2014-01-06 Seokju Kwon + + 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 Unreviewed test update after r161375. diff --git a/LayoutTests/inspector-protocol/dom/setFileInputFiles-expected.txt b/LayoutTests/inspector-protocol/dom/setFileInputFiles-expected.txt deleted file mode 100644 index 61739f3ecc82..000000000000 --- a/LayoutTests/inspector-protocol/dom/setFileInputFiles-expected.txt +++ /dev/null @@ -1,4 +0,0 @@ - -Received error: Cannot set file input files -Received error: Cannot set file input files - diff --git a/LayoutTests/inspector-protocol/dom/setFileInputFiles.html b/LayoutTests/inspector-protocol/dom/setFileInputFiles.html deleted file mode 100644 index a7ac0464951e..000000000000 --- a/LayoutTests/inspector-protocol/dom/setFileInputFiles.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 88a5e788afdb..26072f598116 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,24 @@ +2014-01-06 Seokju Kwon + + 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 [WebGL] Revise String Concatenation (Follow-up to r161247) diff --git a/Source/WebCore/inspector/InspectorClient.h b/Source/WebCore/inspector/InspectorClient.h index df389d4a3016..143a459a3f4e 100644 --- a/Source/WebCore/inspector/InspectorClient.h +++ b/Source/WebCore/inspector/InspectorClient.h @@ -95,8 +95,6 @@ class InspectorClient { virtual bool handleJavaScriptDialog(bool, const String*) { return false; } - virtual bool canSetFileInputFiles() { return false; } - static bool doDispatchMessageOnFrontendPage(Page* frontendPage, const String& message); }; diff --git a/Source/WebCore/inspector/InspectorController.cpp b/Source/WebCore/inspector/InspectorController.cpp index b2986dcb3c8e..60bbe680fea0 100644 --- a/Source/WebCore/inspector/InspectorController.cpp +++ b/Source/WebCore/inspector/InspectorController.cpp @@ -101,7 +101,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* inspectorC m_pageAgent = pageAgentPtr.get(); m_agents.append(pageAgentPtr.release()); - OwnPtr domAgentPtr(InspectorDOMAgent::create(m_instrumentingAgents.get(), pageAgent, m_injectedScriptManager.get(), m_overlay.get(), inspectorClient)); + OwnPtr domAgentPtr(InspectorDOMAgent::create(m_instrumentingAgents.get(), pageAgent, m_injectedScriptManager.get(), m_overlay.get())); m_domAgent = domAgentPtr.get(); m_agents.append(domAgentPtr.release()); diff --git a/Source/WebCore/inspector/InspectorDOMAgent.cpp b/Source/WebCore/inspector/InspectorDOMAgent.cpp index 7ee05071026e..d0e775e9641d 100644 --- a/Source/WebCore/inspector/InspectorDOMAgent.cpp +++ b/Source/WebCore/inspector/InspectorDOMAgent.cpp @@ -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 @@ String InspectorDOMAgent::toErrorString(const ExceptionCode& ec) 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 @@ void InspectorDOMAgent::focus(ErrorString* errorString, int nodeId) element->focus(); } -void InspectorDOMAgent::setFileInputFiles(ErrorString* errorString, int nodeId, const RefPtr& 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::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& result) { String objectGroupName = objectGroup ? *objectGroup : ""; diff --git a/Source/WebCore/inspector/InspectorDOMAgent.h b/Source/WebCore/inspector/InspectorDOMAgent.h index 99dd0df7b914..1c0f0c281dfa 100644 --- a/Source/WebCore/inspector/InspectorDOMAgent.h +++ b/Source/WebCore/inspector/InspectorDOMAgent.h @@ -61,7 +61,6 @@ class DOMEditor; class Document; class Element; class Event; -class InspectorClient; class InspectorHistory; class InspectorOverlay; class InspectorPageAgent; @@ -105,9 +104,9 @@ class InspectorDOMAgent : public InspectorAgentBase, public Inspector::Inspector virtual void didModifyDOMAttr(Element*) = 0; }; - static PassOwnPtr create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay, InspectorClient* client) + static PassOwnPtr 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 @@ class InspectorDOMAgent : public InspectorAgentBase, public Inspector::Inspector virtual void redo(ErrorString*); virtual void markUndoableState(ErrorString*); virtual void focus(ErrorString*, int nodeId); - virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr& files); void getEventListeners(Node*, Vector& listenersArray, bool includeAncestors); @@ -215,7 +213,7 @@ class InspectorDOMAgent : public InspectorAgentBase, public Inspector::Inspector 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 highlightConfigFromInspectorObject(ErrorString*, Inspector::InspectorObject* highlightInspectorObject); @@ -250,7 +248,6 @@ class InspectorDOMAgent : public InspectorAgentBase, public Inspector::Inspector InspectorPageAgent* m_pageAgent; InjectedScriptManager* m_injectedScriptManager; InspectorOverlay* m_overlay; - InspectorClient* m_client; std::unique_ptr m_frontendDispatcher; RefPtr m_backendDispatcher; DOMListener* m_domListener; diff --git a/Source/WebCore/inspector/protocol/DOM.json b/Source/WebCore/inspector/protocol/DOM.json index fbec0aa029fe..eb0c182a01e6 100644 --- a/Source/WebCore/inspector/protocol/DOM.json +++ b/Source/WebCore/inspector/protocol/DOM.json @@ -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": [ diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog index f5aa43d8fe0b..5a4a926f506e 100644 --- a/Source/WebInspectorUI/ChangeLog +++ b/Source/WebInspectorUI/ChangeLog @@ -1,3 +1,14 @@ +2014-01-06 Seokju Kwon + + 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 [GTK][CMake] Integrate GResource for inspector files (and others?) diff --git a/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js b/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js index 5b87b1823b31..fb828993d148 100644 --- a/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js +++ b/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js @@ -126,7 +126,6 @@ InspectorBackend.registerCommand("DOM.undo", [], []); 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"});