Title: [97635] trunk
Revision
97635
Author
m...@apple.com
Date
2011-10-17 11:20:38 -0700 (Mon, 17 Oct 2011)

Log Message

<rdar://problem/10293929> REGRESSION (r97525): iChat transcript has horizontal scroll bar when the conversation includes a wide image
https://bugs.webkit.org/show_bug.cgi?id=70204

Reviewed by Darin Adler.

Source/WebCore: 

Reverted r97525, which was supposed to fix <http://webkit.org/b/29447>.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalWidthUsing):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
* rendering/RenderBox.h:

LayoutTests: 

* fast/replaced/table-percent-width-expected.txt: Updated the results to
show that this test is failing after reverting r97525.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (97634 => 97635)


--- trunk/LayoutTests/ChangeLog	2011-10-17 18:17:17 UTC (rev 97634)
+++ trunk/LayoutTests/ChangeLog	2011-10-17 18:20:38 UTC (rev 97635)
@@ -1,3 +1,13 @@
+2011-10-17  Dan Bernstein  <m...@apple.com>
+
+        <rdar://problem/10293929> REGRESSION (r97525): iChat transcript has horizontal scroll bar when the conversation includes a wide image
+        https://bugs.webkit.org/show_bug.cgi?id=70204
+
+        Reviewed by Darin Adler.
+
+        * fast/replaced/table-percent-width-expected.txt: Updated the results to
+        show that this test is failing after reverting r97525.
+
 2011-10-17  Ryosuke Niwa  <rn...@webkit.org>
 
         Moved V8-specific result to platform/chromium and added JSC result in cross-platform directory.

Modified: trunk/LayoutTests/fast/replaced/table-percent-width-expected.txt (97634 => 97635)


--- trunk/LayoutTests/fast/replaced/table-percent-width-expected.txt	2011-10-17 18:17:17 UTC (rev 97634)
+++ trunk/LayoutTests/fast/replaced/table-percent-width-expected.txt	2011-10-17 18:20:38 UTC (rev 97635)
@@ -15,10 +15,10 @@
 PASS getHeight('img-2') is '98px'
 PASS getWidth('img-3') is '40px'
 PASS getHeight('img-3') is '40px'
-PASS getWidth('img-4') is '36px'
-PASS getHeight('img-4') is '36px'
+FAIL getWidth('img-4') should be 36px. Was 98px.
+FAIL getHeight('img-4') should be 36px. Was 98px.
 PASS getWidth('img-5') is '40px'
-PASS getHeight('img-5') is '36px'
+FAIL getHeight('img-5') should be 36px. Was 98px.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/Source/WebCore/ChangeLog (97634 => 97635)


--- trunk/Source/WebCore/ChangeLog	2011-10-17 18:17:17 UTC (rev 97634)
+++ trunk/Source/WebCore/ChangeLog	2011-10-17 18:20:38 UTC (rev 97635)
@@ -1,3 +1,17 @@
+2011-10-17  Dan Bernstein  <m...@apple.com>
+
+        <rdar://problem/10293929> REGRESSION (r97525): iChat transcript has horizontal scroll bar when the conversation includes a wide image
+        https://bugs.webkit.org/show_bug.cgi?id=70204
+
+        Reviewed by Darin Adler.
+
+        Reverted r97525, which was supposed to fix <http://webkit.org/b/29447>.
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
+        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
+        * rendering/RenderBox.h:
+
 2011-10-17  Ada Chan  <adac...@apple.com>
 
         Export KURL::baseAsString() so it can be called in WebProcessProxy::assumeReadAccessToBaseURL() in WebKit2.

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (97634 => 97635)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2011-10-17 18:17:17 UTC (rev 97634)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2011-10-17 18:20:38 UTC (rev 97635)
@@ -1271,39 +1271,6 @@
     return clipRect;
 }
 
