Changeset 86222 in webkit
- Timestamp:
- May 11, 2011 12:11:18 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86217 r86222 1 2011-05-11 Emil A Eklund <eae@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Convert RenderFlexibleBox to use IntPoint/IntSize instead of x,y/w,h pairs 6 https://bugs.webkit.org/show_bug.cgi?id=60592 7 8 Refactoring, covered by existing tests. 9 10 * rendering/RenderFlexibleBox.cpp: 11 (WebCore::RenderFlexibleBox::layoutBlock): 12 (WebCore::RenderFlexibleBox::layoutHorizontalBox): 13 (WebCore::RenderFlexibleBox::layoutVerticalBox): 14 (WebCore::RenderFlexibleBox::placeChild): 15 * rendering/RenderFlexibleBox.h: 16 1 17 2011-05-10 Ilya Tikhonovsky <loislo@chromium.org> 2 18 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r86098 r86222 210 210 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode()); 211 211 212 int previousWidth = width(); 213 int previousHeight = height(); 212 IntSize previousSize = size(); 214 213 215 214 computeLogicalWidth(); … … 218 217 m_overflow.clear(); 219 218 220 if (previous Width != width() || previousHeight != height() ||221 (parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL &&222 parent()->style()->boxAlign() == BSTRETCH))219 if (previousSize != size() 220 || (parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL 221 && parent()->style()->boxAlign() == BSTRETCH)) 223 222 relayoutChildren = true; 224 223 … … 245 244 computeLogicalHeight(); 246 245 247 if (previous Height!= height())246 if (previousSize.height() != height()) 248 247 relayoutChildren = true; 249 248 … … 443 442 } 444 443 445 placeChild(child, xPos, childY);444 placeChild(child, IntPoint(xPos, childY)); 446 445 447 446 xPos += child->width() + child->marginRight(); … … 568 567 --totalChildren; 569 568 570 placeChild(child, child-> x() + offset, child->y());569 placeChild(child, child->location() + IntSize(offset, 0)); 571 570 } 572 571 } … … 580 579 continue; 581 580 582 placeChild(child, child-> x() + offset, child->y());581 placeChild(child, child->location() + IntSize(offset, 0)); 583 582 } 584 583 } … … 673 672 674 673 // Place the child. 675 placeChild(child, childX, height());674 placeChild(child, IntPoint(childX, height())); 676 675 setHeight(height() + child->height() + child->marginBottom()); 677 676 } … … 811 810 remainingSpace -= (remainingSpace/totalChildren); 812 811 --totalChildren; 813 placeChild(child, child-> x(), child->y() + offset);812 placeChild(child, child->location() + IntSize(0, offset)); 814 813 } 815 814 } … … 822 821 if (child->isPositioned()) 823 822 continue; 824 placeChild(child, child-> x(), child->y() + offset);823 placeChild(child, child->location() + IntSize(0, offset)); 825 824 } 826 825 } … … 935 934 } 936 935 937 void RenderFlexibleBox::placeChild(RenderBox* child, int x, int y)938 { 939 IntRect oldRect (child->x(), child->y() , child->width(), child->height());936 void RenderFlexibleBox::placeChild(RenderBox* child, IntPoint location) 937 { 938 IntRect oldRect = child->frameRect(); 940 939 941 940 // Place the child. 942 child->setLocation( x, y);941 child->setLocation(location); 943 942 944 943 // If the child moved, we have to repaint it as well as any floating/positioned -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r68276 r86222 51 51 virtual bool isStretchingChildren() const { return m_stretchingChildren; } 52 52 53 void placeChild(RenderBox* child, int x, int y);53 void placeChild(RenderBox* child, IntPoint location); 54 54 55 55 protected:
Note: See TracChangeset
for help on using the changeset viewer.