WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-220582-20210113105334.patch (text/plain), 9.42 KB, created by
Rob Buis
on 2021-01-13 01:53:36 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2021-01-13 01:53:36 PST
Size:
9.42 KB
patch
obsolete
>Subversion Revision: 271433 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 4933a352c3b303f43886378998035ee22a3e6492..9a5179927ac0b576d25de595e2c0a8988508f829 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2021-01-13 Rob Buis <rbuis@igalia.com> >+ >+ Handle min-width/min-height:auto for aspect-ratio >+ https://bugs.webkit.org/show_bug.cgi?id=220582 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ WIP. >+ >+ * rendering/RenderBox.cpp: >+ (WebCore::RenderBox::constrainLogicalWidthInFragmentByMinMax const): >+ (WebCore::RenderBox::constrainLogicalHeightByMinMax const): >+ (WebCore::RenderBox::computePositionedLogicalWidthUsing const): >+ (WebCore::RenderBox::computePositionedLogicalHeight const): >+ (WebCore::RenderBox::computePositionedLogicalHeightUsing const): >+ > 2021-01-12 Cathie Chen <cathiechen@igalia.com> > > The rootBounds of IntersectionObserverEntry is not correct when {root:document} >diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp >index 5bed6a2db5718998d2bfa79bddd719389288e1d9..f2502de716babe2be9e7402294ca8d2428f507bc 100644 >--- a/Source/WebCore/rendering/RenderBox.cpp >+++ b/Source/WebCore/rendering/RenderBox.cpp >@@ -645,7 +645,13 @@ LayoutUnit RenderBox::constrainLogicalWidthInFragmentByMinMax(LayoutUnit logical > const RenderStyle& styleToUse = style(); > if (!styleToUse.logicalMaxWidth().isUndefined()) > logicalWidth = std::min(logicalWidth, computeLogicalWidthInFragmentUsing(MaxSize, styleToUse.logicalMaxWidth(), availableWidth, cb, fragment)); >- return std::max(logicalWidth, computeLogicalWidthInFragmentUsing(MinSize, styleToUse.logicalMinWidth(), availableWidth, cb, fragment)); >+ Length minLength = styleToUse.logicalMinWidth(); >+ if (styleToUse.hasAspectRatio() && styleToUse.logicalWidth().isAuto() && minLength.isAuto() && styleToUse.overflowInlineDirection() == Overflow::Visible) { >+ // Make sure we actually used the aspect ratio. >+ if (shouldComputeLogicalWidthFromAspectRatio()) >+ minLength = Length(MinContent); >+ } >+ return std::max(logicalWidth, computeLogicalWidthInFragmentUsing(MinSize, minLength, availableWidth, cb, fragment)); > } > > LayoutUnit RenderBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, Optional<LayoutUnit> intrinsicContentHeight) const >@@ -655,7 +661,10 @@ LayoutUnit RenderBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, O > if (Optional<LayoutUnit> maxH = computeLogicalHeightUsing(MaxSize, styleToUse.logicalMaxHeight(), intrinsicContentHeight)) > logicalHeight = std::min(logicalHeight, maxH.value()); > } >- if (Optional<LayoutUnit> computedLogicalHeight = computeLogicalHeightUsing(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight)) >+ auto logicalMinHeight = styleToUse.logicalMinHeight(); >+ if (logicalMinHeight.isAuto() && shouldComputeLogicalHeightFromAspectRatio() && intrinsicContentHeight && styleToUse.overflowBlockDirection() == Overflow::Visible) >+ logicalMinHeight = Length(*intrinsicContentHeight, Fixed); >+ if (Optional<LayoutUnit> computedLogicalHeight = computeLogicalHeightUsing(MinSize, logicalMinHeight, intrinsicContentHeight)) > return std::max(logicalHeight, computedLogicalHeight.value()); > return logicalHeight; > } >@@ -3703,9 +3712,15 @@ void RenderBox::computePositionedLogicalWidthUsing(SizeType widthType, Length lo > { > ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || !logicalWidth.isAuto()); > auto originalLogicalWidthType = logicalWidth.type(); >- if (widthType == MinSize && logicalWidth.isAuto()) >- logicalWidth = Length(0, Fixed); >- else if (widthType == MainOrPreferredSize && logicalWidth.isAuto() && shouldComputeLogicalWidthFromAspectRatio()) >+ if (widthType == MinSize && logicalWidth.isAuto()) { >+ if (shouldComputeLogicalWidthFromAspectRatio()) { >+ LayoutUnit minLogicalWidth; >+ LayoutUnit maxLogicalWidth; >+ computeIntrinsicLogicalWidths(minLogicalWidth, maxLogicalWidth); >+ logicalWidth = Length(minLogicalWidth, Fixed); >+ } else >+ logicalWidth = Length(0, Fixed); >+ } else if (widthType == MainOrPreferredSize && logicalWidth.isAuto() && shouldComputeLogicalWidthFromAspectRatio()) > logicalWidth = Length(computeLogicalWidthFromAspectRatio(), Fixed); > else if (logicalWidth.isIntrinsic()) > logicalWidth = Length(computeIntrinsicLogicalWidthUsing(logicalWidth, containerLogicalWidth, bordersPlusPadding) - bordersPlusPadding, Fixed); >@@ -3976,7 +3991,8 @@ void RenderBox::computePositionedLogicalHeight(LogicalExtentComputedValues& comp > } > > // Calculate constraint equation values for 'min-height' case. >- if (!styleToUse.logicalMinHeight().isZero() || styleToUse.logicalMinHeight().isIntrinsic()) { >+ Length logicalMinHeight = styleToUse.logicalMinHeight(); >+ if (logicalMinHeight.isAuto() || !logicalMinHeight.isZero() || logicalMinHeight.isIntrinsic()) { > LogicalExtentComputedValues minValues; > > computePositionedLogicalHeightUsing(MinSize, styleToUse.logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight, >@@ -4041,8 +4057,12 @@ void RenderBox::computePositionedLogicalHeightUsing(SizeType heightType, Length > LogicalExtentComputedValues& computedValues) const > { > ASSERT(heightType == MinSize || heightType == MainOrPreferredSize || !logicalHeightLength.isAuto()); >- if (heightType == MinSize && logicalHeightLength.isAuto()) >- logicalHeightLength = Length(0, Fixed); >+ if (heightType == MinSize && logicalHeightLength.isAuto()) { >+ if (shouldComputeLogicalHeightFromAspectRatio()) >+ logicalHeightLength = Length(logicalHeight, Fixed); >+ else >+ logicalHeightLength = Length(0, Fixed); >+ } > > // 'top' and 'bottom' cannot both be 'auto' because 'top would of been > // converted to the static position in computePositionedLogicalHeight() >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 222deeb0dcca68da48c22c578ffe0a144a0eca39..953b3ca705e6b56763167d12b9002e3e90a60c46 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2021-01-13 Rob Buis <rbuis@igalia.com> >+ >+ Handle min-width/min-height:auto for aspect-ratio >+ https://bugs.webkit.org/show_bug.cgi?id=220582 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Enable some tests that pass now. >+ >+ * TestExpectations: >+ > 2021-01-12 Lauro Moura <lmoura@igalia.com> > > [WPE] Gardening Focus-visible failures >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index a3ec90168b94729f1cfdfd5fde3a9266816334d5..ed72f9ab697508c88cd77bae71c853282c1a1d85 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -4409,13 +4409,7 @@ webkit.org/b/214462 imported/w3c/web-platform-tests/css/css-scoping/shadow-direc > webkit.org/b/214462 imported/w3c/web-platform-tests/css/css-scoping/slotted-placeholder.html [ ImageOnlyFailure ] > > webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/abspos-008.html [ ImageOnlyFailure ] >-webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/abspos-012.html [ ImageOnlyFailure ] >-webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/abspos-013.html [ ImageOnlyFailure ] > webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/abspos-014.html [ ImageOnlyFailure ] >-webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-009.html [ ImageOnlyFailure ] >-webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-014.html [ ImageOnlyFailure ] >-webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-015.html [ ImageOnlyFailure ] >-webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-017.html [ ImageOnlyFailure ] > webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-020.html [ ImageOnlyFailure ] > webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-021.html [ ImageOnlyFailure ] > webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-023.html [ ImageOnlyFailure ] >@@ -4427,6 +4421,7 @@ webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/ > webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-002.html [ ImageOnlyFailure ] > webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-004.html [ ImageOnlyFailure ] > webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-005.html [ ImageOnlyFailure ] >+webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-008.html [ ImageOnlyFailure ] > webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-009.html [ ImageOnlyFailure ] > webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-011.html [ ImageOnlyFailure ] > webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-012.html [ ImageOnlyFailure ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 220582
:
417516
|
417781
|
417968
|
417992
|
418541
|
419265
|
419685
|
419966