Changeset 161380 in webkit


Ignore:
Timestamp:
Jan 6, 2014 3:35:52 PM (10 years ago)
Author:
Seokju Kwon
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.
Location:
trunk
Files:
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r161379 r161380  
     12014-01-06  Seokju Kwon  <seokju@webkit.org>
     2
     3        Web Inspector: Get rid of DOM.setFileInputFiles from Protocol
     4        https://bugs.webkit.org/show_bug.cgi?id=126312
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * inspector-protocol/dom/setFileInputFiles-expected.txt: Removed.
     9        * inspector-protocol/dom/setFileInputFiles.html: Removed.
     10
    1112014-01-06  Brent Fulgham  <bfulgham@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r161378 r161380  
     12014-01-06  Seokju Kwon  <seokju@webkit.org>
     2
     3        Web Inspector: Get rid of DOM.setFileInputFiles from Protocol
     4        https://bugs.webkit.org/show_bug.cgi?id=126312
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        No new tests, No changes in behavior.
     9
     10        It is a dead code as all ports in WebKit don't support it.
     11        And this patch removes all things related to DOM.setFileInputFiles in Frontend.
     12
     13        * inspector/InspectorClient.h:
     14        * inspector/InspectorController.cpp:
     15        (WebCore::InspectorController::InspectorController):
     16        * inspector/InspectorDOMAgent.cpp:
     17        (WebCore::InspectorDOMAgent::InspectorDOMAgent):
     18        * inspector/InspectorDOMAgent.h:
     19        (WebCore::InspectorDOMAgent::create):
     20        * inspector/protocol/DOM.json:
     21
    1222014-01-06  Brent Fulgham  <bfulgham@apple.com>
    223
  • trunk/Source/WebCore/inspector/InspectorClient.h

    r160457 r161380  
    9696    virtual bool handleJavaScriptDialog(bool, const String*) { return false; }
    9797
    98     virtual bool canSetFileInputFiles() { return false; }
    99 
    10098    static bool doDispatchMessageOnFrontendPage(Page* frontendPage, const String& message);
    10199};
  • trunk/Source/WebCore/inspector/InspectorController.cpp

    r160946 r161380  
    102102    m_agents.append(pageAgentPtr.release());
    103103
    104     OwnPtr<InspectorDOMAgent> domAgentPtr(InspectorDOMAgent::create(m_instrumentingAgents.get(), pageAgent, m_injectedScriptManager.get(), m_overlay.get(), inspectorClient));
     104    OwnPtr<InspectorDOMAgent> domAgentPtr(InspectorDOMAgent::create(m_instrumentingAgents.get(), pageAgent, m_injectedScriptManager.get(), m_overlay.get()));
    105105    m_domAgent = domAgentPtr.get();
    106106    m_agents.append(domAgentPtr.release());
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r160955 r161380  
    5858#include "EventNames.h"
    5959#include "EventTarget.h"
    60 #include "File.h"
    61 #include "FileList.h"
    6260#include "FrameTree.h"
    6361#include "HTMLElement.h"
    6462#include "HTMLFrameOwnerElement.h"
    65 #include "HTMLInputElement.h"
    6663#include "HTMLNames.h"
    6764#include "HTMLTemplateElement.h"
     
    6966#include "IdentifiersFactory.h"
    7067#include "InjectedScriptManager.h"
    71 #include "InspectorClient.h"
    7268#include "InspectorHistory.h"
    7369#include "InspectorNodeFinder.h"
     
    214210}
    215211
    216 InspectorDOMAgent::InspectorDOMAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay, InspectorClient* client)
     212InspectorDOMAgent::InspectorDOMAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay)
    217213    : InspectorAgentBase(ASCIILiteral("DOM"), instrumentingAgents)
    218214    , m_pageAgent(pageAgent)
    219215    , m_injectedScriptManager(injectedScriptManager)
    220216    , m_overlay(overlay)
    221     , m_client(client)
    222217    , m_domListener(0)
    223218    , m_lastNodeId(1)
     
    11891184}
    11901185
    1191 void InspectorDOMAgent::setFileInputFiles(ErrorString* errorString, int nodeId, const RefPtr<InspectorArray>& files)
    1192 {
    1193     if (!m_client->canSetFileInputFiles()) {
    1194         *errorString = "Cannot set file input files";
    1195         return;
    1196     }
    1197 
    1198     Node* node = assertNode(errorString, nodeId);
    1199     if (!node)
    1200         return;
    1201     HTMLInputElement* element = node->toInputElement();
    1202     if (!element || !element->isFileUpload()) {
    1203         *errorString = "Node is not a file input element";
    1204         return;
    1205     }
    1206 
    1207     RefPtr<FileList> fileList = FileList::create();
    1208     for (InspectorArray::const_iterator iter = files->begin(); iter != files->end(); ++iter) {
    1209         String path;
    1210         if (!(*iter)->asString(&path)) {
    1211             *errorString = "Files must be strings";
    1212             return;
    1213         }
    1214         fileList->append(File::create(path));
    1215     }
    1216     element->setFiles(fileList);
    1217 }
    1218 
    12191186void InspectorDOMAgent::resolveNode(ErrorString* errorString, int nodeId, const String* const objectGroup, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result)
    12201187{
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.h

    r160955 r161380  
    6262class Element;
    6363class Event;
    64 class InspectorClient;
    6564class InspectorHistory;
    6665class InspectorOverlay;
     
    106105    };
    107106
    108     static PassOwnPtr<InspectorDOMAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay, InspectorClient* client)
     107    static PassOwnPtr<InspectorDOMAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay)
    109108    {
    110         return adoptPtr(new InspectorDOMAgent(instrumentingAgents, pageAgent, injectedScriptManager, overlay, client));
     109        return adoptPtr(new InspectorDOMAgent(instrumentingAgents, pageAgent, injectedScriptManager, overlay));
    111110    }
    112111
     
    156155    virtual void markUndoableState(ErrorString*);
    157156    virtual void focus(ErrorString*, int nodeId);
    158     virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr<Inspector::InspectorArray>& files);
    159157
    160158    void getEventListeners(Node*, Vector<EventListenerInfo>& listenersArray, bool includeAncestors);
     
    216214
    217215private:
    218     InspectorDOMAgent(InstrumentingAgents*, InspectorPageAgent*, InjectedScriptManager*, InspectorOverlay*, InspectorClient*);
     216    InspectorDOMAgent(InstrumentingAgents*, InspectorPageAgent*, InjectedScriptManager*, InspectorOverlay*);
    219217
    220218    void setSearchingForNode(ErrorString*, bool enabled, Inspector::InspectorObject* highlightConfig);
     
    251249    InjectedScriptManager* m_injectedScriptManager;
    252250    InspectorOverlay* m_overlay;
    253     InspectorClient* m_client;
    254251    std::unique_ptr<Inspector::InspectorDOMFrontendDispatcher> m_frontendDispatcher;
    255252    RefPtr<Inspector::InspectorDOMBackendDispatcher> m_backendDispatcher;
  • trunk/Source/WebCore/inspector/protocol/DOM.json

    r160683 r161380  
    378378            ],
    379379            "description": "Focuses the given element."
    380         },
    381         {
    382             "name": "setFileInputFiles",
    383             "parameters": [
    384                 { "name": "nodeId", "$ref": "NodeId", "description": "Id of the file input node to set files for." },
    385                 { "name": "files", "type": "array", "items": { "type": "string" }, "description": "Array of file paths to set." }
    386             ],
    387             "description": "Sets files for the given file input element."
    388380        }
    389381    ],
  • trunk/Source/WebInspectorUI/ChangeLog

    r160985 r161380  
     12014-01-06  Seokju Kwon  <seokju@webkit.org>
     2
     3        Web Inspector: Get rid of DOM.setFileInputFiles from Protocol
     4        https://bugs.webkit.org/show_bug.cgi?id=126312
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Update InspectorWebBackendCommands.js after removing DOM.setFileInputFiles.
     9
     10        * UserInterface/InspectorWebBackendCommands.js:
     11
    1122013-12-22  Martin Robinson  <mrobinson@igalia.com>
    213
  • trunk/Source/WebInspectorUI/UserInterface/InspectorWebBackendCommands.js

    r160588 r161380  
    127127InspectorBackend.registerCommand("DOM.markUndoableState", [], []);
    128128InspectorBackend.registerCommand("DOM.focus", [{"name": "nodeId", "type": "number", "optional": false}], []);
    129 InspectorBackend.registerCommand("DOM.setFileInputFiles", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "files", "type": "object", "optional": false}], []);
    130129
    131130// DOMDebugger.
Note: See TracChangeset for help on using the changeset viewer.