Title: [93621] trunk
Revision
93621
Author
[email protected]
Date
2011-08-23 12:07:59 -0700 (Tue, 23 Aug 2011)

Log Message

Unreviewed, rolling out r93616.
http://trac.webkit.org/changeset/93616
https://bugs.webkit.org/show_bug.cgi?id=66796

"causes fast/css/absolute-child-with-percent-height-inside-
relative-parent.html to fail" (Requested by mwenge2 on
#webkit).

Patch by Sheriff Bot <[email protected]> on 2011-08-23

Source/WebCore:

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::adjustPositionedBlock):
* rendering/RenderBlock.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
(WebCore::setStaticPositions):
(WebCore::RenderBlock::LineBreaker::nextLineBreak):

LayoutTests:

* fast/inline/absolute-positioned-block-in-centred-block-expected.png: Removed.
* fast/inline/absolute-positioned-block-in-centred-block-expected.txt: Removed.
* fast/inline/absolute-positioned-block-in-centred-block.html: Removed.
* fast/inline/absolute-positioned-inline-in-centred-block-expected.png: Removed.
* fast/inline/absolute-positioned-inline-in-centred-block-expected.txt: Removed.
* fast/inline/absolute-positioned-inline-in-centred-block.html: Removed.
* platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.png:
* platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.txt:

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (93620 => 93621)


--- trunk/LayoutTests/ChangeLog	2011-08-23 18:46:33 UTC (rev 93620)
+++ trunk/LayoutTests/ChangeLog	2011-08-23 19:07:59 UTC (rev 93621)
@@ -1,3 +1,22 @@
+2011-08-23  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r93616.
+        http://trac.webkit.org/changeset/93616
+        https://bugs.webkit.org/show_bug.cgi?id=66796
+
+        "causes fast/css/absolute-child-with-percent-height-inside-
+        relative-parent.html to fail" (Requested by mwenge2 on
+        #webkit).
+
+        * fast/inline/absolute-positioned-block-in-centred-block-expected.png: Removed.
+        * fast/inline/absolute-positioned-block-in-centred-block-expected.txt: Removed.
+        * fast/inline/absolute-positioned-block-in-centred-block.html: Removed.
+        * fast/inline/absolute-positioned-inline-in-centred-block-expected.png: Removed.
+        * fast/inline/absolute-positioned-inline-in-centred-block-expected.txt: Removed.
+        * fast/inline/absolute-positioned-inline-in-centred-block.html: Removed.
+        * platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.png:
+        * platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.txt:
+
 2011-07-25  Robert Hogan  <[email protected]>
 
         div align="center" rendering problem

Deleted: trunk/LayoutTests/fast/inline/absolute-positioned-block-in-centred-block-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/fast/inline/absolute-positioned-block-in-centred-block-expected.txt (93620 => 93621)


