Changeset 143410 in webkit
- Timestamp:
- Feb 19, 2013, 4:45:40 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r143407 r143410 1 2013-02-19 Emil A Eklund <eae@chromium.org> 2 3 Change computeStickyPositionConstraints to use LayoutBoxExtent for margins 4 https://bugs.webkit.org/show_bug.cgi?id=108872 5 6 Reviewed by Levi Weintraub. 7 8 Change RenderBoxModelObject::computeStickyPositionConstraints to 9 use a LayoutBoxExtent to represent margins. 10 11 No new tests, no change in functionality. 12 13 * platform/graphics/LayoutRect.h: 14 (WebCore::LayoutRect::contract): 15 Add version contract methods that takes a LayoutBoxExtent object. 16 17 * platform/graphics/LayoutSize.h: 18 (WebCore::LayoutSize::shrink): 19 Add shrink method. 20 21 * rendering/RenderBoxModelObject.cpp: 22 (WebCore::RenderBoxModelObject::computeStickyPositionConstraints): 23 Change to use a LayoutBoxExtent object to represent margins. 24 1 25 2013-02-19 Tony Gentilcore <tonyg@chromium.org> 2 26 -
trunk/Source/WebCore/platform/graphics/LayoutRect.h
r133779 r143410 108 108 void expand(LayoutUnit dw, LayoutUnit dh) { m_size.expand(dw, dh); } 109 109 void contract(const LayoutSize& size) { m_size -= size; } 110 void contract(const LayoutBoxExtent& box) 111 { 112 m_location.move(box.left(), box.top()); 113 m_size.shrink(box.left() + box.right(), box.top() + box.bottom()); 114 } 110 115 void contract(LayoutUnit dw, LayoutUnit dh) { m_size.expand(-dw, -dh); } 111 116 -
trunk/Source/WebCore/platform/graphics/LayoutSize.h
r133779 r143410 71 71 m_width += width; 72 72 m_height += height; 73 } 74 75 void shrink(LayoutUnit width, LayoutUnit height) 76 { 77 m_width -= width; 78 m_height -= height; 73 79 } 74 80 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r143102 r143410 476 476 477 477 LayoutRect containerContentRect = containingBlock->contentBoxRect(); 478 LayoutUnit maxWidth = containingBlock->availableLogicalWidth(); 478 479 479 480 // Sticky positioned element ignore any override logical width on the containing block (as they don't call 480 481 // containingBlockLogicalWidthForContent). It's unclear whether this is totally fine. 481 Layout Unit minLeftMargin = minimumValueForLength(style()->marginLeft(), containingBlock->availableLogicalWidth(), view());482 LayoutUnit minTopMargin = minimumValueForLength(style()->marginTop(), containingBlock->availableLogicalWidth(), view());483 LayoutUnit minRightMargin = minimumValueForLength(style()->marginRight(), containingBlock->availableLogicalWidth(), view());484 LayoutUnit minBottomMargin = minimumValueForLength(style()->marginBottom(), containingBlock->availableLogicalWidth(), view());482 LayoutBoxExtent minMargin(minimumValueForLength(style()->marginTop(), maxWidth, view()), 483 minimumValueForLength(style()->marginRight(), maxWidth, view()), 484 minimumValueForLength(style()->marginBottom(), maxWidth, view()), 485 minimumValueForLength(style()->marginLeft(), maxWidth, view())); 485 486 486 487 // Compute the container-relative area within which the sticky element is allowed to move. 487 containerContentRect.move(minLeftMargin, minTopMargin); 488 containerContentRect.contract(minLeftMargin + minRightMargin, minTopMargin + minBottomMargin); 488 containerContentRect.contract(minMargin); 489 489 // Map to the view to avoid including page scale factor. 490 490 constraints.setAbsoluteContainingBlockRect(containingBlock->localToContainerQuad(FloatRect(containerContentRect), view()).boundingBox());
Note:
See TracChangeset
for help on using the changeset viewer.