Title: [195187] releases/WebKitGTK/webkit-2.10
Revision
195187
Author
[email protected]
Date
2016-01-18 00:09:10 -0800 (Mon, 18 Jan 2016)

Log Message

Merge r194558 - REGRESSION(r194143): Float width incorrectly calculated on Wikipedia
https://bugs.webkit.org/show_bug.cgi?id=152644

Reviewed by Myles C. Maxfield.

Source/WebCore:

The min/max-content contribution computation for non replaced
blocks changed in r194143. The implementation was actually
more complex than it should be and actually incomplete as it
was not considering the case of out of flow elements (because
it was directly calling computeLogicalWidthInRegion()).

This new implementation simplifies a lot the code and makes it
more complete as it relies on min|maxPreferredLogicalWidth()
calls which already consider all the different types of boxes.

Test: fast/css-intrinsic-dimensions/inlinesize-contribution-floats.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths):

LayoutTests:

* fast/css-intrinsic-dimensions/inlinesize-contribution-floats-expected.html: Added.
* fast/css-intrinsic-dimensions/inlinesize-contribution-floats.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (195186 => 195187)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2016-01-18 04:41:21 UTC (rev 195186)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2016-01-18 08:09:10 UTC (rev 195187)
@@ -1,3 +1,13 @@
+2016-01-04  Sergio Villar Senin  <[email protected]>
+
+        REGRESSION(r194143): Float width incorrectly calculated on Wikipedia
+        https://bugs.webkit.org/show_bug.cgi?id=152644
+
+        Reviewed by Myles C. Maxfield.
+
+        * fast/css-intrinsic-dimensions/inlinesize-contribution-floats-expected.html: Added.
+        * fast/css-intrinsic-dimensions/inlinesize-contribution-floats.html: Added.
+
 2015-12-08  Sergio Villar Senin  <[email protected]>
 
         Fix computation of min|max-content contribution of non-replaced blocks

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/css-intrinsic-dimensions/inlinesize-contribution-floats-expected.html (0 => 195187)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/css-intrinsic-dimensions/inlinesize-contribution-floats-expected.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/css-intrinsic-dimensions/inlinesize-contribution-floats-expected.html	2016-01-18 08:09:10 UTC (rev 195187)
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+
+<div style="word-wrap: break-word; max-width: 100%; width: 222px;">
+    The test PASS if this text is rendered horizontally.
+</div>

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/css-intrinsic-dimensions/inlinesize-contribution-floats.html (0 => 195187)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/css-intrinsic-dimensions/inlinesize-contribution-floats.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/css-intrinsic-dimensions/inlinesize-contribution-floats.html	2016-01-18 08:09:10 UTC (rev 195187)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+
+<div style="float:left;">
+    <div style="word-wrap: break-word; max-width: 100%; width: 222px;">
+	The test PASS if this text is rendered horizontally.
+    </div>
+</div>

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (195186 => 195187)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2016-01-18 04:41:21 UTC (rev 195186)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2016-01-18 08:09:10 UTC (rev 195187)
@@ -1,3 +1,25 @@
+2016-01-04  Sergio Villar Senin  <[email protected]>
+
+        REGRESSION(r194143): Float width incorrectly calculated on Wikipedia
+        https://bugs.webkit.org/show_bug.cgi?id=152644
+
+        Reviewed by Myles C. Maxfield.
+
+        The min/max-content contribution computation for non replaced
+        blocks changed in r194143. The implementation was actually
+        more complex than it should be and actually incomplete as it
+        was not considering the case of out of flow elements (because
+        it was directly calling computeLogicalWidthInRegion()).
+
+        This new implementation simplifies a lot the code and makes it
+        more complete as it relies on min|maxPreferredLogicalWidth()
+        calls which already consider all the different types of boxes.
+
+        Test: fast/css-intrinsic-dimensions/inlinesize-contribution-floats.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
+
 2015-12-08  Sergio Villar Senin  <[email protected]>
 
         Fix computation of min|max-content contribution of non-replaced blocks

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderBlock.cpp (195186 => 195187)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderBlock.cpp	2016-01-18 04:41:21 UTC (rev 195186)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderBlock.cpp	2016-01-18 08:09:10 UTC (rev 195187)
@@ -2759,26 +2759,15 @@
             childBox.computeLogicalHeight(childBox.borderAndPaddingLogicalHeight(), 0, computedValues);
             childMinPreferredLogicalWidth = childMaxPreferredLogicalWidth = computedValues.m_extent;
         } else {
-            if (is<RenderBlock>(*child) && !is<RenderTable>(*child)) {
+            childMinPreferredLogicalWidth = child->minPreferredLogicalWidth();
+            childMaxPreferredLogicalWidth = child->maxPreferredLogicalWidth();
+
+            if (is<RenderBlock>(*child)) {
                 const Length& computedInlineSize = child->style().logicalWidth();
-                if (computedInlineSize.isFitContent() || computedInlineSize.isFillAvailable() || computedInlineSize.isAuto()
-                    || computedInlineSize.isPercentOrCalculated()) {
-                    // FIXME: we could do a lot better for percents (we're considering them always indefinite)
-                    // but we need https://bugs.webkit.org/show_bug.cgi?id=152262 to be fixed first
-                    childMinPreferredLogicalWidth = child->minPreferredLogicalWidth();
-                    childMaxPreferredLogicalWidth = child->maxPreferredLogicalWidth();
-                } else {
-                    ASSERT(computedInlineSize.isMinContent() || computedInlineSize.isMaxContent() || computedInlineSize.isFixed());
-                    LogicalExtentComputedValues computedValues;
-                    downcast<RenderBlock>(*child).computeLogicalWidthInRegion(computedValues);
-                    childMinPreferredLogicalWidth = childMaxPreferredLogicalWidth = computedValues.m_extent;
-                    child->setPreferredLogicalWidthsDirty(false);
-                }
-            } else {
-                // FIXME: we leave the original implementation as default fallback. Still need to specialcase
-                // some other situations: https://drafts.csswg.org/css-sizing/#intrinsic
-                childMinPreferredLogicalWidth = child->minPreferredLogicalWidth();
-                childMaxPreferredLogicalWidth = child->maxPreferredLogicalWidth();
+                if (computedInlineSize.isMaxContent())
+                    childMinPreferredLogicalWidth = childMaxPreferredLogicalWidth;
+                else if (computedInlineSize.isMinContent())
+                    childMaxPreferredLogicalWidth = childMinPreferredLogicalWidth;
             }
         }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to