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

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

Issue 583023002: Move paint code from RenderBlockFlow into BlockFlowPainter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix Created 6 years, 3 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/paint/BlockFlowPainter.cpp ('k') | Source/core/rendering/RenderBlockFlow.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-2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2003-2013 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * Copyright (C) 2013 Google Inc. All rights reserved. 7 * Copyright (C) 2013 Google Inc. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are 10 * modification, are permitted provided that the following conditions are
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 void computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, Layout Unit& maxLogicalWidth); 179 void computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, Layout Unit& maxLogicalWidth);
180 180
181 GapRects inlineSelectionGaps(const RenderBlock* rootBlock, const LayoutPoint & rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, 181 GapRects inlineSelectionGaps(const RenderBlock* rootBlock, const LayoutPoint & rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
182 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las tLogicalRight, const PaintInfo*) const; 182 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las tLogicalRight, const PaintInfo*) const;
183 183
184 LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_pagin ationStrut : LayoutUnit(); } 184 LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_pagin ationStrut : LayoutUnit(); }
185 void setPaginationStrut(LayoutUnit); 185 void setPaginationStrut(LayoutUnit);
186 186
187 virtual bool avoidsFloats() const OVERRIDE; 187 virtual bool avoidsFloats() const OVERRIDE;
188 188
189 LayoutUnit xPositionForFloatIncludingMargin(const FloatingObject* child) con st
190 {
191 if (isHorizontalWritingMode())
192 return child->x() + child->renderer()->marginLeft();
193
194 return child->x() + marginBeforeForChild(child->renderer());
195 }
196
197 LayoutUnit yPositionForFloatIncludingMargin(const FloatingObject* child) con st
198 {
199 if (isHorizontalWritingMode())
200 return child->y() + marginBeforeForChild(child->renderer());
201
202 return child->y() + child->renderer()->marginTop();
203 }
204
205 LayoutPoint flipFloatForWritingModeForChild(const FloatingObject*, const Lay outPoint&) const;
206
189 protected: 207 protected:
190 void rebuildFloatsFromIntruding(); 208 void rebuildFloatsFromIntruding();
191 void layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidati onLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge); 209 void layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidati onLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge);
192 210
193 void createFloatingObjects(); 211 void createFloatingObjects();
194 212
195 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) O VERRIDE; 213 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) O VERRIDE;
196 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE; 214 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE;
197 215
198 void addOverflowFromFloats(); 216 void addOverflowFromFloats();
(...skipping 15 matching lines...) Expand all
214 void determineLogicalLeftPositionForChild(RenderBox* child); 232 void determineLogicalLeftPositionForChild(RenderBox* child);
215 233
216 private: 234 private:
217 bool layoutBlockFlow(bool relayoutChildren, LayoutUnit& pageLogicalHeight, S ubtreeLayoutScope&); 235 bool layoutBlockFlow(bool relayoutChildren, LayoutUnit& pageLogicalHeight, S ubtreeLayoutScope&);
218 void layoutBlockChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutU nit beforeEdge, LayoutUnit afterEdge); 236 void layoutBlockChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutU nit beforeEdge, LayoutUnit afterEdge);
219 237
220 void layoutBlockChild(RenderBox* child, MarginInfo&, LayoutUnit& previousFlo atLogicalBottom); 238 void layoutBlockChild(RenderBox* child, MarginInfo&, LayoutUnit& previousFlo atLogicalBottom);
221 void adjustPositionedBlock(RenderBox* child, const MarginInfo&); 239 void adjustPositionedBlock(RenderBox* child, const MarginInfo&);
222 void adjustFloatingBlock(const MarginInfo&); 240 void adjustFloatingBlock(const MarginInfo&);
223 241
224 LayoutPoint flipFloatForWritingModeForChild(const FloatingObject*, const Lay outPoint&) const;
225
226 LayoutUnit xPositionForFloatIncludingMargin(const FloatingObject* child) con st
227 {
228 if (isHorizontalWritingMode())
229 return child->x() + child->renderer()->marginLeft();
230
231 return child->x() + marginBeforeForChild(child->renderer());
232 }
233
234 LayoutUnit yPositionForFloatIncludingMargin(const FloatingObject* child) con st
235 {
236 if (isHorizontalWritingMode())
237 return child->y() + marginBeforeForChild(child->renderer());
238
239 return child->y() + child->renderer()->marginTop();
240 }
241
242 LayoutPoint computeLogicalLocationForFloat(const FloatingObject*, LayoutUnit logicalTopOffset) const; 242 LayoutPoint computeLogicalLocationForFloat(const FloatingObject*, LayoutUnit logicalTopOffset) const;
243 243
244 FloatingObject* insertFloatingObject(RenderBox*); 244 FloatingObject* insertFloatingObject(RenderBox*);
245 void removeFloatingObject(RenderBox*); 245 void removeFloatingObject(RenderBox*);
246 void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset); 246 void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset);
247 247
248 // Called from lineWidth, to position the floats added in the last line. 248 // Called from lineWidth, to position the floats added in the last line.
249 // Returns true if and only if it has positioned any floats. 249 // Returns true if and only if it has positioned any floats.
250 bool positionNewFloats(); 250 bool positionNewFloats();
251 251
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 386
387 RawPtrWillBeMember<RenderMultiColumnFlowThread> m_multiColumnFlowThread; 387 RawPtrWillBeMember<RenderMultiColumnFlowThread> m_multiColumnFlowThread;
388 388
389 int m_lineBreakToAvoidWidow; 389 int m_lineBreakToAvoidWidow;
390 bool m_didBreakAtLineToAvoidWidow : 1; 390 bool m_didBreakAtLineToAvoidWidow : 1;
391 bool m_discardMarginBefore : 1; 391 bool m_discardMarginBefore : 1;
392 bool m_discardMarginAfter : 1; 392 bool m_discardMarginAfter : 1;
393 }; 393 };
394 LayoutUnit marginOffsetForSelfCollapsingBlock(); 394 LayoutUnit marginOffsetForSelfCollapsingBlock();
395 395
396 FloatingObjects* floatingObjects() { return m_floatingObjects.get(); }
397
398
396 protected: 399 protected:
397 LayoutUnit maxPositiveMarginBefore() const { return m_rareData ? m_rareData- >m_margins.positiveMarginBefore() : RenderBlockFlowRareData::positiveMarginBefor eDefault(this); } 400 LayoutUnit maxPositiveMarginBefore() const { return m_rareData ? m_rareData- >m_margins.positiveMarginBefore() : RenderBlockFlowRareData::positiveMarginBefor eDefault(this); }
398 LayoutUnit maxNegativeMarginBefore() const { return m_rareData ? m_rareData- >m_margins.negativeMarginBefore() : RenderBlockFlowRareData::negativeMarginBefor eDefault(this); } 401 LayoutUnit maxNegativeMarginBefore() const { return m_rareData ? m_rareData- >m_margins.negativeMarginBefore() : RenderBlockFlowRareData::negativeMarginBefor eDefault(this); }
399 LayoutUnit maxPositiveMarginAfter() const { return m_rareData ? m_rareData-> m_margins.positiveMarginAfter() : RenderBlockFlowRareData::positiveMarginAfterDe fault(this); } 402 LayoutUnit maxPositiveMarginAfter() const { return m_rareData ? m_rareData-> m_margins.positiveMarginAfter() : RenderBlockFlowRareData::positiveMarginAfterDe fault(this); }
400 LayoutUnit maxNegativeMarginAfter() const { return m_rareData ? m_rareData-> m_margins.negativeMarginAfter() : RenderBlockFlowRareData::negativeMarginAfterDe fault(this); } 403 LayoutUnit maxNegativeMarginAfter() const { return m_rareData ? m_rareData-> m_margins.negativeMarginAfter() : RenderBlockFlowRareData::negativeMarginAfterDe fault(this); }
401 404
402 void setMaxMarginBeforeValues(LayoutUnit pos, LayoutUnit neg); 405 void setMaxMarginBeforeValues(LayoutUnit pos, LayoutUnit neg);
403 void setMaxMarginAfterValues(LayoutUnit pos, LayoutUnit neg); 406 void setMaxMarginAfterValues(LayoutUnit pos, LayoutUnit neg);
404 407
405 void setMustDiscardMarginBefore(bool = true); 408 void setMustDiscardMarginBefore(bool = true);
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 501
499 // END METHODS DEFINED IN RenderBlockLineLayout 502 // END METHODS DEFINED IN RenderBlockLineLayout
500 503
501 }; 504 };
502 505
503 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow()); 506 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow());
504 507
505 } // namespace blink 508 } // namespace blink
506 509
507 #endif // RenderBlockFlow_h 510 #endif // RenderBlockFlow_h
OLDNEW
« no previous file with comments | « Source/core/paint/BlockFlowPainter.cpp ('k') | Source/core/rendering/RenderBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698