Title: [105360] branches/chromium/912
Revision
105360
Author
tse...@chromium.org
Date
2012-01-18 17:06:14 -0800 (Wed, 18 Jan 2012)

Log Message

Merge 103851 - REGRESSION (r94492): Text is shifted to the right in some buttons in the Mac App Store
BUG=104325
Review URL: https://chromiumcodereview.appspot.com/9216003

Modified Paths

Added Paths

Diff

Copied: branches/chromium/912/LayoutTests/fast/css/absolute-inline-alignment-2-expected.html (from rev 103851, trunk/LayoutTests/fast/css/absolute-inline-alignment-2-expected.html) (0 => 105360)


--- branches/chromium/912/LayoutTests/fast/css/absolute-inline-alignment-2-expected.html	                        (rev 0)
+++ branches/chromium/912/LayoutTests/fast/css/absolute-inline-alignment-2-expected.html	2012-01-19 01:06:14 UTC (rev 105360)
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<style>
+    body {
+        height: 200%;
+    }
+    div {
+        width: 400px;
+        height: 25px;
+        background-color: silver;
+        text-align: center;
+        margin: 8px 0;
+    }
+    #absolute {
+        position: absolute;
+        width: 25px;
+        height: 25px;
+        background-color: rgba(0, 0, 255, 0.5);
+    }
+</style>
+<div dir="rtl">&#x200b;<span id="absolute"></span>Lorem ipsum dolor sit amet</span></div>
+<div dir="ltr">&#x200b;<span id="absolute"></span>Lorem ipsum dolor sit amet</span></div>
+<div>&#x200b;<span dir="rtl"><span id="absolute"></span>Lorem ipsum dolor sit amet</span></span></div>
+<div>&#x200b;<span id="absolute"></span>Lorem ipsum dolor sit amet</div>
+<div style="text-align: left;">&#x200b;<span dir="rtl"><span id="absolute"></span>Lorem ipsum dolor sit amet</span></span></div>
+<div style="text-align: right;">&#x200b;<span dir="rtl"><span id="absolute"></span>Lorem ipsum dolor sit amet</span></span></div>

Copied: branches/chromium/912/LayoutTests/fast/css/absolute-inline-alignment-2.html (from rev 103851, trunk/LayoutTests/fast/css/absolute-inline-alignment-2.html) (0 => 105360)


--- branches/chromium/912/LayoutTests/fast/css/absolute-inline-alignment-2.html	                        (rev 0)
+++ branches/chromium/912/LayoutTests/fast/css/absolute-inline-alignment-2.html	2012-01-19 01:06:14 UTC (rev 105360)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<style>
+    body {
+        height: 200%;
+    }
+    div {
+        width: 400px;
+        height: 25px;
+        background-color: silver;
+        text-align: center;
+        margin: 8px 0;
+    }
+    #absolute {
+        position: absolute;
+        width: 25px;
+        height: 25px;
+        background-color: rgba(0, 0, 255, 0.5);
+    }
+</style>
+<div dir="rtl"><span id="absolute"></span> Lorem ipsum dolor sit amet</span></div>
+<div dir="ltr"><span id="absolute"></span> Lorem ipsum dolor sit amet</span></div>
+<div><span dir="rtl"><span id="absolute"></span> Lorem ipsum dolor sit amet</span></span></div>
+<div> <span id="absolute"></span>Lorem ipsum dolor sit amet</div>
+<div style="text-align: left;"><span dir="rtl"><span id="absolute"></span> Lorem ipsum dolor sit amet</span></span></div>
+<div style="text-align: right;"><span dir="rtl"><span id="absolute"></span> Lorem ipsum dolor sit amet</span></span></div>

Copied: branches/chromium/912/LayoutTests/fast/css/absolute-inline-alignment-expected.html (from rev 103851, trunk/LayoutTests/fast/css/absolute-inline-alignment-expected.html) (0 => 105360)


