Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: Source/web/WebNode.cpp

Issue 138743008: Make sure the root node of selector queries is a ContainerNode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.cpp ('k') | Source/web/tests/TouchActionTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 WebNodeList WebNode::getElementsByTagName(const WebString& tag) const 194 WebNodeList WebNode::getElementsByTagName(const WebString& tag) const
195 { 195 {
196 if (m_private->isContainerNode()) 196 if (m_private->isContainerNode())
197 return WebNodeList(toContainerNode(m_private.get())->getElementsByTagNam e(tag)); 197 return WebNodeList(toContainerNode(m_private.get())->getElementsByTagNam e(tag));
198 return WebNodeList(EmptyNodeList::create(m_private.get())); 198 return WebNodeList(EmptyNodeList::create(m_private.get()));
199 } 199 }
200 200
201 WebElement WebNode::querySelector(const WebString& tag, WebExceptionCode& ec) co nst 201 WebElement WebNode::querySelector(const WebString& tag, WebExceptionCode& ec) co nst
202 { 202 {
203 TrackExceptionState exceptionState; 203 TrackExceptionState exceptionState;
204 WebElement element(m_private->querySelector(tag, exceptionState)); 204 WebElement element;
205 if (m_private->isContainerNode())
206 element = toContainerNode(m_private.get())->querySelector(tag, exception State);
205 ec = exceptionState.code(); 207 ec = exceptionState.code();
206 return element; 208 return element;
207 } 209 }
208 210
209 WebElement WebNode::rootEditableElement() const 211 WebElement WebNode::rootEditableElement() const
210 { 212 {
211 return WebElement(m_private->rootEditableElement()); 213 return WebElement(m_private->rootEditableElement());
212 } 214 }
213 215
214 bool WebNode::focused() const 216 bool WebNode::focused() const
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 m_private = node; 265 m_private = node;
264 return *this; 266 return *this;
265 } 267 }
266 268
267 WebNode::operator PassRefPtr<Node>() const 269 WebNode::operator PassRefPtr<Node>() const
268 { 270 {
269 return m_private.get(); 271 return m_private.get();
270 } 272 }
271 273
272 } // namespace blink 274 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.cpp ('k') | Source/web/tests/TouchActionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698