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-20210120165825.patch (text/plain), 9.34 KB, created by
Rob Buis
on 2021-01-20 07:58:27 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2021-01-20 07:58:27 PST
Size:
9.34 KB
patch
obsolete
>Subversion Revision: 271646 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c969fb4236c88d56f3af225d0fa650681afd3ec4..b432e7137174d33d4ff30413ff5720ddb7c885f8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2021-01-20 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-20 Sam Weinig <weinig@apple.com> > > "Remove remaining non-standard CMYKA support from Canvas" >diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp >index 90faf92b5282896cd2770caba277b5b6bc751202..fbeb1fe588d48760e7861c81184e002083497ec3 100644 >--- a/Source/WebCore/rendering/RenderBox.cpp >+++ b/Source/WebCore/rendering/RenderBox.cpp >@@ -655,7 +655,13 @@ LayoutUnit RenderBox::constrainLogicalWidthInFragmentByMinMax(LayoutUnit logical > > 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 >@@ -665,7 +671,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; > } >@@ -3749,9 +3758,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); >@@ -4022,7 +4037,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, >@@ -4087,8 +4103,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 28f68462cd8c90bbdb2f2fc0833c7297e08f0377..c79ed36519817bffa695e471ad9572e3fe75d012 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2021-01-20 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-20 Sam Weinig <weinig@apple.com> > > Remove remaining non-standard CMYKA support from canvas >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index 8cbb2281d1d38acc0509c78e370491f2ce2e8274..5eef18d4d8c5b9fc9283350a65a8916bce98f12c 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -4407,19 +4407,15 @@ 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/shadow-directionality-002.tentative.html [ ImageOnlyFailure ] > 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-012.html [ ImageOnlyFailure ] >-webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/abspos-013.html [ ImageOnlyFailure ] >+# abspos-014.html depends on missing contain-intrinsic-size support. > 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-024.html [ ImageOnlyFailure ] > webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-028.html [ ImageOnlyFailure ] > webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-001.html [ ImageOnlyFailure ] > 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