Title: [105807] branches/chromium/963
Revision
105807
Author
[email protected]
Date
2012-01-24 14:17:26 -0800 (Tue, 24 Jan 2012)

Log Message

Revert 105788 - Merge 105768 - Incorrect positioning of floating pseudo-elements in table captions
BUG=105133
Review URL: https://chromiumcodereview.appspot.com/9117049

[email protected]
Review URL: https://chromiumcodereview.appspot.com/9271029

Modified Paths

Removed Paths

Diff

Deleted: branches/chromium/963/LayoutTests/fast/table/caption-encloses-overhanging-float-expected.html (105806 => 105807)


--- branches/chromium/963/LayoutTests/fast/table/caption-encloses-overhanging-float-expected.html	2012-01-24 22:10:32 UTC (rev 105806)
+++ branches/chromium/963/LayoutTests/fast/table/caption-encloses-overhanging-float-expected.html	2012-01-24 22:17:26 UTC (rev 105807)
@@ -1,16 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-  </head>
-  <body>
-    <!--    
-        https://bugs.webkit.org/show_bug.cgi?id=76664
-        The 'a' should be in a red box that sits on the bottom left of an enclosing yellow box.
-    -->
-    <style>
-    .caption1 { background-color:yellow; width: 40px; display: inline-block;}
-    .fl { float: left; background-color:red;}
-    </style>
-    <div class="caption1">caption1<div class="fl">a</div></div>
-  </body>
-</html>
\ No newline at end of file

Deleted: branches/chromium/963/LayoutTests/fast/table/caption-encloses-overhanging-float.html (105806 => 105807)


--- branches/chromium/963/LayoutTests/fast/table/caption-encloses-overhanging-float.html	2012-01-24 22:10:32 UTC (rev 105806)
+++ branches/chromium/963/LayoutTests/fast/table/caption-encloses-overhanging-float.html	2012-01-24 22:17:26 UTC (rev 105807)
@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-  </head>
-  <body>
-    <!--    
-        https://bugs.webkit.org/show_bug.cgi?id=76664
-        The 'a' should be in a red box that sits on the bottom left of an enclosing yellow box.
-    -->
-    <style>
-    .caption1 { background-color:yellow; width: 40px; }
-    .fl { float: left; background-color:red;}
-    </style>
-    <table>
-    <caption class="caption1">caption1<div class="fl">a</div></caption>
-    </table>
-  </body>
-</html>
\ No newline at end of file

Modified: branches/chromium/963/Source/WebCore/rendering/RenderBlock.cpp (105806 => 105807)


--- branches/chromium/963/Source/WebCore/rendering/RenderBlock.cpp	2012-01-24 22:10:32 UTC (rev 105806)
+++ branches/chromium/963/Source/WebCore/rendering/RenderBlock.cpp	2012-01-24 22:17:26 UTC (rev 105807)
@@ -1497,7 +1497,7 @@
 bool RenderBlock::expandsToEncloseOverhangingFloats() const
 {
     return isInlineBlockOrInlineTable() || isFloatingOrPositioned() || hasOverflowClip() || (parent() && parent()->isDeprecatedFlexibleBox())
-           || hasColumns() || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isRoot();
+           || hasColumns() || isTableCell() || isFieldset() || isWritingModeRoot() || isRoot();
 }
 
 void RenderBlock::adjustPositionedBlock(RenderBox* child, const MarginInfo& marginInfo)

Modified: branches/chromium/963/Source/WebCore/rendering/RenderTable.cpp (105806 => 105807)


--- branches/chromium/963/Source/WebCore/rendering/RenderTable.cpp	2012-01-24 22:10:32 UTC (rev 105806)
+++ branches/chromium/963/Source/WebCore/rendering/RenderTable.cpp	2012-01-24 22:17:26 UTC (rev 105807)
@@ -265,20 +265,11 @@
     }
 }
 
-void RenderTable::layoutCaption(RenderTableCaption* caption)
+void RenderTable::adjustLogicalHeightForCaption(RenderBlock* caption)
 {
     IntRect captionRect(caption->x(), caption->y(), caption->width(), caption->height());
 
-    if (caption->needsLayout()) {
-        // The margins may not be available but ensure the caption is at least located beneath any previous sibling caption
-        // so that it does not mistakenly think any floats in the previous caption intrude into it.
-        caption->setLogicalLocation(IntPoint(caption->marginStart(), caption->marginBefore() + logicalHeight()));
-        // If RenderTableCaption ever gets a layout() function, use it here.
-        caption->layoutIfNeeded();
-    }
-    // Apply the margins to the location now that they are definitely available from layout
     caption->setLogicalLocation(IntPoint(caption->marginStart(), caption->marginBefore() + logicalHeight()));
-
     if (!selfNeedsLayout() && caption->checkForRepaintDuringLayout())
         caption->repaintDuringLayoutIfMoved(captionRect);
 
@@ -339,6 +330,10 @@
         }
     }
 
+    // Only lay out one caption, since it's the only one we're going to end up painting.
+    for (unsigned i = 0; i < m_captions.size(); i++)
+        m_captions[i]->layoutIfNeeded();
+
     // If any table section moved vertically, we will just repaint everything from that
     // section down (it is quite unlikely that any of the following sections
     // did not shift).
@@ -350,7 +345,7 @@
         for (unsigned i = 0; i < m_captions.size(); i++) {
             if (m_captions[i]->style()->captionSide() == CAPBOTTOM)
                 continue;
-            layoutCaption(m_captions[i]);
+            adjustLogicalHeightForCaption(m_captions[i]);
         }
         if (logicalHeight() != oldTableLogicalTop) {
             sectionMoved = true;
@@ -410,7 +405,7 @@
     for (unsigned i = 0; i < m_captions.size(); i++) {
         if (m_captions[i]->style()->captionSide() != CAPBOTTOM)
             continue;
-        layoutCaption(m_captions[i]);
+        adjustLogicalHeightForCaption(m_captions[i]);
     }
 
     if (isPositioned())

Modified: branches/chromium/963/Source/WebCore/rendering/RenderTable.h (105806 => 105807)


--- branches/chromium/963/Source/WebCore/rendering/RenderTable.h	2012-01-24 22:10:32 UTC (rev 105806)
+++ branches/chromium/963/Source/WebCore/rendering/RenderTable.h	2012-01-24 22:17:26 UTC (rev 105807)
@@ -247,7 +247,7 @@
 
     void recalcCollapsedBorders();
     void recalcSections() const;
-    void layoutCaption(RenderTableCaption*);
+    void adjustLogicalHeightForCaption(RenderBlock*);
 
     mutable Vector<LayoutUnit> m_columnPos;
     mutable Vector<ColumnStruct> m_columns;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to