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

Side by Side Diff: Source/core/editing/iterators/BitStack.cpp

Issue 926193003: Move rendering/RenderBox to layout/LayoutBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/editing/EditorCommand.cpp ('k') | Source/core/editing/iterators/TextIterator.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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
3 * Copyright (C) 2005 Alexey Proskuryakov. 3 * Copyright (C) 2005 Alexey Proskuryakov.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 11 matching lines...) Expand all
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #include "config.h" 27 #include "config.h"
28 #include "core/editing/iterators/BitStack.h" 28 #include "core/editing/iterators/BitStack.h"
29 29
30 #include "core/dom/ContainerNode.h" 30 #include "core/dom/ContainerNode.h"
31 #include "core/dom/Node.h" 31 #include "core/dom/Node.h"
32 #include "core/layout/LayoutBox.h"
32 #include "core/layout/LayoutObject.h" 33 #include "core/layout/LayoutObject.h"
33 #include "core/rendering/RenderBox.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 static const unsigned bitsInWord = sizeof(unsigned) * 8; 37 static const unsigned bitsInWord = sizeof(unsigned) * 8;
38 static const unsigned bitInWordMask = bitsInWord - 1; 38 static const unsigned bitInWordMask = bitsInWord - 1;
39 39
40 #if ENABLE(ASSERT) 40 #if ENABLE(ASSERT)
41 static unsigned depthCrossingShadowBoundaries(Node* node) 41 static unsigned depthCrossingShadowBoundaries(Node* node)
42 { 42 {
43 unsigned depth = 0; 43 unsigned depth = 0;
44 for (ContainerNode* parent = node->parentOrShadowHostNode(); parent; parent = parent->parentOrShadowHostNode()) 44 for (ContainerNode* parent = node->parentOrShadowHostNode(); parent; parent = parent->parentOrShadowHostNode())
45 ++depth; 45 ++depth;
46 return depth; 46 return depth;
47 } 47 }
48 #endif 48 #endif
49 49
50 static inline bool fullyClipsContents(Node* node) 50 static inline bool fullyClipsContents(Node* node)
51 { 51 {
52 LayoutObject* renderer = node->renderer(); 52 LayoutObject* renderer = node->renderer();
53 if (!renderer || !renderer->isBox() || !renderer->hasOverflowClip()) 53 if (!renderer || !renderer->isBox() || !renderer->hasOverflowClip())
54 return false; 54 return false;
55 return toRenderBox(renderer)->size().isEmpty(); 55 return toLayoutBox(renderer)->size().isEmpty();
56 } 56 }
57 57
58 static inline bool ignoresContainerClip(Node* node) 58 static inline bool ignoresContainerClip(Node* node)
59 { 59 {
60 LayoutObject* renderer = node->renderer(); 60 LayoutObject* renderer = node->renderer();
61 if (!renderer || renderer->isText()) 61 if (!renderer || renderer->isText())
62 return false; 62 return false;
63 return renderer->style()->hasOutOfFlowPosition(); 63 return renderer->style()->hasOutOfFlowPosition();
64 } 64 }
65 65
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // Call pushFullyClippedState on each node starting with the earliest ancest or. 137 // Call pushFullyClippedState on each node starting with the earliest ancest or.
138 size_t ancestrySize = ancestry.size(); 138 size_t ancestrySize = ancestry.size();
139 for (size_t i = 0; i < ancestrySize; ++i) 139 for (size_t i = 0; i < ancestrySize; ++i)
140 pushFullyClippedState(ancestry[ancestrySize - i - 1]); 140 pushFullyClippedState(ancestry[ancestrySize - i - 1]);
141 pushFullyClippedState(node); 141 pushFullyClippedState(node);
142 142
143 ASSERT(size() == 1 + depthCrossingShadowBoundaries(node)); 143 ASSERT(size() == 1 + depthCrossingShadowBoundaries(node));
144 } 144 }
145 145
146 } // namespace blink 146 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/EditorCommand.cpp ('k') | Source/core/editing/iterators/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698