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, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2007, 2008 Apple Inc. All rights reserved. |
6 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 6 * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 19 matching lines...) Expand all Loading... |
30 namespace WebCore { | 30 namespace WebCore { |
31 | 31 |
32 ChildNodeList::ChildNodeList(PassRefPtr<ContainerNode> parent) | 32 ChildNodeList::ChildNodeList(PassRefPtr<ContainerNode> parent) |
33 : m_parent(parent) | 33 : m_parent(parent) |
34 { | 34 { |
35 ASSERT(m_parent); | 35 ASSERT(m_parent); |
36 } | 36 } |
37 | 37 |
38 Node* ChildNodeList::virtualOwnerNode() const | 38 Node* ChildNodeList::virtualOwnerNode() const |
39 { | 39 { |
40 return ownerNode(); | 40 return &ownerNode(); |
41 } | 41 } |
42 | 42 |
43 ChildNodeList::~ChildNodeList() | 43 ChildNodeList::~ChildNodeList() |
44 { | 44 { |
45 m_parent->nodeLists()->removeChildNodeList(this); | 45 m_parent->nodeLists()->removeChildNodeList(this); |
46 } | 46 } |
47 | 47 |
48 Node* ChildNodeList::itemBefore(const Node* previous) const | 48 Node* ChildNodeList::itemBefore(const Node* previous) const |
49 { | 49 { |
50 return LIKELY(!!previous) ? previous->previousSibling() : rootNode().lastChi
ld(); | 50 return LIKELY(!!previous) ? previous->previousSibling() : rootNode().lastChi
ld(); |
51 } | 51 } |
52 | 52 |
53 Node* ChildNodeList::traverseForwardToOffset(unsigned offset, Node& currentNode,
unsigned& currentOffset, const ContainerNode&) const | 53 Node* ChildNodeList::traverseForwardToOffset(unsigned offset, Node& currentNode,
unsigned& currentOffset, const ContainerNode&) const |
54 { | 54 { |
55 ASSERT(currentOffset < offset); | 55 ASSERT(currentOffset < offset); |
56 Node* next = ¤tNode; | 56 Node* next = ¤tNode; |
57 while ((next = next->nextSibling())) { | 57 while ((next = next->nextSibling())) { |
58 if (++currentOffset == offset) | 58 if (++currentOffset == offset) |
59 return next; | 59 return next; |
60 } | 60 } |
61 return 0; | 61 return 0; |
62 } | 62 } |
63 | 63 |
64 } // namespace WebCore | 64 } // namespace WebCore |
OLD | NEW |