Changeset 271293 in webkit
- Timestamp:
- Jan 8, 2021 5:29:01 AM (19 months ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderBlock.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderBox.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderBox.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r271290 r271293 1 2021-01-08 Rob Buis <rbuis@igalia.com> 2 3 Take aspect-ratio into account for percentage resolution 4 https://bugs.webkit.org/show_bug.cgi?id=220143 5 6 Reviewed by Darin Adler. 7 8 Enable some tests that pass now. 9 10 * TestExpectations: 11 1 12 2021-01-08 Philippe Normand <pnormand@igalia.com> 2 13 -
trunk/LayoutTests/TestExpectations
r271223 r271293 4463 4463 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/intrinsic-size-008.html [ ImageOnlyFailure ] 4464 4464 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/parsing/contain-intrinsic-size-invalid.html [ ImageOnlyFailure ] 4465 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/percentage-resolution-001.html [ ImageOnlyFailure ]4466 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/percentage-resolution-002.html [ ImageOnlyFailure ]4467 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/percentage-resolution-004.html [ ImageOnlyFailure ]4468 4465 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-001.html [ ImageOnlyFailure ] 4469 4466 webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-002.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r271290 r271293 1 2021-01-08 Rob Buis <rbuis@igalia.com> 2 3 Take aspect-ratio into account for percentage resolution 4 https://bugs.webkit.org/show_bug.cgi?id=220143 5 6 Reviewed by Darin Adler. 7 8 Add aspect-ratio handling to containing block available height 9 computations to fix percentage resolution on its children. 10 11 * rendering/RenderBlock.cpp: 12 (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const): 13 * rendering/RenderBox.cpp: 14 (WebCore::RenderBox::availableLogicalHeightUsing const): 15 (WebCore::blockSizeFromAspectRatio): Deleted. 16 * rendering/RenderBox.h: 17 (WebCore::RenderBox::blockSizeFromAspectRatio): 18 1 19 2021-01-08 Philippe Normand <pnormand@igalia.com> 2 20 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r271053 r271293 3208 3208 LayoutUnit contentBoxHeight = adjustContentBoxLogicalHeightForBoxSizing((LayoutUnit)styleToUse.logicalHeight().value()); 3209 3209 availableHeight = std::max(0_lu, constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - scrollbarLogicalHeight(), WTF::nullopt)); 3210 } else if (shouldComputeLogicalHeightFromAspectRatio()) { 3211 availableHeight = blockSizeFromAspectRatio(horizontalBorderAndPaddingExtent(), verticalBorderAndPaddingExtent(), style().logicalAspectRatio(), style().boxSizing(), logicalWidth()); 3210 3212 } else if (styleToUse.logicalHeight().isPercentOrCalculated() && !isOutOfFlowPositionedWithSpecifiedHeight) { 3211 3213 Optional<LayoutUnit> heightWithScrollbar = computePercentageLogicalHeight(styleToUse.logicalHeight()); -
trunk/Source/WebCore/rendering/RenderBox.cpp
r271223 r271293 2829 2829 } 2830 2830 2831 static LayoutUnit blockSizeFromAspectRatio(LayoutUnit borderPaddingInlineSum, LayoutUnit borderPaddingBlockSum, double aspectRatio, BoxSizing boxSizing, LayoutUnit inlineSize)2832 {2833 if (boxSizing == BoxSizing::BorderBox)2834 return inlineSize / LayoutUnit(aspectRatio);2835 2836 return ((inlineSize - borderPaddingInlineSum) / LayoutUnit(aspectRatio)) + borderPaddingBlockSum;2837 }2838 2839 2831 RenderBox::LogicalExtentComputedValues RenderBox::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop) const 2840 2832 { … … 3314 3306 return stretchedHeight.value(); 3315 3307 } 3308 3309 if (shouldComputeLogicalHeightFromAspectRatio()) 3310 return blockSizeFromAspectRatio(horizontalBorderAndPaddingExtent(), verticalBorderAndPaddingExtent(), style().logicalAspectRatio(), style().boxSizing(), logicalWidth()); 3316 3311 3317 3312 if (h.isPercentOrCalculated() && isOutOfFlowPositioned() && !isRenderFragmentedFlow()) { -
trunk/Source/WebCore/rendering/RenderBox.h
r271061 r271293 697 697 void incrementVisuallyNonEmptyPixelCountIfNeeded(const IntSize&); 698 698 699 bool shouldComputeLogicalHeightFromAspectRatio() const; 700 bool shouldComputeLogicalWidthFromAspectRatio() const; 701 bool shouldComputeLogicalWidthFromAspectRatioAndInsets() const; 702 LayoutUnit computeLogicalWidthFromAspectRatio(RenderFragmentContainer* = nullptr) const; 703 704 static LayoutUnit blockSizeFromAspectRatio(LayoutUnit borderPaddingInlineSum, LayoutUnit borderPaddingBlockSum, double aspectRatio, BoxSizing boxSizing, LayoutUnit inlineSize) 705 { 706 if (boxSizing == BoxSizing::BorderBox) 707 return inlineSize / LayoutUnit(aspectRatio); 708 return ((inlineSize - borderPaddingInlineSum) / LayoutUnit(aspectRatio)) + borderPaddingBlockSum; 709 } 710 699 711 private: 700 712 bool replacedMinMaxLogicalHeightComputesAsNone(SizeType) const; … … 744 756 745 757 void applyTopLeftLocationOffsetWithFlipping(LayoutPoint&) const; 746 747 bool shouldComputeLogicalHeightFromAspectRatio() const;748 bool shouldComputeLogicalWidthFromAspectRatio() const;749 bool shouldComputeLogicalWidthFromAspectRatioAndInsets() const;750 LayoutUnit computeLogicalWidthFromAspectRatio(RenderFragmentContainer* = nullptr) const;751 758 752 759 private:
Note: See TracChangeset
for help on using the changeset viewer.