--- trunk/LayoutTests/fast/inline/absolute-positioned-block-in-centred-block-expected.txt	2011-08-23 18:46:33 UTC (rev 93620)
+++ trunk/LayoutTests/fast/inline/absolute-positioned-block-in-centred-block-expected.txt	2011-08-23 19:07:59 UTC (rev 93621)
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock (anonymous) at (0,0) size 784x40
-        RenderText {#text} at (0,0) size 761x39
-          text run at (0,0) width 761: "An absolute-positioned block, with no leading text, should still obey the alignment of its parent block. The blue block should be"
-          text run at (0,20) width 412: "aligned to the center. https://bugs.webkit.org/show_bug.cgi?id=4860"
-      RenderBlock {DIV} at (0,40) size 784x0
-layer at (250,540) size 200x50
-  RenderBlock (positioned) {DIV} at (250,540) size 200x50 [bgcolor=#0000FF]

Deleted: trunk/LayoutTests/fast/inline/absolute-positioned-block-in-centred-block.html (93620 => 93621)


--- trunk/LayoutTests/fast/inline/absolute-positioned-block-in-centred-block.html	2011-08-23 18:46:33 UTC (rev 93620)
+++ trunk/LayoutTests/fast/inline/absolute-positioned-block-in-centred-block.html	2011-08-23 19:07:59 UTC (rev 93621)
@@ -1,12 +0,0 @@
-<html>
-<head>
-An absolute-positioned block, with no leading text, should still obey the alignment of its parent block.
-The blue block should be aligned to the center.
-https://bugs.webkit.org/show_bug.cgi?id=4860
-</head>
-<body>
-<div align="center">
-<div style="position:absolute; bottom:10px; width:200px; height:50px; margin-left:-150px; background:blue;"></div>
-</div>
-
-</body></html>
\ No newline at end of file

Deleted: trunk/LayoutTests/fast/inline/absolute-positioned-inline-in-centred-block-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/fast/inline/absolute-positioned-inline-in-centred-block-expected.txt (93620 => 93621)


--- trunk/LayoutTests/fast/inline/absolute-positioned-inline-in-centred-block-expected.txt	2011-08-23 18:46:33 UTC (rev 93620)
+++ trunk/LayoutTests/fast/inline/absolute-positioned-inline-in-centred-block-expected.txt	2011-08-23 19:07:59 UTC (rev 93621)
@@ -1,14 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock (anonymous) at (0,0) size 784x40
-        RenderText {#text} at (0,0) size 773x39
-          text run at (0,0) width 773: "An absolute-positioned element, with no leading text, should still obey the alignment of its parent block. 'Hello World, And Stuff!'"
-          text run at (0,20) width 474: "should be aligned to the center. https://bugs.webkit.org/show_bug.cgi?id=4860"
-      RenderBlock {DIV} at (0,40) size 784x0
-layer at (250,562) size 297x28
-  RenderBlock (positioned) {FONT} at (250,562) size 297x28
-    RenderText {#text} at (0,0) size 297x27
-      text run at (0,0) width 297: "Hello World, And Stuff!"

Deleted: trunk/LayoutTests/fast/inline/absolute-positioned-inline-in-centred-block.html (93620 => 93621)


--- trunk/LayoutTests/fast/inline/absolute-positioned-inline-in-centred-block.html	2011-08-23 18:46:33 UTC (rev 93620)
+++ trunk/LayoutTests/fast/inline/absolute-positioned-inline-in-centred-block.html	2011-08-23 19:07:59 UTC (rev 93621)
@@ -1,12 +0,0 @@
-<html>
-<head>
-An absolute-positioned element, with no leading text, should still obey the alignment of its parent block.
-'Hello World, And Stuff!' should be aligned to the center.
-https://bugs.webkit.org/show_bug.cgi?id=4860
-</head>
-<body>
-<div align="center">
-<font style="font-size:24px; font-variant:small-caps;letter-spacing:2px; position:absolute; bottom:10px; margin-left:-150px">Hello World, And Stuff!</font>
-</div>
-
-</body></html>
\ No newline at end of file

Modified: trunk/LayoutTests/platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.txt (93620 => 93621)


--- trunk/LayoutTests/platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.txt	2011-08-23 18:46:33 UTC (rev 93620)
+++ trunk/LayoutTests/platform/chromium-linux/fast/repaint/block-layout-inline-children-float-positioned-expected.txt	2011-08-23 19:07:59 UTC (rev 93621)
@@ -14,7 +14,7 @@
           RenderBlock (floating) {SPAN} at (324,1) size 277x20
             RenderText {#text} at (0,0) size 277x19
               text run at (0,0) width 277: "the quick brown fox jumped over the lazy dog"
-layer at (162,37) size 277x20
-  RenderBlock (positioned) {SPAN} at (162,37) size 277x20
+layer at (1,37) size 277x20
+  RenderBlock (positioned) {SPAN} at (1,37) size 277x20
     RenderText {#text} at (0,0) size 277x19
       text run at (0,0) width 277: "the quick brown fox jumped over the lazy dog"

Modified: trunk/Source/WebCore/ChangeLog (93620 => 93621)


--- trunk/Source/WebCore/ChangeLog	2011-08-23 18:46:33 UTC (rev 93620)
+++ trunk/Source/WebCore/ChangeLog	2011-08-23 19:07:59 UTC (rev 93621)
@@ -1,3 +1,21 @@
+2011-08-23  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r93616.
+        http://trac.webkit.org/changeset/93616
+        https://bugs.webkit.org/show_bug.cgi?id=66796
+
+        "causes fast/css/absolute-child-with-percent-height-inside-
+        relative-parent.html to fail" (Requested by mwenge2 on
+        #webkit).
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::adjustPositionedBlock):
+        * rendering/RenderBlock.h:
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
+        (WebCore::setStaticPositions):
+        (WebCore::RenderBlock::LineBreaker::nextLineBreak):
+
 2011-07-25  Robert Hogan  <[email protected]>
 
         div align="center" rendering problem

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (93620 => 93621)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-08-23 18:46:33 UTC (rev 93620)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-08-23 19:07:59 UTC (rev 93621)
@@ -1475,7 +1475,7 @@
     bool hasStaticBlockPosition = child->style()->hasStaticBlockPosition(isHorizontal);
     RenderLayer* childLayer = child->layer();
         
-    childLayer->setStaticInlinePosition(startAlignedOffsetForBlock(logicalHeight(), false));
+    childLayer->setStaticInlinePosition(borderAndPaddingStart());
 
     LayoutUnit logicalTop = logicalHeight();
     if (!marginInfo.canCollapseWithMarginBefore()) {

Modified: trunk/Source/WebCore/rendering/RenderBlock.h (93620 => 93621)


--- trunk/Source/WebCore/rendering/RenderBlock.h	2011-08-23 18:46:33 UTC (rev 93620)
+++ trunk/Source/WebCore/rendering/RenderBlock.h	2011-08-23 19:07:59 UTC (rev 93621)
@@ -129,8 +129,6 @@
     LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool firstLine) const { return logicalRightOffsetForLine(position, logicalRightOffsetForContent(), firstLine); }
     LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool firstLine) const { return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(), firstLine); }
     LayoutUnit startOffsetForLine(LayoutUnit position, bool firstLine) const { return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine) : logicalRightOffsetForLine(position, firstLine); }
-    LayoutUnit startAlignedOffsetForLine(LayoutUnit position, bool firstLine);
-    LayoutUnit startAlignedOffsetForBlock(LayoutUnit position, bool firstLine);
 
     virtual VisiblePosition positionForPoint(const LayoutPoint&);
     
@@ -224,8 +222,6 @@
     LayoutUnit collapsedMarginBeforeForChild(RenderBox* child) const;
     LayoutUnit collapsedMarginAfterForChild(RenderBox* child) const;
 
-    void updateLogicalWidthForAlignment(const ETextAlign&, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount);
-
     virtual void updateFirstLetter();
 
     class MarginValues {

Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (93620 => 93621)


--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2011-08-23 18:46:33 UTC (rev 93620)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2011-08-23 19:07:59 UTC (rev 93621)
@@ -549,57 +549,6 @@
     }
 }
 
-void RenderBlock::updateLogicalWidthForAlignment(const ETextAlign& textAlign, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount)
-{
-    // Armed with the total width of the line (without justification),
-    // we now examine our text-align property in order to determine where to position the
-    // objects horizontally. The total width of the line can be increased if we end up
-    // justifying text.
-    switch (textAlign) {
-    case LEFT:
-    case WEBKIT_LEFT:
-        updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
-        break;
-    case JUSTIFY:
-        adjustInlineDirectionLineBounds(expansionOpportunityCount, logicalLeft, availableLogicalWidth);
-        if (expansionOpportunityCount) {
-            if (trailingSpaceRun) {
-                totalLogicalWidth -= trailingSpaceRun->m_box->logicalWidth();
-                trailingSpaceRun->m_box->setLogicalWidth(0);
-            }
-            break;
-        }
-        // fall through
-    case TAAUTO:
-        // for right to left fall through to right aligned
-        if (style()->isLeftToRightDirection()) {
-            if (totalLogicalWidth > availableLogicalWidth && trailingSpaceRun)
-                trailingSpaceRun->m_box->setLogicalWidth(max<float>(0, trailingSpaceRun->m_box->logicalWidth() - totalLogicalWidth + availableLogicalWidth));
-            break;
-        }
-    case RIGHT:
-    case WEBKIT_RIGHT:
-        updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
-        break;
-    case CENTER:
-    case WEBKIT_CENTER:
-        updateLogicalWidthForCenterAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
-        break;
-    case TASTART:
-        if (style()->isLeftToRightDirection())
-            updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
-        else
-            updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
-        break;
-    case TAEND:
-        if (style()->isLeftToRightDirection())
-            updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
-        else
-            updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
-        break;
-    }
-}
-
 void RenderBlock::computeInlineDirectionPositionsForLine(RootInlineBox* lineBox, const LineInfo& lineInfo, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd,
                                                          GlyphOverflowAndFallbackFontsMap& textBoxDataMap, VerticalPositionCache& verticalPositionCache)
 {
@@ -656,7 +605,53 @@
         expansionOpportunityCount--;
     }
 
-    updateLogicalWidthForAlignment(textAlign, trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth, expansionOpportunityCount);
+    // Armed with the total width of the line (without justification),
+    // we now examine our text-align property in order to determine where to position the
+    // objects horizontally.  The total width of the line can be increased if we end up
+    // justifying text.
+    switch (textAlign) {
+        case LEFT:
+        case WEBKIT_LEFT:
+            updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+            break;
+        case JUSTIFY:
+            adjustInlineDirectionLineBounds(expansionOpportunityCount, logicalLeft, availableLogicalWidth);
+            if (expansionOpportunityCount) {
+                if (trailingSpaceRun) {
+                    totalLogicalWidth -= trailingSpaceRun->m_box->logicalWidth();
+                    trailingSpaceRun->m_box->setLogicalWidth(0);
+                }
+                break;
+            }
+            // fall through
+        case TAAUTO:
+            // for right to left fall through to right aligned
+            if (style()->isLeftToRightDirection()) {
+                if (totalLogicalWidth > availableLogicalWidth && trailingSpaceRun)
+                    trailingSpaceRun->m_box->setLogicalWidth(max<float>(0, trailingSpaceRun->m_box->logicalWidth() - totalLogicalWidth + availableLogicalWidth));
+                break;
+            }
+        case RIGHT:
+        case WEBKIT_RIGHT:
+            updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+            break;
+        case CENTER:
+        case WEBKIT_CENTER:
+            updateLogicalWidthForCenterAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+            break;
+        case TASTART:
+            if (style()->isLeftToRightDirection())
+                updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+            else
+                updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+            break;
+        case TAEND:
+            if (style()->isLeftToRightDirection())
+                updateLogicalWidthForRightAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+            else
+                updateLogicalWidthForLeftAlignedBlock(style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
+            break;
+    }
 
     computeExpansionForJustifiedText(firstRun, trailingSpaceRun, expansionOpportunities, expansionOpportunityCount, totalLogicalWidth, availableLogicalWidth);
 
@@ -717,14 +712,14 @@
         // A relative positioned inline encloses us. In this case, we also have to determine our
         // position as though we were an inline. Set |staticInlinePosition| and |staticBlockPosition| on the relative positioned
         // inline so that we can obtain the value later.
-        toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block->startAlignedOffsetForLine(blockHeight, false));
+        toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block->startOffsetForLine(blockHeight, false));
         toRenderInline(containerBlock)->layer()->setStaticBlockPosition(blockHeight);
     }
 
     if (child->style()->isOriginalDisplayInlineType())
