Diff
Copied: branches/chromium/963/LayoutTests/fast/css/absolute-inline-alignment-2-expected.html (from rev 103851, trunk/LayoutTests/fast/css/absolute-inline-alignment-2-expected.html) (0 => 105361)
--- branches/chromium/963/LayoutTests/fast/css/absolute-inline-alignment-2-expected.html (rev 0)
+++ branches/chromium/963/LayoutTests/fast/css/absolute-inline-alignment-2-expected.html 2012-01-19 01:08:47 UTC (rev 105361)
@@ -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">​<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/963/LayoutTests/fast/css/absolute-inline-alignment-2.html (from rev 103851, trunk/LayoutTests/fast/css/absolute-inline-alignment-2.html) (0 => 105361)
--- branches/chromium/963/LayoutTests/fast/css/absolute-inline-alignment-2.html (rev 0)
+++ branches/chromium/963/LayoutTests/fast/css/absolute-inline-alignment-2.html 2012-01-19 01:08:47 UTC (rev 105361)
@@ -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/963/LayoutTests/fast/css/absolute-inline-alignment-expected.html (from rev 103851, trunk/LayoutTests/fast/css/absolute-inline-alignment-expected.html) (0 => 105361)
--- branches/chromium/963/LayoutTests/fast/css/absolute-inline-alignment-expected.html (rev 0)
+++ branches/chromium/963/LayoutTests/fast/css/absolute-inline-alignment-expected.html 2012-01-19 01:08:47 UTC (rev 105361)
@@ -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>
Copied: branches/chromium/963/LayoutTests/fast/css/absolute-inline-alignment.html (from rev 103851, trunk/LayoutTests/fast/css/absolute-inline-alignment.html) (0 => 105361)
--- branches/chromium/963/LayoutTests/fast/css/absolute-inline-alignment.html (rev 0)
+++ branches/chromium/963/LayoutTests/fast/css/absolute-inline-alignment.html 2012-01-19 01:08:47 UTC (rev 105361)
@@ -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/963/Source/WebCore/rendering/RenderBlockLineLayout.cpp (105360 => 105361)
--- branches/chromium/963/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2012-01-19 01:06:14 UTC (rev 105360)
+++ branches/chromium/963/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2012-01-19 01:08:47 UTC (rev 105361)
@@ -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 LayoutUnit 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);
@@ -1226,6 +1232,7 @@
lineMidpointState.reset();
layoutState.lineInfo().setEmpty(true);
+ layoutState.lineInfo().resetRunsFromLeadingWhitespace();
const InlineIterator oldEnd = end;
bool isNewUBAParagraph = layoutState.lineInfo().previousLineBrokeCleanly();
@@ -1874,9 +1881,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();
}