OLD | NEW |
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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All r
ights reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All r
ights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 return nodeList->nodeMatchesInlined(element); | 248 return nodeList->nodeMatchesInlined(element); |
249 } | 249 } |
250 | 250 |
251 template <> inline bool isMatchingElement(const ClassNodeList* nodeList, Element
* element) | 251 template <> inline bool isMatchingElement(const ClassNodeList* nodeList, Element
* element) |
252 { | 252 { |
253 return nodeList->nodeMatchesInlined(element); | 253 return nodeList->nodeMatchesInlined(element); |
254 } | 254 } |
255 | 255 |
256 static Node* previousNode(Node& base, Node& previous, bool onlyIncludeDirectChil
dren) | 256 static Node* previousNode(Node& base, Node& previous, bool onlyIncludeDirectChil
dren) |
257 { | 257 { |
258 return onlyIncludeDirectChildren ? previous.previousSibling() : NodeTraversa
l::previous(&previous, &base); | 258 return onlyIncludeDirectChildren ? previous.previousSibling() : NodeTraversa
l::previous(previous, &base); |
259 } | 259 } |
260 | 260 |
261 static inline Node* lastDescendent(Node& node) | 261 static inline Node* lastDescendent(Node& node) |
262 { | 262 { |
263 Node* descendent = node.lastChild(); | 263 Node* descendent = node.lastChild(); |
264 for (Node* current = descendent; current; current = current->lastChild()) | 264 for (Node* current = descendent; current; current = current->lastChild()) |
265 descendent = current; | 265 descendent = current; |
266 return descendent; | 266 return descendent; |
267 } | 267 } |
268 | 268 |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 | 682 |
683 void HTMLCollection::append(NodeCacheMap& map, const AtomicString& key, Element*
element) | 683 void HTMLCollection::append(NodeCacheMap& map, const AtomicString& key, Element*
element) |
684 { | 684 { |
685 OwnPtr<Vector<Element*> >& vector = map.add(key.impl(), nullptr).iterator->v
alue; | 685 OwnPtr<Vector<Element*> >& vector = map.add(key.impl(), nullptr).iterator->v
alue; |
686 if (!vector) | 686 if (!vector) |
687 vector = adoptPtr(new Vector<Element*>); | 687 vector = adoptPtr(new Vector<Element*>); |
688 vector->append(element); | 688 vector->append(element); |
689 } | 689 } |
690 | 690 |
691 } // namespace WebCore | 691 } // namespace WebCore |
OLD | NEW |