Title: [194558] trunk
Revision
194558
Author
svil...@igalia.com
Date
2016-01-04 14:43:41 -0800 (Mon, 04 Jan 2016)

Log Message

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: trunk/LayoutTests/ChangeLog (194557 => 194558)


--- trunk/LayoutTests/ChangeLog	2016-01-04 22:42:20 UTC (rev 194557)
+++ trunk/LayoutTests/ChangeLog	2016-01-04 22:43:41 UTC (rev 194558)
@@ -1,3 +1,13 @@
+2016-01-04  Sergio Villar Senin  <svil...@igalia.com>
+
+        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.
+
 2016-01-04  David Hyatt  <hy...@apple.com>
 
         word-wrap: break-word broken inside a flexbox

Added: trunk/LayoutTests/fast/css-intrinsic-dimensions/inlinesize-contribution-floats-expected.html (0 => 194558)


--- trunk/LayoutTests/fast/css-intrinsic-dimensions/inlinesize-contribution-floats-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-intrinsic-dimensions/inlinesize-contribution-floats-expected.html	2016-01-04 22:43:41 UTC (rev 194558)
@@ -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: trunk/LayoutTests/fast/css-intrinsic-dimensions/inlinesize-contribution-floats.html (0 => 194558)


--- trunk/LayoutTests/fast/css-intrinsic-dimensions/inlinesize-contribution-floats.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-intrinsic-dimensions/inlinesize-contribution-floats.html	2016-01-04 22:43:41 UTC (rev 194558)
@@ -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: trunk/Source/WebCore/ChangeLog (194557 => 194558)


--- trunk/Source/WebCore/ChangeLog	2016-01-04 22:42:20 UTC (rev 194557)
+++ trunk/Source/WebCore/ChangeLog	2016-01-04 22:43:41 UTC (rev 194558)
@@ -1,3 +1,25 @@
+2016-01-04  Sergio Villar Senin  <svil...@igalia.com>
+
+        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):
+
 2016-01-04  David Hyatt  <hy...@apple.com>
 
         word-wrap: break-word broken inside a flexbox

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (194557 => 194558)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2016-01-04 22:42:20 UTC (rev 194557)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2016-01-04 22:43:41 UTC (rev 194558)
@@ -2751,26 +2751,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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to