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

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

Issue 166033005: Port Node's previousElementSibling() / nextElementSibling() to ElementTraversal (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase 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
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/editing/CompositeEditCommand.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 23 matching lines...) Expand all
34 #include "core/dom/Attribute.h" 34 #include "core/dom/Attribute.h"
35 #include "core/dom/ChildListMutationScope.h" 35 #include "core/dom/ChildListMutationScope.h"
36 #include "core/dom/ChildNodeList.h" 36 #include "core/dom/ChildNodeList.h"
37 #include "core/dom/DOMImplementation.h" 37 #include "core/dom/DOMImplementation.h"
38 #include "core/dom/Document.h" 38 #include "core/dom/Document.h"
39 #include "core/dom/DocumentFragment.h" 39 #include "core/dom/DocumentFragment.h"
40 #include "core/dom/DocumentMarkerController.h" 40 #include "core/dom/DocumentMarkerController.h"
41 #include "core/dom/DocumentType.h" 41 #include "core/dom/DocumentType.h"
42 #include "core/dom/Element.h" 42 #include "core/dom/Element.h"
43 #include "core/dom/ElementRareData.h" 43 #include "core/dom/ElementRareData.h"
44 #include "core/dom/ElementTraversal.h"
44 #include "core/dom/ExceptionCode.h" 45 #include "core/dom/ExceptionCode.h"
45 #include "core/dom/LiveNodeList.h" 46 #include "core/dom/LiveNodeList.h"
46 #include "core/dom/NodeRareData.h" 47 #include "core/dom/NodeRareData.h"
47 #include "core/dom/NodeRenderingTraversal.h" 48 #include "core/dom/NodeRenderingTraversal.h"
48 #include "core/dom/NodeTraversal.h" 49 #include "core/dom/NodeTraversal.h"
49 #include "core/dom/ProcessingInstruction.h" 50 #include "core/dom/ProcessingInstruction.h"
50 #include "core/dom/Range.h" 51 #include "core/dom/Range.h"
51 #include "core/dom/StaticNodeList.h" 52 #include "core/dom/StaticNodeList.h"
52 #include "core/dom/TemplateContentDocumentFragment.h" 53 #include "core/dom/TemplateContentDocumentFragment.h"
53 #include "core/dom/Text.h" 54 #include "core/dom/Text.h"
(...skipping 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after
2541 } 2542 }
2542 2543
2543 ASSERT(isHTMLElement() || isSVGElement()); 2544 ASSERT(isHTMLElement() || isSVGElement());
2544 setFlag(CustomElement); 2545 setFlag(CustomElement);
2545 setFlag(newState == Upgraded, CustomElementUpgraded); 2546 setFlag(newState == Upgraded, CustomElementUpgraded);
2546 2547
2547 if (oldState == NotCustomElement || newState == Upgraded) 2548 if (oldState == NotCustomElement || newState == Upgraded)
2548 setNeedsStyleRecalc(SubtreeStyleChange); // :unresolved has changed 2549 setNeedsStyleRecalc(SubtreeStyleChange); // :unresolved has changed
2549 } 2550 }
2550 2551
2552 Element* Node::previousElementSibling() const
2553 {
2554 return ElementTraversal::previousSibling(*this);
2555 }
2556
2557 Element* Node::nextElementSibling() const
2558 {
2559 return ElementTraversal::nextSibling(*this);
2560 }
2561
2551 } // namespace WebCore 2562 } // namespace WebCore
2552 2563
2553 #ifndef NDEBUG 2564 #ifndef NDEBUG
2554 2565
2555 void showTree(const WebCore::Node* node) 2566 void showTree(const WebCore::Node* node)
2556 { 2567 {
2557 if (node) 2568 if (node)
2558 node->showTreeForThis(); 2569 node->showTreeForThis();
2559 } 2570 }
2560 2571
2561 void showNodePath(const WebCore::Node* node) 2572 void showNodePath(const WebCore::Node* node)
2562 { 2573 {
2563 if (node) 2574 if (node)
2564 node->showNodePathForThis(); 2575 node->showNodePathForThis();
2565 } 2576 }
2566 2577
2567 #endif 2578 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/editing/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698