--- branches/chromium/912/LayoutTests/fast/css/absolute-inline-alignment-expected.html	                        (rev 0)
+++ branches/chromium/912/LayoutTests/fast/css/absolute-inline-alignment-expected.html	2012-01-19 01:06:14 UTC (rev 105360)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<style>
+    body {
+        height: 200%;
+    }
+    div {
+        width: 400px;
+        height: 25px;
+        background-color: silver;
+        text-align: center;
+        margin: 8px 0;
+    }
+
+    #float {
+        float: left;
+        width: 25px;
+        height: 25px;
+        background-color: rgba(0, 0, 255, 0.5);
+    }
+    #absolute {
+        position: absolute;
+        width: 25px;
+        height: 25px;
+        background-color: rgba(0, 0, 255, 0.5);
+    }
+</style>
+<div>&#x200b;<span id="absolute"></span>Lorem ipsum dolor sit amet</div>
+<div>&#x200b;<span id="absolute"></span>Lorem ipsum dolor sit amet</div>
+<div>&#x200b;<span id="absolute"></span>Lorem ipsum<span id="absolute"></span>    dolor sit amet</div>
+<div>&#x200b;<span id="absolute"></span><span id="absolute"></span>Lorem ipsum dolor sit amet</div>
+<div>&#x200b;<span id="absolute"></span><span id="absolute"></span>Lorem ipsum dolor sit amet</div>
+<div>&#x200b;<span id="absolute"></span>Lorem ipsum dolor sit amet</div>
+<div>&#x200b;<span id="absolute"></span>Lorem ipsum dolor sit amet</div>
+<div>&#x200b;<span id="float"></span>Lorem ipsum dolor sit amet</div>
+<div>&#x200b;<span id="absolute"></span>Lorem ipsum<span id="absolute"></span> dolor sit amet</div>
+<div>&#x200b;<span id="absolute"></span><span id="float"></span>Lorem ipsum dolor sit amet</div>
+<div>&#x200b;<span id="float"></span><span id="absolute"></span>Lorem ipsum dolor sit amet</div>
+<div>&#x200b;<span id="absolute"></span><span id="float"></span>Lorem ipsum dolor sit amet</div>

Copied: branches/chromium/912/LayoutTests/fast/css/absolute-inline-alignment.html (from rev 103851, trunk/LayoutTests/fast/css/absolute-inline-alignment.html) (0 => 105360)


--- branches/chromium/912/LayoutTests/fast/css/absolute-inline-alignment.html	                        (rev 0)
+++ branches/chromium/912/LayoutTests/fast/css/absolute-inline-alignment.html	2012-01-19 01:06:14 UTC (rev 105360)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<style>
+    body {
+        height: 200%;
+    }
+    div {
+        width: 400px;
+        height: 25px;
+        background-color: silver;
+        text-align: center;
+        margin: 8px 0;
+    }
+
+    #float {
+        float: left;
+        width: 25px;
+        height: 25px;
+        background-color: rgba(0, 0, 255, 0.5);
+    }
+    #absolute {
+        position: absolute;
+        width: 25px;
+        height: 25px;
+        background-color: rgba(0, 0, 255, 0.5);
+    }
+</style>
+<div><span id="absolute"></span>Lorem ipsum dolor sit amet</div>
+<div> <span id="absolute"></span> Lorem ipsum dolor sit amet</div>
+<div><span id="absolute"></span> Lorem ipsum<span id="absolute"></span>    dolor sit amet</div>
+<div><span id="absolute"></span> <span id="absolute"></span> Lorem ipsum dolor sit amet</div>
+<div>  <span id="absolute"></span> <span id="absolute"></span>    Lorem ipsum dolor sit amet</div>
+<div> <span id="absolute"></span>     Lorem ipsum dolor sit amet</div>
+<div> <span id="absolute"></span> Lorem ipsum dolor sit amet</div>
+<div><span id="float"></span>Lorem ipsum dolor sit amet</div>
+<div><span id="absolute"></span> Lorem ipsum<span id="absolute"></span>    dolor sit amet</div>
+<div> <span id="absolute"></span> <span id="float"></span> Lorem ipsum dolor sit amet</div>
+<div> <span id="float"></span> <span id="absolute"></span> Lorem ipsum dolor sit amet</div>
+<div>  <span id="absolute"></span> <span id="float"></span>    Lorem ipsum dolor sit amet</div>

