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

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

Issue 161083002: Make NodeList::ownerNode() virtual and rename to virtualOwnerNode() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reupload Created 6 years, 10 months 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
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, 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 17 matching lines...) Expand all
28 #include "core/dom/NodeRareData.h" 28 #include "core/dom/NodeRareData.h"
29 29
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
39 {
40 return ownerNode();
41 }
42
38 ChildNodeList::~ChildNodeList() 43 ChildNodeList::~ChildNodeList()
39 { 44 {
40 m_parent->nodeLists()->removeChildNodeList(this); 45 m_parent->nodeLists()->removeChildNodeList(this);
41 } 46 }
42 47
43 Node* ChildNodeList::itemBefore(const Node* previous) const 48 Node* ChildNodeList::itemBefore(const Node* previous) const
44 { 49 {
45 return LIKELY(!!previous) ? previous->previousSibling() : rootNode().lastChi ld(); 50 return LIKELY(!!previous) ? previous->previousSibling() : rootNode().lastChi ld();
46 } 51 }
47 52
48 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
49 { 54 {
50 ASSERT(currentOffset < offset); 55 ASSERT(currentOffset < offset);
51 Node* next = &currentNode; 56 Node* next = &currentNode;
52 while ((next = next->nextSibling())) { 57 while ((next = next->nextSibling())) {
53 if (++currentOffset == offset) 58 if (++currentOffset == offset)
54 return next; 59 return next;
55 } 60 }
56 return 0; 61 return 0;
57 } 62 }
58 63
59 } // namespace WebCore 64 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698