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

Side by Side Diff: Source/core/layout/LayoutBlockFlow.h

Issue 1162383003: C++11: Replace 0 with nullptr where applicable in layout code. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add one more file. Created 5 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
« no previous file with comments | « Source/core/layout/LayoutBlock.cpp ('k') | Source/core/layout/LayoutBlockFlow.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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 using LayoutBlock::firstLineBox; 98 using LayoutBlock::firstLineBox;
99 using LayoutBlock::lastLineBox; 99 using LayoutBlock::lastLineBox;
100 using LayoutBlock::firstRootBox; 100 using LayoutBlock::firstRootBox;
101 using LayoutBlock::lastRootBox; 101 using LayoutBlock::lastRootBox;
102 102
103 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const override; 103 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const override;
104 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const override; 104 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const override;
105 105
106 RootInlineBox* createAndAppendRootInlineBox(); 106 RootInlineBox* createAndAppendRootInlineBox();
107 107
108 void markAllDescendantsWithFloatsForLayout(LayoutBox* floatToRemove = 0, boo l inLayout = true); 108 void markAllDescendantsWithFloatsForLayout(LayoutBox* floatToRemove = nullpt r, bool inLayout = true);
109 void markSiblingsWithFloatsForLayout(LayoutBox* floatToRemove = 0); 109 void markSiblingsWithFloatsForLayout(LayoutBox* floatToRemove = nullptr);
110 110
111 bool containsFloats() const { return m_floatingObjects && !m_floatingObjects ->set().isEmpty(); } 111 bool containsFloats() const { return m_floatingObjects && !m_floatingObjects ->set().isEmpty(); }
112 bool containsFloat(LayoutBox*) const; 112 bool containsFloat(LayoutBox*) const;
113 113
114 void removeFloatingObjects(); 114 void removeFloatingObjects();
115 115
116 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = 0) override; 116 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = nu llptr) override;
117 117
118 void moveAllChildrenIncludingFloatsTo(LayoutBlock* toBlock, bool fullRemoveI nsert); 118 void moveAllChildrenIncludingFloatsTo(LayoutBlock* toBlock, bool fullRemoveI nsert);
119 119
120 bool generatesLineBoxesForInlineChild(LayoutObject*); 120 bool generatesLineBoxesForInlineChild(LayoutObject*);
121 121
122 LayoutUnit logicalTopForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->y() : floatingObject->x(); } 122 LayoutUnit logicalTopForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->y() : floatingObject->x(); }
123 LayoutUnit logicalBottomForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->maxY() : floatingObject->m axX(); } 123 LayoutUnit logicalBottomForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->maxY() : floatingObject->m axX(); }
124 LayoutUnit logicalLeftForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->x() : floatingObject->y(); } 124 LayoutUnit logicalLeftForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->x() : floatingObject->y(); }
125 LayoutUnit logicalRightForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->maxX() : floatingObject->ma xY(); } 125 LayoutUnit logicalRightForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->maxX() : floatingObject->ma xY(); }
126 LayoutUnit logicalWidthForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->width() : floatingObject->h eight(); } 126 LayoutUnit logicalWidthForFloat(const FloatingObject* floatingObject) const { return isHorizontalWritingMode() ? floatingObject->width() : floatingObject->h eight(); }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 LayoutRect logicalLeftSelectionGap(const LayoutBlock* rootBlock, const Layou tPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, 183 LayoutRect logicalLeftSelectionGap(const LayoutBlock* rootBlock, const Layou tPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
184 const LayoutObject* selObj, LayoutUnit logicalLeft, LayoutUnit logicalTo p, LayoutUnit logicalHeight, const PaintInfo*) const; 184 const LayoutObject* selObj, LayoutUnit logicalLeft, LayoutUnit logicalTo p, LayoutUnit logicalHeight, const PaintInfo*) const;
185 LayoutRect logicalRightSelectionGap(const LayoutBlock* rootBlock, const Layo utPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, 185 LayoutRect logicalRightSelectionGap(const LayoutBlock* rootBlock, const Layo utPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
186 const LayoutObject* selObj, LayoutUnit logicalRight, LayoutUnit logicalT op, LayoutUnit logicalHeight, const PaintInfo*) const; 186 const LayoutObject* selObj, LayoutUnit logicalRight, LayoutUnit logicalT op, LayoutUnit logicalHeight, const PaintInfo*) const;
187 void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap) cons t; 187 void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap) cons t;
188 188
189 virtual LayoutRect selectionRectForPaintInvalidation(const LayoutBoxModelObj ect* paintInvalidationContainer) const override final; 189 virtual LayoutRect selectionRectForPaintInvalidation(const LayoutBoxModelObj ect* paintInvalidationContainer) const override final;
190 GapRects selectionGapRectsForPaintInvalidation(const LayoutBoxModelObject* p aintInvalidationContainer) const; 190 GapRects selectionGapRectsForPaintInvalidation(const LayoutBoxModelObject* p aintInvalidationContainer) const;
191 GapRects selectionGaps(const LayoutBlock* rootBlock, const LayoutPoint& root BlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, 191 GapRects selectionGaps(const LayoutBlock* rootBlock, const LayoutPoint& root BlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
192 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las tLogicalRight, 192 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las tLogicalRight,
193 const PaintInfo* = 0, ClipScope* = 0) const; 193 const PaintInfo* = nullptr, ClipScope* = nullptr) const;
194 GapRects inlineSelectionGaps(const LayoutBlock* rootBlock, const LayoutPoint & rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, 194 GapRects inlineSelectionGaps(const LayoutBlock* rootBlock, const LayoutPoint & rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
195 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las tLogicalRight, const PaintInfo*) const; 195 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las tLogicalRight, const PaintInfo*) const;
196 GapRects blockSelectionGaps(const LayoutBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, 196 GapRects blockSelectionGaps(const LayoutBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
197 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las tLogicalRight, const PaintInfo*) const; 197 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las tLogicalRight, const PaintInfo*) const;
198 LayoutRect blockSelectionGap(const LayoutBlock* rootBlock, const LayoutPoint & rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, 198 LayoutRect blockSelectionGap(const LayoutBlock* rootBlock, const LayoutPoint & rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
199 LayoutUnit lastLogicalTop, LayoutUnit lastLogicalLeft, LayoutUnit lastLo gicalRight, LayoutUnit logicalBottom, const PaintInfo*) const; 199 LayoutUnit lastLogicalTop, LayoutUnit lastLogicalLeft, LayoutUnit lastLo gicalRight, LayoutUnit logicalBottom, const PaintInfo*) const;
200 200
201 LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_pagin ationStrut : LayoutUnit(); } 201 LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_pagin ationStrut : LayoutUnit(); }
202 void setPaginationStrut(LayoutUnit); 202 void setPaginationStrut(LayoutUnit);
203 203
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 void adjustFloatingBlock(const MarginInfo&); 277 void adjustFloatingBlock(const MarginInfo&);
278 278
279 LayoutPoint computeLogicalLocationForFloat(const FloatingObject*, LayoutUnit logicalTopOffset) const; 279 LayoutPoint computeLogicalLocationForFloat(const FloatingObject*, LayoutUnit logicalTopOffset) const;
280 280
281 FloatingObject* insertFloatingObject(LayoutBox&); 281 FloatingObject* insertFloatingObject(LayoutBox&);
282 void removeFloatingObject(LayoutBox*); 282 void removeFloatingObject(LayoutBox*);
283 void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset); 283 void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset);
284 284
285 // Called from lineWidth, to position the floats added in the last line. 285 // Called from lineWidth, to position the floats added in the last line.
286 // Returns true if and only if it has positioned any floats. 286 // Returns true if and only if it has positioned any floats.
287 bool positionNewFloats(LineWidth* = 0); 287 bool positionNewFloats(LineWidth* = nullptr);
288 288
289 LayoutUnit getClearDelta(LayoutBox* child, LayoutUnit yPos); 289 LayoutUnit getClearDelta(LayoutBox* child, LayoutUnit yPos);
290 290
291 bool hasOverhangingFloats() { return parent() && containsFloats() && lowestF loatLogicalBottom() > logicalHeight(); } 291 bool hasOverhangingFloats() { return parent() && containsFloats() && lowestF loatLogicalBottom() > logicalHeight(); }
292 bool hasOverhangingFloat(LayoutBox*); 292 bool hasOverhangingFloat(LayoutBox*);
293 void addIntrudingFloats(LayoutBlockFlow* prev, LayoutUnit xoffset, LayoutUni t yoffset); 293 void addIntrudingFloats(LayoutBlockFlow* prev, LayoutUnit xoffset, LayoutUni t yoffset);
294 void addOverhangingFloats(LayoutBlockFlow* child, bool makeChildPaintOtherFl oats); 294 void addOverhangingFloats(LayoutBlockFlow* child, bool makeChildPaintOtherFl oats);
295 295
296 LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type = FloatingObject::F loatLeftRight) const; 296 LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type = FloatingObject::F loatLeftRight) const;
297 LayoutUnit nextFloatLogicalBottomBelow(LayoutUnit, ShapeOutsideFloatOffsetMo de = ShapeOutsideFloatMarginBoxOffset) const; 297 LayoutUnit nextFloatLogicalBottomBelow(LayoutUnit, ShapeOutsideFloatOffsetMo de = ShapeOutsideFloatMarginBoxOffset) const;
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 537
538 // END METHODS DEFINED IN LayoutBlockFlowLine 538 // END METHODS DEFINED IN LayoutBlockFlowLine
539 539
540 }; 540 };
541 541
542 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlockFlow, isLayoutBlockFlow()); 542 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlockFlow, isLayoutBlockFlow());
543 543
544 } // namespace blink 544 } // namespace blink
545 545
546 #endif // LayoutBlockFlow_h 546 #endif // LayoutBlockFlow_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBlock.cpp ('k') | Source/core/layout/LayoutBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698