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

Side by Side Diff: Source/core/rendering/LayoutState.h

Issue 327323002: Start removing the double-negative !ASSERT_DISABLED (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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/page/Page.cpp ('k') | Source/core/rendering/LayoutState.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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 28 matching lines...) Expand all
39 class RenderFlowThread; 39 class RenderFlowThread;
40 40
41 class LayoutState { 41 class LayoutState {
42 WTF_MAKE_NONCOPYABLE(LayoutState); 42 WTF_MAKE_NONCOPYABLE(LayoutState);
43 public: 43 public:
44 // Constructor for root LayoutState created by RenderView 44 // Constructor for root LayoutState created by RenderView
45 LayoutState(LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged) 45 LayoutState(LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged)
46 : m_clipped(false) 46 : m_clipped(false)
47 , m_isPaginated(pageLogicalHeight) 47 , m_isPaginated(pageLogicalHeight)
48 , m_pageLogicalHeightChanged(pageLogicalHeightChanged) 48 , m_pageLogicalHeightChanged(pageLogicalHeightChanged)
49 #if !ASSERT_DISABLED 49 #if ASSERT_ENABLED
50 , m_layoutDeltaXSaturated(false) 50 , m_layoutDeltaXSaturated(false)
51 , m_layoutDeltaYSaturated(false) 51 , m_layoutDeltaYSaturated(false)
52 #endif 52 #endif
53 , m_columnInfo(0) 53 , m_columnInfo(0)
54 , m_next(0) 54 , m_next(0)
55 , m_pageLogicalHeight(pageLogicalHeight) 55 , m_pageLogicalHeight(pageLogicalHeight)
56 #ifndef NDEBUG 56 #ifndef NDEBUG
57 , m_renderer(0) 57 , m_renderer(0)
58 #endif 58 #endif
59 { 59 {
(...skipping 13 matching lines...) Expand all
73 73
74 // The page logical offset is the object's offset from the top of the page i n the page progression 74 // The page logical offset is the object's offset from the top of the page i n the page progression
75 // direction (so an x-offset in vertical text and a y-offset for horizontal text). 75 // direction (so an x-offset in vertical text and a y-offset for horizontal text).
76 LayoutUnit pageLogicalOffset(const RenderBox&, const LayoutUnit& childLogica lOffset) const; 76 LayoutUnit pageLogicalOffset(const RenderBox&, const LayoutUnit& childLogica lOffset) const;
77 77
78 void addForcedColumnBreak(const RenderBox&, const LayoutUnit& childLogicalOf fset); 78 void addForcedColumnBreak(const RenderBox&, const LayoutUnit& childLogicalOf fset);
79 79
80 void addLayoutDelta(const LayoutSize& delta) 80 void addLayoutDelta(const LayoutSize& delta)
81 { 81 {
82 m_layoutDelta += delta; 82 m_layoutDelta += delta;
83 #if !ASSERT_DISABLED 83 #if ASSERT_ENABLED
84 m_layoutDeltaXSaturated |= m_layoutDelta.width() == LayoutUnit::max( ) || m_layoutDelta.width() == LayoutUnit::min(); 84 m_layoutDeltaXSaturated |= m_layoutDelta.width() == LayoutUnit::max( ) || m_layoutDelta.width() == LayoutUnit::min();
85 m_layoutDeltaYSaturated |= m_layoutDelta.height() == LayoutUnit::max () || m_layoutDelta.height() == LayoutUnit::min(); 85 m_layoutDeltaYSaturated |= m_layoutDelta.height() == LayoutUnit::max () || m_layoutDelta.height() == LayoutUnit::min();
86 #endif 86 #endif
87 } 87 }
88 88
89 void setColumnInfo(ColumnInfo* columnInfo) { m_columnInfo = columnInfo; } 89 void setColumnInfo(ColumnInfo* columnInfo) { m_columnInfo = columnInfo; }
90 90
91 const LayoutSize& layoutOffset() const { return m_layoutOffset; } 91 const LayoutSize& layoutOffset() const { return m_layoutOffset; }
92 const LayoutSize& layoutDelta() const { return m_layoutDelta; } 92 const LayoutSize& layoutDelta() const { return m_layoutDelta; }
93 const LayoutSize& pageOffset() const { return m_pageOffset; } 93 const LayoutSize& pageOffset() const { return m_pageOffset; }
94 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } 94 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; }
95 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } 95 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; }
96 96
97 LayoutState* next() const { return m_next; } 97 LayoutState* next() const { return m_next; }
98 98
99 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_isPaginat ed && m_pageLogicalHeight; } 99 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_isPaginat ed && m_pageLogicalHeight; }
100 100
101 ColumnInfo* columnInfo() const { return m_columnInfo; } 101 ColumnInfo* columnInfo() const { return m_columnInfo; }
102 102
103 const LayoutRect& clipRect() const { return m_clipRect; } 103 const LayoutRect& clipRect() const { return m_clipRect; }
104 const LayoutSize& paintOffset() const { return m_paintOffset; } 104 const LayoutSize& paintOffset() const { return m_paintOffset; }
105 105
106 #ifndef NDEBUG 106 #ifndef NDEBUG
107 RenderObject* renderer() const { return m_renderer; } 107 RenderObject* renderer() const { return m_renderer; }
108 #endif 108 #endif
109 #if !ASSERT_DISABLED 109 #if ASSERT_ENABLED
110 bool layoutDeltaXSaturated() const { return m_layoutDeltaXSaturated; } 110 bool layoutDeltaXSaturated() const { return m_layoutDeltaXSaturated; }
111 bool layoutDeltaYSaturated() const { return m_layoutDeltaYSaturated; } 111 bool layoutDeltaYSaturated() const { return m_layoutDeltaYSaturated; }
112 #endif 112 #endif
113 113
114 private: 114 private:
115 // Do not add anything apart from bitfields until after m_columnInfo. See ht tps://bugs.webkit.org/show_bug.cgi?id=100173 115 // Do not add anything apart from bitfields until after m_columnInfo. See ht tps://bugs.webkit.org/show_bug.cgi?id=100173
116 bool m_clipped:1; 116 bool m_clipped:1;
117 bool m_isPaginated:1; 117 bool m_isPaginated:1;
118 // If our page height has changed, this will force all blocks to relayout. 118 // If our page height has changed, this will force all blocks to relayout.
119 bool m_pageLogicalHeightChanged:1; 119 bool m_pageLogicalHeightChanged:1;
120 #if !ASSERT_DISABLED 120 #if ASSERT_ENABLED
121 bool m_layoutDeltaXSaturated:1; 121 bool m_layoutDeltaXSaturated:1;
122 bool m_layoutDeltaYSaturated:1; 122 bool m_layoutDeltaYSaturated:1;
123 #endif 123 #endif
124 // If the enclosing pagination model is a column model, then this will store column information for easy retrieval/manipulation. 124 // If the enclosing pagination model is a column model, then this will store column information for easy retrieval/manipulation.
125 ColumnInfo* m_columnInfo; 125 ColumnInfo* m_columnInfo;
126 LayoutState* m_next; 126 LayoutState* m_next;
127 127
128 // FIXME: Distinguish between the layout clip rect and the paint clip rect w hich may be larger, 128 // FIXME: Distinguish between the layout clip rect and the paint clip rect w hich may be larger,
129 // e.g., because of composited scrolling. 129 // e.g., because of composited scrolling.
130 LayoutRect m_clipRect; 130 LayoutRect m_clipRect;
(...skipping 13 matching lines...) Expand all
144 LayoutSize m_pageOffset; 144 LayoutSize m_pageOffset;
145 145
146 #ifndef NDEBUG 146 #ifndef NDEBUG
147 RenderObject* m_renderer; 147 RenderObject* m_renderer;
148 #endif 148 #endif
149 }; 149 };
150 150
151 } // namespace WebCore 151 } // namespace WebCore
152 152
153 #endif // LayoutState_h 153 #endif // LayoutState_h
OLDNEW
« no previous file with comments | « Source/core/page/Page.cpp ('k') | Source/core/rendering/LayoutState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698