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

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

Issue 147233002: Remove internal recursion for RenderBlockFlow and RenderMultiColumnBlock layout (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make the shouldRelayout* methods const and add comment for the while loop Created 6 years, 11 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
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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(lo gicalTop, fixedOffset, logicalHeight), applyTextIndent); 249 return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(lo gicalTop, fixedOffset, logicalHeight), applyTextIndent);
250 } 250 }
251 LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedO ffset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const 251 LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedO ffset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const
252 { 252 {
253 return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logi calTop, fixedOffset, logicalHeight), applyTextIndent); 253 return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logi calTop, fixedOffset, logicalHeight), applyTextIndent);
254 } 254 }
255 255
256 virtual void insertedIntoTree() OVERRIDE; 256 virtual void insertedIntoTree() OVERRIDE;
257 virtual void willBeDestroyed() OVERRIDE; 257 virtual void willBeDestroyed() OVERRIDE;
258 private: 258 private:
259 void layoutBlockFlow(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0 ); 259 bool tryLayoutBlockFlow(bool relayoutChildren, LayoutUnit& pageLogicalHeight , SubtreeLayoutScope&);
260 void layoutBlockChildren(bool relayoutChildren, LayoutUnit& maxFloatLogicalB ottom, SubtreeLayoutScope&, LayoutUnit beforeEdge, LayoutUnit afterEdge); 260 void layoutBlockChildren(bool relayoutChildren, LayoutUnit& maxFloatLogicalB ottom, SubtreeLayoutScope&, LayoutUnit beforeEdge, LayoutUnit afterEdge);
261 261
262 void layoutBlockChild(RenderBox* child, MarginInfo&, LayoutUnit& previousFlo atLogicalBottom, LayoutUnit& maxFloatLogicalBottom); 262 void layoutBlockChild(RenderBox* child, MarginInfo&, LayoutUnit& previousFlo atLogicalBottom, LayoutUnit& maxFloatLogicalBottom);
263 void adjustPositionedBlock(RenderBox* child, const MarginInfo&); 263 void adjustPositionedBlock(RenderBox* child, const MarginInfo&);
264 void adjustFloatingBlock(const MarginInfo&); 264 void adjustFloatingBlock(const MarginInfo&);
265 265
266 LayoutPoint flipFloatForWritingModeForChild(const FloatingObject*, const Lay outPoint&) const; 266 LayoutPoint flipFloatForWritingModeForChild(const FloatingObject*, const Lay outPoint&) const;
267 267
268 LayoutUnit xPositionForFloatIncludingMargin(const FloatingObject* child) con st 268 LayoutUnit xPositionForFloatIncludingMargin(const FloatingObject* child) con st
269 { 269 {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 LayoutUnit logicalLeftOffsetForPositioningFloat(LayoutUnit logicalTop, Layou tUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const; 316 LayoutUnit logicalLeftOffsetForPositioningFloat(LayoutUnit logicalTop, Layou tUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const;
317 317
318 LayoutUnit adjustLogicalRightOffsetForLine(LayoutUnit offsetFromFloats, bool applyTextIndent) const; 318 LayoutUnit adjustLogicalRightOffsetForLine(LayoutUnit offsetFromFloats, bool applyTextIndent) const;
319 LayoutUnit adjustLogicalLeftOffsetForLine(LayoutUnit offsetFromFloats, bool applyTextIndent) const; 319 LayoutUnit adjustLogicalLeftOffsetForLine(LayoutUnit offsetFromFloats, bool applyTextIndent) const;
320 320
321 virtual void adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutUnit& right) const OVERRIDE; // Helper function for borderFitAdjust 321 virtual void adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutUnit& right) const OVERRIDE; // Helper function for borderFitAdjust
322 322
323 virtual RootInlineBox* createRootInlineBox(); // Subclassed by SVG 323 virtual RootInlineBox* createRootInlineBox(); // Subclassed by SVG
324 324
325 void updateLogicalWidthForAlignment(const ETextAlign&, const RootInlineBox*, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount); 325 void updateLogicalWidthForAlignment(const ETextAlign&, const RootInlineBox*, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount);
326 virtual bool relayoutForPagination(bool hasSpecifiedPageLogicalHeight, Layou tUnit pageLogicalHeight, LayoutStateMaintainer&); 326 bool shouldRelayoutForPagination(LayoutUnit& pageLogicalHeight, LayoutUnit l ayoutOverflowLogicalBottom) const;
327 void setColumnCountAndHeight(unsigned count, LayoutUnit pageLogicalHeight);
328
327 public: 329 public:
328 struct FloatWithRect { 330 struct FloatWithRect {
329 FloatWithRect(RenderBox* f) 331 FloatWithRect(RenderBox* f)
330 : object(f) 332 : object(f)
331 , rect(LayoutRect(f->x() - f->marginLeft(), f->y() - f->marginTop(), f->width() + f->marginWidth(), f->height() + f->marginHeight())) 333 , rect(LayoutRect(f->x() - f->marginLeft(), f->y() - f->marginTop(), f->width() + f->marginWidth(), f->height() + f->marginHeight()))
332 , everHadLayout(f->everHadLayout()) 334 , everHadLayout(f->everHadLayout())
333 { 335 {
334 } 336 }
335 337
336 RenderBox* object; 338 RenderBox* object;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 522
521 // END METHODS DEFINED IN RenderBlockLineLayout 523 // END METHODS DEFINED IN RenderBlockLineLayout
522 524
523 }; 525 };
524 526
525 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow()); 527 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow());
526 528
527 } // namespace WebCore 529 } // namespace WebCore
528 530
529 #endif // RenderBlockFlow_h 531 #endif // RenderBlockFlow_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698