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

Side by Side Diff: sky/engine/core/rendering/RenderBlock.h

Issue 762073002: Split more Paragraph-specific code from RenderBlock into RenderParagraph (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cr comments Created 6 years 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 | « no previous file | sky/engine/core/rendering/RenderBlock.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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 static void clearPercentHeightDescendantsFrom(RenderBox*); 114 static void clearPercentHeightDescendantsFrom(RenderBox*);
115 static void removePercentHeightDescendantIfNeeded(RenderBox*); 115 static void removePercentHeightDescendantIfNeeded(RenderBox*);
116 116
117 TrackedRendererListHashSet* percentHeightDescendants() const; 117 TrackedRendererListHashSet* percentHeightDescendants() const;
118 bool hasPercentHeightDescendants() const 118 bool hasPercentHeightDescendants() const
119 { 119 {
120 TrackedRendererListHashSet* descendants = percentHeightDescendants(); 120 TrackedRendererListHashSet* descendants = percentHeightDescendants();
121 return descendants && !descendants->isEmpty(); 121 return descendants && !descendants->isEmpty();
122 } 122 }
123 123
124 void setHasMarkupTruncation(bool b) { m_hasMarkupTruncation = b; }
125 bool hasMarkupTruncation() const { return m_hasMarkupTruncation; }
126
127 void setHasMarginBeforeQuirk(bool b) { m_hasMarginBeforeQuirk = b; } 124 void setHasMarginBeforeQuirk(bool b) { m_hasMarginBeforeQuirk = b; }
128 void setHasMarginAfterQuirk(bool b) { m_hasMarginAfterQuirk = b; } 125 void setHasMarginAfterQuirk(bool b) { m_hasMarginAfterQuirk = b; }
129 126
130 bool hasMarginBeforeQuirk() const { return m_hasMarginBeforeQuirk; } 127 bool hasMarginBeforeQuirk() const { return m_hasMarginBeforeQuirk; }
131 bool hasMarginAfterQuirk() const { return m_hasMarginAfterQuirk; } 128 bool hasMarginAfterQuirk() const { return m_hasMarginAfterQuirk; }
132 129
133 bool hasMarginBeforeQuirk(const RenderBox* child) const; 130 bool hasMarginBeforeQuirk(const RenderBox* child) const;
134 bool hasMarginAfterQuirk(const RenderBox* child) const; 131 bool hasMarginAfterQuirk(const RenderBox* child) const;
135 132
136 void markPositionedObjectsForLayout(); 133 void markPositionedObjectsForLayout();
(...skipping 15 matching lines...) Expand all
152 LayoutRect logicalRightSelectionGap(RenderBlock* rootBlock, const LayoutPoin t& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, 149 LayoutRect logicalRightSelectionGap(RenderBlock* rootBlock, const LayoutPoin t& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
153 RenderObject* selObj, LayoutUnit logical Right, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*); 150 RenderObject* selObj, LayoutUnit logical Right, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*);
154 void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap); 151 void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap);
155 RenderBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const; 152 RenderBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const;
156 153
157 virtual void setSelectionState(SelectionState) override; 154 virtual void setSelectionState(SelectionState) override;
158 155
159 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co nst LayoutRect& logicalRect); 156 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co nst LayoutRect& logicalRect);
160 157
161 // Helper methods for computing line counts and heights for line counts. 158 // Helper methods for computing line counts and heights for line counts.
162 RootInlineBox* lineAtIndex(int) const; 159 virtual RootInlineBox* lineAtIndex(int) const;
163 int lineCount(const RootInlineBox* = 0, bool* = 0) const; 160 virtual int lineCount(const RootInlineBox* = 0, bool* = 0) const;
164 int heightForLineCount(int);
165 void clearTruncation(); 161 void clearTruncation();
166 162
167 static RenderBlock* createAnonymousWithParentRendererAndDisplay(const Render Object*, EDisplay = PARAGRAPH); 163 static RenderBlock* createAnonymousWithParentRendererAndDisplay(const Render Object*, EDisplay = PARAGRAPH);
168 RenderBlock* createAnonymousBlock(EDisplay display = PARAGRAPH) const { retu rn createAnonymousWithParentRendererAndDisplay(this, display); } 164 RenderBlock* createAnonymousBlock(EDisplay display = PARAGRAPH) const { retu rn createAnonymousWithParentRendererAndDisplay(this, display); }
169 165
170 // Accessors for logical width/height and margins in the containing block's block-flow direction. 166 // Accessors for logical width/height and margins in the containing block's block-flow direction.
171 LayoutUnit logicalWidthForChild(const RenderBox* child) const { return child ->width(); } 167 LayoutUnit logicalWidthForChild(const RenderBox* child) const { return child ->width(); }
172 LayoutUnit logicalHeightForChild(const RenderBox* child) const { return chil d->height(); } 168 LayoutUnit logicalHeightForChild(const RenderBox* child) const { return chil d->height(); }
173 LayoutSize logicalSizeForChild(const RenderBox* child) const { return child- >size(); } 169 LayoutSize logicalSizeForChild(const RenderBox* child) const { return child- >size(); }
174 LayoutUnit logicalTopForChild(const RenderBox* child) const { return child-> y(); } 170 LayoutUnit logicalTopForChild(const RenderBox* child) const { return child-> y(); }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 void paintChild(RenderBox*, PaintInfo&, const LayoutPoint&); 228 void paintChild(RenderBox*, PaintInfo&, const LayoutPoint&);
233 void paintChildAsInlineBlock(RenderBox*, PaintInfo&, const LayoutPoint&); 229 void paintChildAsInlineBlock(RenderBox*, PaintInfo&, const LayoutPoint&);
234 230
235 virtual void adjustInlineDirectionLineBounds(unsigned /* expansionOpportunit yCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { } 231 virtual void adjustInlineDirectionLineBounds(unsigned /* expansionOpportunit yCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { }
236 232
237 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo utUnit& maxLogicalWidth) const override; 233 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo utUnit& maxLogicalWidth) const override;
238 virtual void computePreferredLogicalWidths() override; 234 virtual void computePreferredLogicalWidths() override;
239 235
240 virtual int firstLineBoxBaseline() const override; 236 virtual int firstLineBoxBaseline() const override;
241 virtual int inlineBlockBaseline(LineDirectionMode) const override; 237 virtual int inlineBlockBaseline(LineDirectionMode) const override;
242 int lastLineBoxBaseline(LineDirectionMode) const; 238 virtual int lastLineBoxBaseline(LineDirectionMode) const;
243 239
244 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid e; 240 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid e;
245 241
246 // Delay update scrollbar until finishDelayUpdateScrollInfo() will be 242 // Delay update scrollbar until finishDelayUpdateScrollInfo() will be
247 // called. This function is used when a flexbox is laying out its 243 // called. This function is used when a flexbox is laying out its
248 // descendant. If multiple calls are made to startDelayUpdateScrollInfo(), 244 // descendant. If multiple calls are made to startDelayUpdateScrollInfo(),
249 // finishDelayUpdateScrollInfo() will do nothing until finishDelayUpdateScro llInfo() 245 // finishDelayUpdateScrollInfo() will do nothing until finishDelayUpdateScro llInfo()
250 // is called the same number of times. 246 // is called the same number of times.
251 static void startDelayUpdateScrollInfo(); 247 static void startDelayUpdateScrollInfo();
252 static void finishDelayUpdateScrollInfo(); 248 static void finishDelayUpdateScrollInfo();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 336
341 protected: 337 protected:
342 RenderObjectChildList m_children; 338 RenderObjectChildList m_children;
343 RenderLineBoxList m_lineBoxes; // All of the root line boxes created for t his block flow. For example, <div>Hello<br>world.</div> will have two total lin es for the <div>. 339 RenderLineBoxList m_lineBoxes; // All of the root line boxes created for t his block flow. For example, <div>Hello<br>world.</div> will have two total lin es for the <div>.
344 340
345 LayoutUnit m_pageLogicalOffset; 341 LayoutUnit m_pageLogicalOffset;
346 342
347 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put in RenderBlockRareData since they are set too frequently. 343 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put in RenderBlockRareData since they are set too frequently.
348 unsigned m_hasMarginAfterQuirk : 1; 344 unsigned m_hasMarginAfterQuirk : 1;
349 unsigned m_beingDestroyed : 1; 345 unsigned m_beingDestroyed : 1;
350 unsigned m_hasMarkupTruncation : 1;
351 unsigned m_hasBorderOrPaddingLogicalWidthChanged : 1; 346 unsigned m_hasBorderOrPaddingLogicalWidthChanged : 1;
352 347
353 // FIXME-BLOCKFLOW: Remove this when the line layout stuff has all moved out of RenderBlock 348 // FIXME-BLOCKFLOW: Remove this when the line layout stuff has all moved out of RenderBlock
354 friend class LineBreaker; 349 friend class LineBreaker;
355 350
356 // FIXME: This is temporary as we move code that accesses block flow 351 // FIXME: This is temporary as we move code that accesses block flow
357 // member variables out of RenderBlock and into RenderBlockFlow. 352 // member variables out of RenderBlock and into RenderBlockFlow.
358 friend class RenderBlockFlow; 353 friend class RenderBlockFlow;
359 friend class RenderParagraph; 354 friend class RenderParagraph;
360 }; 355 };
361 356
362 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock()); 357 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock());
363 358
364 } // namespace blink 359 } // namespace blink
365 360
366 #endif // SKY_ENGINE_CORE_RENDERING_RENDERBLOCK_H_ 361 #endif // SKY_ENGINE_CORE_RENDERING_RENDERBLOCK_H_
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698