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

Side by Side Diff: Source/core/dom/Node.cpp

Issue 119063002: Have HTMLFormElement's named getter return a RadioNodeList. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Test style adjustments + const'ify new RadioNodeList field. Created 7 years 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/dom/Node.h ('k') | Source/core/html/CollectionType.h » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 PassRefPtr<NodeList> Node::getElementsByName(const String& elementName) 1345 PassRefPtr<NodeList> Node::getElementsByName(const String& elementName)
1346 { 1346 {
1347 return ensureRareData().ensureNodeLists().addCacheWithAtomicName<NameNodeLis t>(this, NameNodeListType, elementName); 1347 return ensureRareData().ensureNodeLists().addCacheWithAtomicName<NameNodeLis t>(this, NameNodeListType, elementName);
1348 } 1348 }
1349 1349
1350 PassRefPtr<NodeList> Node::getElementsByClassName(const String& classNames) 1350 PassRefPtr<NodeList> Node::getElementsByClassName(const String& classNames)
1351 { 1351 {
1352 return ensureRareData().ensureNodeLists().addCacheWithName<ClassNodeList>(th is, ClassNodeListType, classNames); 1352 return ensureRareData().ensureNodeLists().addCacheWithName<ClassNodeList>(th is, ClassNodeListType, classNames);
1353 } 1353 }
1354 1354
1355 PassRefPtr<RadioNodeList> Node::radioNodeList(const AtomicString& name) 1355 PassRefPtr<RadioNodeList> Node::radioNodeList(const AtomicString& name, bool onl yMatchImgElements)
1356 { 1356 {
1357 ASSERT(hasTagName(formTag) || hasTagName(fieldsetTag)); 1357 ASSERT(hasTagName(formTag) || hasTagName(fieldsetTag));
1358 return ensureRareData().ensureNodeLists().addCacheWithAtomicName<RadioNodeLi st>(this, RadioNodeListType, name); 1358 CollectionType type = onlyMatchImgElements ? RadioImgNodeListType : RadioNod eListType;
1359 return ensureRareData().ensureNodeLists().addCacheWithAtomicName<RadioNodeLi st>(this, type, name);
1359 } 1360 }
1360 1361
1361 PassRefPtr<Element> Node::querySelector(const AtomicString& selectors, Exception State& exceptionState) 1362 PassRefPtr<Element> Node::querySelector(const AtomicString& selectors, Exception State& exceptionState)
1362 { 1363 {
1363 if (selectors.isEmpty()) { 1364 if (selectors.isEmpty()) {
1364 exceptionState.throwDOMException(SyntaxError, "The provided selector is empty."); 1365 exceptionState.throwDOMException(SyntaxError, "The provided selector is empty.");
1365 return 0; 1366 return 0;
1366 } 1367 }
1367 1368
1368 SelectorQuery* selectorQuery = document().selectorQueryCache().add(selectors , document(), exceptionState); 1369 SelectorQuery* selectorQuery = document().selectorQueryCache().add(selectors , document(), exceptionState);
1369 if (!selectorQuery) 1370 if (!selectorQuery)
1370 return 0; 1371 return 0;
1371 return selectorQuery->queryFirst(*this); 1372 return selectorQuery->queryFirst(*this);
1372 } 1373 }
1373 1374
1374 PassRefPtr<NodeList> Node::querySelectorAll(const AtomicString& selectors, Excep tionState& exceptionState) 1375 PassRefPtr<NodeList> Node::querySelectorAll(const AtomicString& selectors, Excep tionState& exceptionState)
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
2737 node->showTreeForThis(); 2738 node->showTreeForThis();
2738 } 2739 }
2739 2740
2740 void showNodePath(const WebCore::Node* node) 2741 void showNodePath(const WebCore::Node* node)
2741 { 2742 {
2742 if (node) 2743 if (node)
2743 node->showNodePathForThis(); 2744 node->showNodePathForThis();
2744 } 2745 }
2745 2746
2746 #endif 2747 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/html/CollectionType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698