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 26 matching lines...) Expand all Loading... |
37 #include "WebDOMEventListener.h" | 37 #include "WebDOMEventListener.h" |
38 #include "WebDocument.h" | 38 #include "WebDocument.h" |
39 #include "WebElement.h" | 39 #include "WebElement.h" |
40 #include "WebFrameImpl.h" | 40 #include "WebFrameImpl.h" |
41 #include "WebNodeList.h" | 41 #include "WebNodeList.h" |
42 #include "WebPluginContainer.h" | 42 #include "WebPluginContainer.h" |
43 #include "WebPluginContainerImpl.h" | 43 #include "WebPluginContainerImpl.h" |
44 #include "bindings/v8/ExceptionState.h" | 44 #include "bindings/v8/ExceptionState.h" |
45 #include "core/dom/Document.h" | 45 #include "core/dom/Document.h" |
46 #include "core/dom/Element.h" | 46 #include "core/dom/Element.h" |
| 47 #include "core/dom/EmptyNodeList.h" |
47 #include "core/events/Event.h" | 48 #include "core/events/Event.h" |
48 #include "core/dom/Node.h" | 49 #include "core/dom/Node.h" |
49 #include "core/dom/NodeList.h" | 50 #include "core/dom/NodeList.h" |
50 #include "core/editing/markup.h" | 51 #include "core/editing/markup.h" |
51 #include "core/rendering/RenderObject.h" | 52 #include "core/rendering/RenderObject.h" |
52 #include "core/rendering/RenderWidget.h" | 53 #include "core/rendering/RenderWidget.h" |
53 #include "platform/Widget.h" | 54 #include "platform/Widget.h" |
54 #include "public/platform/WebString.h" | 55 #include "public/platform/WebString.h" |
55 #include "public/platform/WebVector.h" | 56 #include "public/platform/WebVector.h" |
56 | 57 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 return false; | 186 return false; |
186 } | 187 } |
187 | 188 |
188 void WebNode::simulateClick() | 189 void WebNode::simulateClick() |
189 { | 190 { |
190 m_private->dispatchSimulatedClick(0); | 191 m_private->dispatchSimulatedClick(0); |
191 } | 192 } |
192 | 193 |
193 WebNodeList WebNode::getElementsByTagName(const WebString& tag) const | 194 WebNodeList WebNode::getElementsByTagName(const WebString& tag) const |
194 { | 195 { |
195 return WebNodeList(m_private->getElementsByTagName(tag)); | 196 if (m_private->isContainerNode()) |
| 197 return WebNodeList(toContainerNode(m_private.get())->getElementsByTagNam
e(tag)); |
| 198 return WebNodeList(EmptyNodeList::create(m_private.get())); |
196 } | 199 } |
197 | 200 |
198 WebElement WebNode::querySelector(const WebString& tag, WebExceptionCode& ec) co
nst | 201 WebElement WebNode::querySelector(const WebString& tag, WebExceptionCode& ec) co
nst |
199 { | 202 { |
200 TrackExceptionState exceptionState; | 203 TrackExceptionState exceptionState; |
201 WebElement element(m_private->querySelector(tag, exceptionState)); | 204 WebElement element(m_private->querySelector(tag, exceptionState)); |
202 ec = exceptionState.code(); | 205 ec = exceptionState.code(); |
203 return element; | 206 return element; |
204 } | 207 } |
205 | 208 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 m_private = node; | 263 m_private = node; |
261 return *this; | 264 return *this; |
262 } | 265 } |
263 | 266 |
264 WebNode::operator PassRefPtr<Node>() const | 267 WebNode::operator PassRefPtr<Node>() const |
265 { | 268 { |
266 return m_private.get(); | 269 return m_private.get(); |
267 } | 270 } |
268 | 271 |
269 } // namespace blink | 272 } // namespace blink |
OLD | NEW |