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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Created 4 years, 2 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 * This file is part of the layout object implementation for KHTML. 2 * This file is part of the layout object implementation for KHTML.
3 * 3 *
4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
5 * (C) 1999 Antti Koivisto (koivisto@kde.org) 5 * (C) 1999 Antti Koivisto (koivisto@kde.org)
6 * Copyright (C) 2003 Apple Computer, Inc. 6 * Copyright (C) 2003 Apple Computer, Inc.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 445
446 LayoutUnit remainingSpace; 446 LayoutUnit remainingSpace;
447 447
448 FlexBoxIterator iterator(this); 448 FlexBoxIterator iterator(this);
449 unsigned highestFlexGroup = 0; 449 unsigned highestFlexGroup = 0;
450 unsigned lowestFlexGroup = 0; 450 unsigned lowestFlexGroup = 0;
451 bool haveFlex = false, flexingChildren = false; 451 bool haveFlex = false, flexingChildren = false;
452 gatherFlexChildrenInfo(iterator, relayoutChildren, highestFlexGroup, 452 gatherFlexChildrenInfo(iterator, relayoutChildren, highestFlexGroup,
453 lowestFlexGroup, haveFlex); 453 lowestFlexGroup, haveFlex);
454 454
455 PaintLayerScrollableArea::DelayScrollPositionClampScope delayClampScope; 455 PaintLayerScrollableArea::DelayScrollOffsetClampScope delayClampScope;
456 456
457 // We do 2 passes. The first pass is simply to lay everyone out at 457 // We do 2 passes. The first pass is simply to lay everyone out at
458 // their preferred widths. The second pass handles flexing the children. 458 // their preferred widths. The second pass handles flexing the children.
459 do { 459 do {
460 // Reset our height. 460 // Reset our height.
461 setHeight(yPos); 461 setHeight(yPos);
462 462
463 xPos = borderLeft() + paddingLeft(); 463 xPos = borderLeft() + paddingLeft();
464 464
465 // Our first pass is done without flexing. We simply lay the children 465 // Our first pass is done without flexing. We simply lay the children
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 bool haveFlex = false, flexingChildren = false; 780 bool haveFlex = false, flexingChildren = false;
781 gatherFlexChildrenInfo(iterator, relayoutChildren, highestFlexGroup, 781 gatherFlexChildrenInfo(iterator, relayoutChildren, highestFlexGroup,
782 lowestFlexGroup, haveFlex); 782 lowestFlexGroup, haveFlex);
783 783
784 // We confine the line clamp ugliness to vertical flexible boxes (thus keeping it out of 784 // We confine the line clamp ugliness to vertical flexible boxes (thus keeping it out of
785 // mainstream block layout); this is not really part of the XUL box model. 785 // mainstream block layout); this is not really part of the XUL box model.
786 bool haveLineClamp = !style()->lineClamp().isNone(); 786 bool haveLineClamp = !style()->lineClamp().isNone();
787 if (haveLineClamp) 787 if (haveLineClamp)
788 applyLineClamp(iterator, relayoutChildren); 788 applyLineClamp(iterator, relayoutChildren);
789 789
790 PaintLayerScrollableArea::DelayScrollPositionClampScope delayClampScope; 790 PaintLayerScrollableArea::DelayScrollOffsetClampScope delayClampScope;
791 791
792 // We do 2 passes. The first pass is simply to lay everyone out at 792 // We do 2 passes. The first pass is simply to lay everyone out at
793 // their preferred widths. The second pass handles flexing the children. 793 // their preferred widths. The second pass handles flexing the children.
794 // Our first pass is done without flexing. We simply lay the children 794 // Our first pass is done without flexing. We simply lay the children
795 // out within the box. 795 // out within the box.
796 do { 796 do {
797 setHeight(borderTop() + paddingTop()); 797 setHeight(borderTop() + paddingTop());
798 LayoutUnit minHeight = size().height() + toAdd; 798 LayoutUnit minHeight = size().height() + toAdd;
799 799
800 for (LayoutBox* child = iterator.first(); child; child = iterator.next()) { 800 for (LayoutBox* child = iterator.first(); child; child = iterator.next()) {
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 if (minHeight.isFixed() || minHeight.isAuto()) { 1232 if (minHeight.isFixed() || minHeight.isAuto()) {
1233 LayoutUnit minHeight(child->style()->minHeight().value()); 1233 LayoutUnit minHeight(child->style()->minHeight().value());
1234 LayoutUnit height = contentHeightForChild(child); 1234 LayoutUnit height = contentHeightForChild(child);
1235 LayoutUnit allowedShrinkage = (minHeight - height).clampPositiveToZero(); 1235 LayoutUnit allowedShrinkage = (minHeight - height).clampPositiveToZero();
1236 return allowedShrinkage; 1236 return allowedShrinkage;
1237 } 1237 }
1238 return LayoutUnit(); 1238 return LayoutUnit();
1239 } 1239 }
1240 1240
1241 } // namespace blink 1241 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698