[css-flexbox] Don't include scrollbar extents when computing sizes for percentage...
authorsvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jul 2020 10:41:02 +0000 (10:41 +0000)
committersvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jul 2020 10:41:02 +0000 (10:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=213739

Reviewed by Javier Fernandez.

Source/WebCore:

Content override sizes do include scrollbars so they must be substracted when using the override size
to compute percentages.

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::crossSizeForPercentageResolution): Remove scrollbars.
(WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Ditto.

LayoutTests:

* TestExpectations: Unskipped percentage-heights-004.html.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263794 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFlexibleBox.cpp

index b6df336..f8812f3 100644 (file)
@@ -1,3 +1,12 @@
+2020-06-29  Sergio Villar Senin  <svillar@igalia.com>
+
+        [css-flexbox] Don't include scrollbar extents when computing sizes for percentage resolution
+        https://bugs.webkit.org/show_bug.cgi?id=213739
+
+        Reviewed by Javier Fernandez.
+
+        * TestExpectations: Unskipped percentage-heights-004.html.
+
 2020-07-01  Diego Pino Garcia  <dpino@igalia.com>
 
         [GTK] Unreviewed test gardening. Garden flaky failures in EWS GTK-WK2 queue.
index 769c981..3d08430 100644 (file)
@@ -4266,7 +4266,6 @@ webkit.org/b/212046 imported/w3c/web-platform-tests/css/css-flexbox/flex-minimum
 webkit.org/b/212046 imported/w3c/web-platform-tests/css/css-flexbox/overflow-area-001.html [ ImageOnlyFailure ]
 webkit.org/b/212046 imported/w3c/web-platform-tests/css/css-flexbox/overflow-area-002.html [ ImageOnlyFailure ]
 webkit.org/b/212046 imported/w3c/web-platform-tests/css/css-flexbox/overflow-auto-005.html [ ImageOnlyFailure ]
-webkit.org/b/212046 imported/w3c/web-platform-tests/css/css-flexbox/percentage-heights-004.html [ ImageOnlyFailure ]
 webkit.org/b/212046 imported/w3c/web-platform-tests/css/css-flexbox/percentage-heights-007.html [ ImageOnlyFailure ]
 webkit.org/b/212046 imported/w3c/web-platform-tests/css/css-flexbox/percentage-heights-014.html [ ImageOnlyFailure ]
 webkit.org/b/212046 imported/w3c/web-platform-tests/css/css-flexbox/percentage-size-subitems-001.html [ ImageOnlyFailure ]
index 2eb346b..e960e5a 100644 (file)
@@ -1,3 +1,17 @@
+2020-06-29  Sergio Villar Senin  <svillar@igalia.com>
+
+        [css-flexbox] Don't include scrollbar extents when computing sizes for percentage resolution
+        https://bugs.webkit.org/show_bug.cgi?id=213739
+
+        Reviewed by Javier Fernandez.
+
+        Content override sizes do include scrollbars so they must be substracted when using the override size
+        to compute percentages.
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution): Remove scrollbars.
+        (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Ditto.
+
 2020-06-30  Sergio Villar Senin  <svillar@igalia.com>
 
         [css-flex] Remove death code paths when evaluating percentage resolution
index 2547b75..1028a0b 100644 (file)
@@ -1167,7 +1167,7 @@ Optional<LayoutUnit> RenderFlexibleBox::crossSizeForPercentageResolution(const R
 
     // Here we implement https://drafts.csswg.org/css-flexbox/#algo-stretch
     if (child.hasOverrideContentLogicalHeight())
-        return child.overrideContentLogicalHeight();
+        return child.overrideContentLogicalHeight() - child.scrollbarLogicalHeight();
     
     // We don't currently implement the optimization from
     // https://drafts.csswg.org/css-flexbox/#definite-sizes case 1. While that
@@ -1187,7 +1187,7 @@ Optional<LayoutUnit> RenderFlexibleBox::mainSizeForPercentageResolution(const Re
     if (!mainAxisLengthIsDefinite(child, Length(0, Percent)))
         return WTF::nullopt;
 
-    return child.hasOverrideContentLogicalHeight() ? Optional<LayoutUnit>(child.overrideContentLogicalHeight()) : WTF::nullopt;
+    return child.hasOverrideContentLogicalHeight() ? Optional<LayoutUnit>(child.overrideContentLogicalHeight() - child.scrollbarLogicalHeight()) : WTF::nullopt;
 }
 
 Optional<LayoutUnit> RenderFlexibleBox::childLogicalHeightForPercentageResolution(const RenderBox& child)