Changeset 148943 in webkit
- Timestamp:
- Apr 22, 2013 9:52:56 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r148939 r148943 1 2013-04-22 Mihnea Ovidenie <mihnea@adobe.com> 2 3 [CSS Regions] Region's float parent doesn't size according to region size but to content node size 4 https://bugs.webkit.org/show_bug.cgi?id=111332 5 6 Reviewed by David Hyatt. 7 8 Added tests for intrinsic and preferred width computation for region. 9 10 * fast/regions/intrinsic-sized-regions-expected.txt: Added. 11 * fast/regions/intrinsic-sized-regions.html: Added. 12 * fast/regions/region-with-float-parent-expected.txt: Added. 13 * fast/regions/region-with-float-parent.html: Added. 14 1 15 2013-04-22 Jessie Berlin <jberlin@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r148933 r148943 1 2013-04-22 Mihnea Ovidenie <mihnea@adobe.com> 2 3 [CSS Regions] Region's float parent doesn't size according to region size but to content node size 4 https://bugs.webkit.org/show_bug.cgi?id=111332 5 6 Reviewed by David Hyatt. 7 8 Tests: fast/regions/intrinsic-sized-regions.html 9 fast/regions/region-with-float-parent.html 10 11 The patch ensures that the computation of region's preferred widths 12 takes into account the region width/min-width if these values are specified. 13 Also implemented the computation of intrinsic widths for a region, 14 based on the min/max preferred widths of the associated flow thread. 15 16 * rendering/RenderRegion.cpp: 17 (WebCore::RenderRegion::computeIntrinsicLogicalWidths): 18 (WebCore): 19 (WebCore::RenderRegion::computePreferredLogicalWidths): 20 * rendering/RenderRegion.h: 21 (RenderRegion): 22 1 23 2013-04-22 Jessie Berlin <jberlin@apple.com> 2 24 -
trunk/Source/WebCore/rendering/RenderRegion.cpp
r148536 r148943 598 598 } 599 599 600 void RenderRegion::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const 601 { 602 if (!isValid()) { 603 RenderBlock::computeIntrinsicLogicalWidths(minLogicalWidth, maxLogicalWidth); 604 return; 605 } 606 607 minLogicalWidth = m_flowThread->minPreferredLogicalWidth(); 608 maxLogicalWidth = m_flowThread->maxPreferredLogicalWidth(); 609 } 610 600 611 void RenderRegion::computePreferredLogicalWidths() 601 612 { … … 609 620 // FIXME: Currently, the code handles only the <length> case for min-width/max-width. 610 621 // It should also support other values, like percentage, calc or viewport relative. 611 m_minPreferredLogicalWidth = m_flowThread->minPreferredLogicalWidth(); 612 m_maxPreferredLogicalWidth = m_flowThread->maxPreferredLogicalWidth(); 622 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0; 613 623 614 624 RenderStyle* styleToUse = style(); 625 if (styleToUse->logicalWidth().isFixed() && styleToUse->logicalWidth().value() > 0) 626 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalWidth().value()); 627 else 628 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 629 630 if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth().value() > 0) { 631 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value())); 632 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value())); 633 } 634 615 635 if (styleToUse->logicalMaxWidth().isFixed()) { 636 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value())); 616 637 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value())); 617 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));618 638 } 619 639 -
trunk/Source/WebCore/rendering/RenderRegion.h
r148865 r148943 100 100 LayoutUnit maxPageLogicalHeight() const; 101 101 102 virtual void computePreferredLogicalWidths() OVERRIDE;103 104 102 LayoutUnit logicalTopOfFlowThreadContentRect(const LayoutRect&) const; 105 103 LayoutUnit logicalBottomOfFlowThreadContentRect(const LayoutRect&) const; … … 135 133 void setRegionObjectsRegionStyle(); 136 134 void restoreRegionObjectsOriginalStyle(); 135 136 virtual void computePreferredLogicalWidths() OVERRIDE; 137 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const OVERRIDE; 137 138 138 139 LayoutRect overflowRectForFlowThreadPortion(LayoutRect flowThreadPortionRect, bool isFirstPortion, bool isLastPortion) const;
Note: See TracChangeset
for help on using the changeset viewer.