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 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights
reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 exceptionState.ThrowDOMException(SyntaxError, "The provided selector is
empty."); | 935 exceptionState.ThrowDOMException(SyntaxError, "The provided selector is
empty."); |
936 return nullptr; | 936 return nullptr; |
937 } | 937 } |
938 | 938 |
939 SelectorQuery* selectorQuery = document().selectorQueryCache().add(selectors
, document(), exceptionState); | 939 SelectorQuery* selectorQuery = document().selectorQueryCache().add(selectors
, document(), exceptionState); |
940 if (!selectorQuery) | 940 if (!selectorQuery) |
941 return nullptr; | 941 return nullptr; |
942 return selectorQuery->queryFirst(*this); | 942 return selectorQuery->queryFirst(*this); |
943 } | 943 } |
944 | 944 |
945 PassRefPtr<StaticElementList> ContainerNode::querySelectorAll(const AtomicString
& selectors, ExceptionState& exceptionState) | 945 Vector<RefPtr<Element>> ContainerNode::querySelectorAll(const AtomicString& sele
ctors, ExceptionState& exceptionState) |
946 { | 946 { |
| 947 Vector<RefPtr<Element>> result; |
947 if (selectors.isEmpty()) { | 948 if (selectors.isEmpty()) { |
948 exceptionState.ThrowDOMException(SyntaxError, "The provided selector is
empty."); | 949 exceptionState.ThrowDOMException(SyntaxError, "The provided selector is
empty."); |
949 return nullptr; | 950 return result; |
950 } | 951 } |
951 | 952 |
952 SelectorQuery* selectorQuery = document().selectorQueryCache().add(selectors
, document(), exceptionState); | 953 SelectorQuery* selectorQuery = document().selectorQueryCache().add(selectors
, document(), exceptionState); |
953 if (!selectorQuery) | 954 if (!selectorQuery) |
954 return nullptr; | 955 return result; |
955 | 956 |
956 return selectorQuery->queryAll(*this); | 957 result = selectorQuery->queryAll(*this); |
| 958 return result; |
957 } | 959 } |
958 | 960 |
959 void ContainerNode::updateTreeAfterInsertion(Node& child) | 961 void ContainerNode::updateTreeAfterInsertion(Node& child) |
960 { | 962 { |
961 ASSERT(refCount()); | 963 ASSERT(refCount()); |
962 ASSERT(child.refCount()); | 964 ASSERT(child.refCount()); |
963 | 965 |
964 ChildListMutationScope(*this).childAdded(child); | 966 ChildListMutationScope(*this).childAdded(child); |
965 | 967 |
966 notifyNodeInserted(child); | 968 notifyNodeInserted(child); |
(...skipping 29 matching lines...) Expand all Loading... |
996 return true; | 998 return true; |
997 | 999 |
998 if (node->isElementNode() && toElement(node)->shadow()) | 1000 if (node->isElementNode() && toElement(node)->shadow()) |
999 return true; | 1001 return true; |
1000 | 1002 |
1001 return false; | 1003 return false; |
1002 } | 1004 } |
1003 #endif | 1005 #endif |
1004 | 1006 |
1005 } // namespace blink | 1007 } // namespace blink |
OLD | NEW |