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

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

Issue 17038004: Remove needsShadowTreeWalker flag (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/NodeRenderingTraversal.h ('k') | Source/core/dom/shadow/ElementShadow.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. 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 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 29 matching lines...) Expand all
40 m_insertionPoint = insertionPoint; 40 m_insertionPoint = insertionPoint;
41 m_resetStyleInheritance = m_resetStyleInheritance || insertionPoint->re setStyleInheritance(); 41 m_resetStyleInheritance = m_resetStyleInheritance || insertionPoint->re setStyleInheritance();
42 } 42 }
43 } 43 }
44 44
45 void ParentDetails::didTraverseShadowRoot(const ShadowRoot* root) 45 void ParentDetails::didTraverseShadowRoot(const ShadowRoot* root)
46 { 46 {
47 m_resetStyleInheritance = m_resetStyleInheritance || root->resetStyleInheri tance(); 47 m_resetStyleInheritance = m_resetStyleInheritance || root->resetStyleInheri tance();
48 } 48 }
49 49
50 ContainerNode* parentSlow(const Node* node, ParentDetails* details) 50 ContainerNode* parent(const Node* node, ParentDetails* details)
51 { 51 {
52 ComposedShadowTreeWalker walker(node, ComposedShadowTreeWalker::CrossUpperBo undary, ComposedShadowTreeWalker::CanStartFromShadowBoundary); 52 ComposedShadowTreeWalker walker(node, ComposedShadowTreeWalker::CrossUpperBo undary, ComposedShadowTreeWalker::CanStartFromShadowBoundary);
53 ContainerNode* found = toContainerNode(walker.traverseParent(walker.get(), d etails)); 53 ContainerNode* found = toContainerNode(walker.traverseParent(walker.get(), d etails));
54 return details->outOfComposition() ? 0 : found; 54 return details->outOfComposition() ? 0 : found;
55 } 55 }
56 56
57 Node* nextSiblingSlow(const Node* node) 57 Node* nextSibling(const Node* node)
58 { 58 {
59 ComposedShadowTreeWalker walker(node); 59 ComposedShadowTreeWalker walker(node);
60 if (node->isBeforePseudoElement()) { 60 if (node->isBeforePseudoElement()) {
61 walker.parent(); 61 walker.parent();
62 walker.firstChild(); 62 walker.firstChild();
63 } else 63 } else
64 walker.nextSibling(); 64 walker.nextSibling();
65 65
66 if (walker.get() || node->isAfterPseudoElement()) 66 if (walker.get() || node->isAfterPseudoElement())
67 return walker.get(); 67 return walker.get();
68 68
69 Node* parent = walker.traverseParent(node); 69 Node* parent = walker.traverseParent(node);
70 if (parent && parent->isElementNode()) 70 if (parent && parent->isElementNode())
71 return toElement(parent)->pseudoElement(AFTER); 71 return toElement(parent)->pseudoElement(AFTER);
72 72
73 return 0; 73 return 0;
74 } 74 }
75 75
76 Node* previousSiblingSlow(const Node* node) 76 Node* previousSibling(const Node* node)
77 { 77 {
78 ComposedShadowTreeWalker walker(node); 78 ComposedShadowTreeWalker walker(node);
79 if (node->isAfterPseudoElement()) { 79 if (node->isAfterPseudoElement()) {
80 walker.parent(); 80 walker.parent();
81 walker.lastChild(); 81 walker.lastChild();
82 } else 82 } else
83 walker.previousSibling(); 83 walker.previousSibling();
84 84
85 if (walker.get() || node->isBeforePseudoElement()) 85 if (walker.get() || node->isBeforePseudoElement())
86 return walker.get(); 86 return walker.get();
(...skipping 29 matching lines...) Expand all
116 Node* lastChildInScope(const Node* node) 116 Node* lastChildInScope(const Node* node)
117 { 117 {
118 ComposedShadowTreeWalker walker = ComposedShadowTreeWalker(node, ComposedSha dowTreeWalker::DoNotCrossUpperBoundary); 118 ComposedShadowTreeWalker walker = ComposedShadowTreeWalker(node, ComposedSha dowTreeWalker::DoNotCrossUpperBoundary);
119 walker.lastChild(); 119 walker.lastChild();
120 return walker.get(); 120 return walker.get();
121 } 121 }
122 122
123 } 123 }
124 124
125 } // namespace 125 } // namespace
OLDNEW
« no previous file with comments | « Source/core/dom/NodeRenderingTraversal.h ('k') | Source/core/dom/shadow/ElementShadow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698