Skip to content

Commit

Permalink
Web Inspector: Get rid of DOM.setFileInputFiles from Protocol
Browse files Browse the repository at this point in the history
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.


Canonical link: https://commits.webkit.org/144440@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Seokju Kwon committed Jan 6, 2014
1 parent 79365b3 commit 6663283
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 125 deletions.
10 changes: 10 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
2014-01-06 Seokju Kwon <seokju@webkit.org>

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 <bfulgham@apple.com>

Unreviewed test update after r161375.
Expand Down

This file was deleted.

69 changes: 0 additions & 69 deletions LayoutTests/inspector-protocol/dom/setFileInputFiles.html

This file was deleted.

21 changes: 21 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,24 @@
2014-01-06 Seokju Kwon <seokju@webkit.org>

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 <bfulgham@apple.com>

[WebGL] Revise String Concatenation (Follow-up to r161247)
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/inspector/InspectorClient.h
Expand Up @@ -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);
};

Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/inspector/InspectorController.cpp
Expand Up @@ -101,7 +101,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* inspectorC
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());

Expand Down
35 changes: 1 addition & 34 deletions Source/WebCore/inspector/InspectorDOMAgent.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -1188,34 +1183,6 @@ void InspectorDOMAgent::focus(ErrorString* errorString, int nodeId)
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 : "";
Expand Down
9 changes: 3 additions & 6 deletions Source/WebCore/inspector/InspectorDOMAgent.h
Expand Up @@ -61,7 +61,6 @@ class DOMEditor;
class Document;
class Element;
class Event;
class InspectorClient;
class InspectorHistory;
class InspectorOverlay;
class InspectorPageAgent;
Expand Down Expand Up @@ -105,9 +104,9 @@ class InspectorDOMAgent : public InspectorAgentBase, public Inspector::Inspector
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&);
Expand Down Expand Up @@ -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<Inspector::InspectorArray>& files);

void getEventListeners(Node*, Vector<EventListenerInfo>& listenersArray, bool includeAncestors);

Expand Down Expand Up @@ -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<HighlightConfig> highlightConfigFromInspectorObject(ErrorString*, Inspector::InspectorObject* highlightInspectorObject);
Expand Down Expand Up @@ -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<Inspector::InspectorDOMFrontendDispatcher> m_frontendDispatcher;
RefPtr<Inspector::InspectorDOMBackendDispatcher> m_backendDispatcher;
DOMListener* m_domListener;
Expand Down
8 changes: 0 additions & 8 deletions Source/WebCore/inspector/protocol/DOM.json
Expand Up @@ -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": [
Expand Down
11 changes: 11 additions & 0 deletions Source/WebInspectorUI/ChangeLog
@@ -1,3 +1,14 @@
2014-01-06 Seokju Kwon <seokju@webkit.org>

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 <mrobinson@igalia.com>

[GTK][CMake] Integrate GResource for inspector files (and others?)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6663283

Please sign in to comment.