| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 2 * Copyright (C) 2013 Samsung Electronics. 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 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef ParentNode_h | 31 #ifndef ParentNode_h |
| 32 #define ParentNode_h | 32 #define ParentNode_h |
| 33 | 33 |
| 34 #include "core/dom/ContainerNode.h" | 34 #include "core/dom/ContainerNode.h" |
| 35 #include "core/dom/ElementTraversal.h" | 35 #include "core/dom/ElementTraversal.h" |
| 36 #include "platform/heap/Handle.h" |
| 36 | 37 |
| 37 namespace WebCore { | 38 namespace WebCore { |
| 38 | 39 |
| 39 class ParentNode { | 40 class ParentNode { |
| 40 public: | 41 public: |
| 41 static PassRefPtr<HTMLCollection> children(ContainerNode& node) | 42 static PassRefPtrWillBeRawPtr<HTMLCollection> children(ContainerNode& node) |
| 42 { | 43 { |
| 43 return node.children(); | 44 return node.children(); |
| 44 } | 45 } |
| 45 | 46 |
| 46 static Element* firstElementChild(ContainerNode& node) | 47 static Element* firstElementChild(ContainerNode& node) |
| 47 { | 48 { |
| 48 return ElementTraversal::firstChild(node); | 49 return ElementTraversal::firstChild(node); |
| 49 } | 50 } |
| 50 | 51 |
| 51 static Element* lastElementChild(ContainerNode& node) | 52 static Element* lastElementChild(ContainerNode& node) |
| 52 { | 53 { |
| 53 return ElementTraversal::lastChild(node); | 54 return ElementTraversal::lastChild(node); |
| 54 } | 55 } |
| 55 | 56 |
| 56 static unsigned childElementCount(ContainerNode& node) | 57 static unsigned childElementCount(ContainerNode& node) |
| 57 { | 58 { |
| 58 unsigned count = 0; | 59 unsigned count = 0; |
| 59 for (Element* child = ElementTraversal::firstWithin(node); child; child
= ElementTraversal::nextSibling(*child)) | 60 for (Element* child = ElementTraversal::firstWithin(node); child; child
= ElementTraversal::nextSibling(*child)) |
| 60 ++count; | 61 ++count; |
| 61 return count; | 62 return count; |
| 62 } | 63 } |
| 63 | 64 |
| 64 static PassRefPtr<Element> querySelector(ContainerNode& node, const AtomicSt
ring& selectors, ExceptionState& exceptionState) | 65 static PassRefPtr<Element> querySelector(ContainerNode& node, const AtomicSt
ring& selectors, ExceptionState& exceptionState) |
| 65 { | 66 { |
| 66 return node.querySelector(selectors, exceptionState); | 67 return node.querySelector(selectors, exceptionState); |
| 67 } | 68 } |
| 68 | 69 |
| 69 static PassRefPtr<NodeList> querySelectorAll(ContainerNode& node, const Atom
icString& selectors, ExceptionState& exceptionState) | 70 static PassRefPtrWillBeRawPtr<NodeList> querySelectorAll(ContainerNode& node
, const AtomicString& selectors, ExceptionState& exceptionState) |
| 70 { | 71 { |
| 71 return node.querySelectorAll(selectors, exceptionState); | 72 return node.querySelectorAll(selectors, exceptionState); |
| 72 } | 73 } |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace WebCore | 76 } // namespace WebCore |
| 76 | 77 |
| 77 #endif // ParentNode_h | 78 #endif // ParentNode_h |
| OLD | NEW |