-        child->layer()->setStaticInlinePosition(block->startAlignedOffsetForLine(blockHeight, false));
+        child->layer()->setStaticInlinePosition(block->startOffsetForLine(blockHeight, false));
     else
-        child->layer()->setStaticInlinePosition(block->startAlignedOffsetForBlock(blockHeight, false));
+        child->layer()->setStaticInlinePosition(block->borderAndPaddingStart());
     child->layer()->setStaticBlockPosition(blockHeight);
 }
 
@@ -2049,7 +2044,7 @@
             RenderBox* box = toRenderBox(current.m_obj);
             bool isInlineType = box->style()->isOriginalDisplayInlineType();
             if (!isInlineType)
-                box->layer()->setStaticInlinePosition(m_block->startAlignedOffsetForBlock(m_block->logicalHeight(), false));
+                box->layer()->setStaticInlinePosition(m_block->borderAndPaddingStart());
             else  {
                 // If our original display was an INLINE type, then we can go ahead
                 // and determine our static y position now.
@@ -2594,37 +2589,4 @@
     return true;
 }
 
-LayoutUnit RenderBlock::startAlignedOffsetForBlock(LayoutUnit position, bool firstLine)
-{
-    ETextAlign textAlign = style()->textAlign();
-
-    if (textAlign == TAAUTO)
-        return borderAndPaddingStart();
-
-    LayoutUnit lineOffset = startAlignedOffsetForLine(position, firstLine);
-
-    // For block flows, unlike inlines, the offset is given from the point at which the
-    // flow starts. So if the flow is RTL, flip the offset to represent units from the right.
-    if (!style()->isLeftToRightDirection())
-        lineOffset = logicalWidth() - lineOffset;
-    return lineOffset;
 }
-
-LayoutUnit RenderBlock::startAlignedOffsetForLine(LayoutUnit position, bool firstLine)
-{
-    ETextAlign textAlign = style()->textAlign();
-
-    if (textAlign == TAAUTO)
-        return startOffsetForLine(position, firstLine);
-
-    // updateLogicalWidthForAlignment() handles the direction of the block so no need to consider it here
-    float logicalLeft;
-    float availableLogicalWidth;
-    logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false);
-    availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), false) - logicalLeft;
-    float totalLogicalWidth;
-    updateLogicalWidthForAlignment(textAlign, 0l, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
-    return logicalLeft;
-}
-
-}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to