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-225015-20210428190353.patch (text/plain), 5.77 KB, created by
Rob Buis
on 2021-04-28 10:03:54 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2021-04-28 10:03:54 PDT
Size:
5.77 KB
patch
obsolete
>Subversion Revision: 276236 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5ef49ddb9b79d1c9062a284cc9af0a5b149788b2..801688b2f0d8c1a7978b0438ee9cafd7d17fdcb6 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2021-04-28 Rob Buis <rbuis@igalia.com> >+ >+ [aspect-ratio] Treat border/padding correctly for box-sizing: border-box >+ https://bugs.webkit.org/show_bug.cgi?id=225015 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When computing logical height in aspect-ratio case, to compute the automatic >+ minimum size [1] for min-height: auto, the padding was always subtracted, >+ however it should only be subtracted in the box-sizing: content-box case. >+ >+ Test: imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-035.html >+ >+ [1] https://www.w3.org/TR/css-sizing-4/#aspect-ratio-minimum >+ >+ * rendering/RenderBox.cpp: >+ (WebCore::RenderBox::computeLogicalHeight const): >+ > 2021-04-18 Wenson Hsieh <wenson_hsieh@apple.com> > > Selected image overlay text should never be visible >diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp >index 192440b338808a03ef18c189616de9a9bbfebded..f883ca2458e158b23dc3c1d001eb3f272c2d8382 100644 >--- a/Source/WebCore/rendering/RenderBox.cpp >+++ b/Source/WebCore/rendering/RenderBox.cpp >@@ -2956,11 +2956,16 @@ RenderBox::LogicalExtentComputedValues RenderBox::computeLogicalHeight(LayoutUni > // translate this to a nullopt intrinsic height for further logical height computations. > Optional<LayoutUnit> intrinsicHeight; > if (computedValues.m_extent != LayoutUnit::max()) >- intrinsicHeight = computedValues.m_extent - borderAndPaddingLogicalHeight(); >- if (shouldComputeLogicalHeightFromAspectRatio()) >+ intrinsicHeight = computedValues.m_extent; >+ if (shouldComputeLogicalHeightFromAspectRatio()) { >+ if (intrinsicHeight && style().boxSizingForAspectRatio() == BoxSizing::ContentBox) >+ *intrinsicHeight -= borderAndPaddingLogicalHeight(); > heightResult = blockSizeFromAspectRatio(horizontalBorderAndPaddingExtent(), verticalBorderAndPaddingExtent(), LayoutUnit(style().logicalAspectRatio()), style().boxSizingForAspectRatio(), logicalWidth()); >- else >+ } else { >+ if (intrinsicHeight) >+ *intrinsicHeight -= borderAndPaddingLogicalHeight(); > heightResult = computeLogicalHeightUsing(MainOrPreferredSize, style().logicalHeight(), intrinsicHeight).valueOr(computedValues.m_extent); >+ } > heightResult = constrainLogicalHeightByMinMax(heightResult, intrinsicHeight); > } else { > ASSERT(h.isFixed()); >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 71263f67e37dc0bf89203ca33b2156af7490c137..09e8e07838458d8beefb20e51bd692ae959a0243 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,15 @@ >+2021-04-28 Rob Buis <rbuis@igalia.com> >+ >+ [aspect-ratio] Treat border/padding correctly for box-sizing: border-box >+ https://bugs.webkit.org/show_bug.cgi?id=225015 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Import WPT test for this. >+ >+ * web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-035-expected.xht: Added. >+ * web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-035.html: Added. >+ > 2021-04-18 Antoine Quint <graouts@webkit.org> > > Fix interpolation of the rotate CSS property >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-035-expected.xht b/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-035-expected.xht >new file mode 100644 >index 0000000000000000000000000000000000000000..05a13794482a94f6c10bd9d4c98704e63ef60331 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-035-expected.xht >@@ -0,0 +1,19 @@ >+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> >+<html xmlns="http://www.w3.org/1999/xhtml"> >+ <head> >+ <title>CSS Reftest Reference</title> >+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> >+ <style type="text/css"><![CDATA[ >+ div >+ { >+ background-color: green; >+ height: 100px; >+ width: 100px; >+ } >+ ]]></style> >+ </head> >+ <body> >+ <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> >+ <div></div> >+ </body> >+</html> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-035.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-035.html >new file mode 100644 >index 0000000000000000000000000000000000000000..eaa23a24fed3b34bd945cfd0c67da1bdea795f57 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-035.html >@@ -0,0 +1,12 @@ >+<!DOCTYPE html> >+<title>CSS aspect-ratio: div block size + min-height: auto</title> >+<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com"> >+<link rel="author" title="Mozilla" href="https://www.mozilla.org/"> >+<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio"> >+<link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> >+ >+<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> >+<div style="background: green; box-sizing: border-box; aspect-ratio: 2/1; >+ width: 100px; border: 10px solid green; padding: 10px;"> >+ <div style="height: 60px"></div> >+</div>
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 225015
:
426984
|
426997
|
427000
|
427006
| 427273