-enum IntrinsicDimension { LogicalHeightDimension, LogicalWidthDimension };
-
-static bool shouldExpandToIntrinsicDimension(RenderBlock* cb, IntrinsicDimension dimension)
-{
-    // This function allows images to size correctly to their intrinsic height/width when inside table cells 
-    // that only have percent or auto height/width.
-    // It's only interested in inspecting as far as the containing table, if there is one.
-    bool inTableCell = false;
-    while (cb && !cb->isRenderView()) {
-        if (cb->isTableCell())
-            inTableCell = true;
-
-        if (dimension == LogicalHeightDimension && !cb->style()->logicalHeight().isAuto() && !cb->style()->logicalHeight().isPercent())
-            return false;
-        if (dimension == LogicalWidthDimension && !cb->style()->logicalWidth().isAuto() && !cb->style()->logicalWidth().isPercent())
-            return false;
-
-        if (cb->isTable())
-            break;
-
-        cb = cb->containingBlock();
-    }
-    return inTableCell;
-}
-
-LayoutUnit RenderBox::containingBlockReplacedLogicalWidthForContent() const
-{
-    RenderBlock* cb = containingBlock();
-    if (shouldExpandToIntrinsicDimension(cb, LogicalWidthDimension))
-        return max(shrinkToAvoidFloats() ? cb->availableLogicalWidthForLine(logicalTop(), false) : cb->availableLogicalWidth(), intrinsicLogicalWidth());
-    return containingBlockLogicalWidthForContent();
-}
-
 LayoutUnit RenderBox::containingBlockLogicalWidthForContent() const
 {
     RenderBlock* cb = containingBlock();
@@ -2210,7 +2177,7 @@
             // FIXME: containingBlockLogicalWidthForContent() is wrong if the replaced element's block-flow is perpendicular to the
             // containing block's block-flow.
             // https://bugs.webkit.org/show_bug.cgi?id=46496
-            const LayoutUnit cw = isPositioned() ? containingBlockLogicalWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockReplacedLogicalWidthForContent();
+            const LayoutUnit cw = isPositioned() ? containingBlockLogicalWidthForPositioned(toRenderBoxModelObject(container())) : containingBlockLogicalWidthForContent();
             if (cw > 0)
                 return computeContentBoxLogicalWidth(logicalWidth.calcMinValue(cw));
         }
@@ -2270,9 +2237,14 @@
                 // table cells using percentage heights.
                 // FIXME: This needs to be made block-flow-aware.  If the cell and image are perpendicular block-flows, this isn't right.
                 // https://bugs.webkit.org/show_bug.cgi?id=46997
-                if (shouldExpandToIntrinsicDimension(toRenderBlock(cb), LogicalHeightDimension)) {
-                    availableHeight = max(availableHeight, intrinsicLogicalHeight());
-                    return logicalHeight.calcValue(availableHeight - borderAndPaddingLogicalHeight());
+                while (cb && !cb->isRenderView() && (cb->style()->logicalHeight().isAuto() || cb->style()->logicalHeight().isPercent())) {
+                    if (cb->isTableCell()) {
+                        // Don't let table cells squeeze percent-height replaced elements
+                        // <http://bugs.webkit.org/show_bug.cgi?id=15359>
+                        availableHeight = max(availableHeight, intrinsicLogicalHeight());
+                        return logicalHeight.calcValue(availableHeight - borderAndPaddingLogicalHeight());
+                    }
+                    cb = cb->containingBlock();
                 }
             }
             return computeContentBoxLogicalHeight(logicalHeight.calcValue(availableHeight));

Modified: trunk/Source/WebCore/rendering/RenderBox.h (97634 => 97635)


--- trunk/Source/WebCore/rendering/RenderBox.h	2011-10-17 18:17:17 UTC (rev 97634)
+++ trunk/Source/WebCore/rendering/RenderBox.h	2011-10-17 18:20:38 UTC (rev 97635)
@@ -297,7 +297,6 @@
     virtual LayoutUnit containingBlockLogicalWidthForContent() const;
     LayoutUnit containingBlockLogicalWidthForContentInRegion(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage) const;
     LayoutUnit perpendicularContainingBlockLogicalHeight() const;
-    LayoutUnit containingBlockReplacedLogicalWidthForContent() const;
     
     virtual void computeLogicalWidth();
     virtual void computeLogicalHeight();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to