| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "public/platform/WebSuspendableTask.h" | 50 #include "public/platform/WebSuspendableTask.h" |
| 51 #include "public/web/WebAXObject.h" | 51 #include "public/web/WebAXObject.h" |
| 52 #include "public/web/WebDOMEvent.h" | 52 #include "public/web/WebDOMEvent.h" |
| 53 #include "public/web/WebDocument.h" | 53 #include "public/web/WebDocument.h" |
| 54 #include "public/web/WebElement.h" | 54 #include "public/web/WebElement.h" |
| 55 #include "public/web/WebElementCollection.h" | 55 #include "public/web/WebElementCollection.h" |
| 56 #include "public/web/WebPluginContainer.h" | 56 #include "public/web/WebPluginContainer.h" |
| 57 #include "web/FrameLoaderClientImpl.h" | 57 #include "web/FrameLoaderClientImpl.h" |
| 58 #include "web/WebLocalFrameImpl.h" | 58 #include "web/WebLocalFrameImpl.h" |
| 59 #include "web/WebPluginContainerImpl.h" | 59 #include "web/WebPluginContainerImpl.h" |
| 60 #include "wtf/PtrUtil.h" |
| 60 | 61 |
| 61 namespace blink { | 62 namespace blink { |
| 62 | 63 |
| 63 namespace { | 64 namespace { |
| 64 | 65 |
| 65 class NodeDispatchSimulatedClickTask: public SuspendableTask { | 66 class NodeDispatchSimulatedClickTask: public SuspendableTask { |
| 66 WTF_MAKE_NONCOPYABLE(NodeDispatchSimulatedClickTask); | 67 WTF_MAKE_NONCOPYABLE(NodeDispatchSimulatedClickTask); |
| 67 public: | 68 public: |
| 68 NodeDispatchSimulatedClickTask(const WebPrivatePtr<Node>& node) | 69 NodeDispatchSimulatedClickTask(const WebPrivatePtr<Node>& node) |
| 69 { | 70 { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 return m_private->isDocumentNode(); | 189 return m_private->isDocumentNode(); |
| 189 } | 190 } |
| 190 | 191 |
| 191 bool WebNode::isDocumentTypeNode() const | 192 bool WebNode::isDocumentTypeNode() const |
| 192 { | 193 { |
| 193 return m_private->getNodeType() == Node::DOCUMENT_TYPE_NODE; | 194 return m_private->getNodeType() == Node::DOCUMENT_TYPE_NODE; |
| 194 } | 195 } |
| 195 | 196 |
| 196 void WebNode::simulateClick() | 197 void WebNode::simulateClick() |
| 197 { | 198 { |
| 198 m_private->getExecutionContext()->postSuspendableTask(adoptPtr(new NodeDispa
tchSimulatedClickTask(m_private))); | 199 m_private->getExecutionContext()->postSuspendableTask(wrapUnique(new NodeDis
patchSimulatedClickTask(m_private))); |
| 199 } | 200 } |
| 200 | 201 |
| 201 WebElementCollection WebNode::getElementsByHTMLTagName(const WebString& tag) con
st | 202 WebElementCollection WebNode::getElementsByHTMLTagName(const WebString& tag) con
st |
| 202 { | 203 { |
| 203 if (m_private->isContainerNode()) | 204 if (m_private->isContainerNode()) |
| 204 return WebElementCollection(toContainerNode(m_private.get())->getElement
sByTagNameNS(HTMLNames::xhtmlNamespaceURI, tag)); | 205 return WebElementCollection(toContainerNode(m_private.get())->getElement
sByTagNameNS(HTMLNames::xhtmlNamespaceURI, tag)); |
| 205 return WebElementCollection(); | 206 return WebElementCollection(); |
| 206 } | 207 } |
| 207 | 208 |
| 208 WebElement WebNode::querySelector(const WebString& selector) const | 209 WebElement WebNode::querySelector(const WebString& selector) const |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 m_private = node; | 260 m_private = node; |
| 260 return *this; | 261 return *this; |
| 261 } | 262 } |
| 262 | 263 |
| 263 WebNode::operator Node*() const | 264 WebNode::operator Node*() const |
| 264 { | 265 { |
| 265 return m_private.get(); | 266 return m_private.get(); |
| 266 } | 267 } |
| 267 | 268 |
| 268 } // namespace blink | 269 } // namespace blink |
| OLD | NEW |