OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 void InspectorDOMAgent::setFileInputFiles(ErrorString* errorString, int nodeId,
const RefPtr<JSONArray>& files) | 1321 void InspectorDOMAgent::setFileInputFiles(ErrorString* errorString, int nodeId,
const RefPtr<JSONArray>& files) |
1322 { | 1322 { |
1323 Node* node = assertNode(errorString, nodeId); | 1323 Node* node = assertNode(errorString, nodeId); |
1324 if (!node) | 1324 if (!node) |
1325 return; | 1325 return; |
1326 if (!node->hasTagName(inputTag) || !toHTMLInputElement(node)->isFileUpload()
) { | 1326 if (!node->hasTagName(inputTag) || !toHTMLInputElement(node)->isFileUpload()
) { |
1327 *errorString = "Node is not a file input element"; | 1327 *errorString = "Node is not a file input element"; |
1328 return; | 1328 return; |
1329 } | 1329 } |
1330 | 1330 |
1331 RefPtr<FileList> fileList = FileList::create(); | 1331 RefPtrWillBeRawPtr<FileList> fileList = FileList::create(); |
1332 for (JSONArray::const_iterator iter = files->begin(); iter != files->end();
++iter) { | 1332 for (JSONArray::const_iterator iter = files->begin(); iter != files->end();
++iter) { |
1333 String path; | 1333 String path; |
1334 if (!(*iter)->asString(&path)) { | 1334 if (!(*iter)->asString(&path)) { |
1335 *errorString = "Files must be strings"; | 1335 *errorString = "Files must be strings"; |
1336 return; | 1336 return; |
1337 } | 1337 } |
1338 fileList->append(File::create(path)); | 1338 fileList->append(File::create(path)); |
1339 } | 1339 } |
1340 toHTMLInputElement(node)->setFiles(fileList); | 1340 toHTMLInputElement(node)->setFiles(fileList); |
1341 } | 1341 } |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2051 if (!m_documentNodeToIdMap.contains(m_document)) { | 2051 if (!m_documentNodeToIdMap.contains(m_document)) { |
2052 RefPtr<TypeBuilder::DOM::Node> root; | 2052 RefPtr<TypeBuilder::DOM::Node> root; |
2053 getDocument(errorString, root); | 2053 getDocument(errorString, root); |
2054 return errorString->isEmpty(); | 2054 return errorString->isEmpty(); |
2055 } | 2055 } |
2056 return true; | 2056 return true; |
2057 } | 2057 } |
2058 | 2058 |
2059 } // namespace WebCore | 2059 } // namespace WebCore |
2060 | 2060 |
OLD | NEW |