Modified: branches/chromium/912/Source/WebCore/rendering/RenderBlockLineLayout.cpp (105359 => 105360)


--- branches/chromium/912/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2012-01-19 00:57:16 UTC (rev 105359)
+++ branches/chromium/912/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2012-01-19 01:06:14 UTC (rev 105360)
@@ -193,6 +193,7 @@
         , m_isEmpty(true)
         , m_previousLineBrokeCleanly(true)
         , m_floatPaginationStrut(0)
+        , m_runsFromLeadingWhitespace(0)
     { }
 
     bool isFirstLine() const { return m_isFirstLine; }
@@ -200,6 +201,9 @@
     bool isEmpty() const { return m_isEmpty; }
     bool previousLineBrokeCleanly() const { return m_previousLineBrokeCleanly; }
     LayoutUnit floatPaginationStrut() const { return m_floatPaginationStrut; }
+    unsigned runsFromLeadingWhitespace() const { return m_runsFromLeadingWhitespace; }
+    void resetRunsFromLeadingWhitespace() { m_runsFromLeadingWhitespace = 0; }
+    void incrementRunsFromLeadingWhitespace() { m_runsFromLeadingWhitespace++; }
 
     void setFirstLine(bool firstLine) { m_isFirstLine = firstLine; }
     void setLastLine(bool lastLine) { m_isLastLine = lastLine; }
@@ -224,6 +228,7 @@
     bool m_isEmpty;
     bool m_previousLineBrokeCleanly;
     LayoutUnit m_floatPaginationStrut;
+    unsigned m_runsFromLeadingWhitespace;
 };
 
 static inline int borderPaddingMarginStart(RenderInline* child)
@@ -479,10 +484,11 @@
 
     bool rootHasSelectedChildren = false;
     InlineFlowBox* parentBox = 0;
+    int runCount = bidiRuns.runCount() - lineInfo.runsFromLeadingWhitespace();
     for (BidiRun* r = bidiRuns.firstRun(); r; r = r->next()) {
         // Create a box for our object.
-        bool isOnlyRun = (bidiRuns.runCount() == 1);
-        if (bidiRuns.runCount() == 2 && !r->m_object->isListMarker())
+        bool isOnlyRun = (runCount == 1);
+        if (runCount == 2 && !r->m_object->isListMarker())
             isOnlyRun = (!style()->isLeftToRightDirection() ? bidiRuns.lastRun() : bidiRuns.firstRun())->m_object->isListMarker();
 
         InlineBox* box = createInlineBoxForRenderer(r->m_object, false, isOnlyRun);
@@ -1213,6 +1219,7 @@
         lineMidpointState.reset();
 
         layoutState.lineInfo().setEmpty(true);
+        layoutState.lineInfo().resetRunsFromLeadingWhitespace();
 
         InlineIterator oldEnd = end;
         bool isNewUBAParagraph = layoutState.lineInfo().previousLineBrokeCleanly();
@@ -1855,9 +1862,13 @@
 {
     while (!resolver.position().atEnd() && !requiresLineBox(resolver.position(), lineInfo, LeadingWhitespace)) {
         RenderObject* object = resolver.position().m_obj;
-        if (object->isPositioned())
+        if (object->isPositioned()) {
             setStaticPositions(m_block, toRenderBox(object));
-        else if (object->isFloating())
+            if (object->style()->isOriginalDisplayInlineType()) {
+                resolver.runs().addRun(createRun(0, 1, object, resolver));
+                lineInfo.incrementRunsFromLeadingWhitespace();
+            }
+        } else if (object->isFloating())
             m_block->positionNewFloatOnLine(m_block->insertFloatingObject(toRenderBox(object)), lastFloatFromPreviousLine, lineInfo, width);
         resolver.increment();
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to