CSS 2.1 failure: floats-wrap-top-below-inline-* fail
authorrobert@webkit.org <robert@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2012 17:41:35 +0000 (17:41 +0000)
committerrobert@webkit.org <robert@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2012 17:41:35 +0000 (17:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=88171

Reviewed by Eric Seidel.

Source/WebCore:

When shifting a line or element left or right to avoid a float use the height
of the line or element to determine whether the float is inside the element or
if it overlaps the bottom of the element.

Do this by passing the height of the element to the interval tree used to detect
the overlap with it's containing block's floats. The height is zero by default so
callers to logical[Left|Right]OffsetForLine will need to pass the height if they
want to use it to detect floats to avoid.

Tests: css2.1/20110323/floats-wrap-top-below-bfc-001l.htm
       css2.1/20110323/floats-wrap-top-below-bfc-001r.htm
       css2.1/20110323/floats-wrap-top-below-bfc-002l.htm
       css2.1/20110323/floats-wrap-top-below-bfc-002r.htm
       css2.1/20110323/floats-wrap-top-below-bfc-003l.htm
       css2.1/20110323/floats-wrap-top-below-bfc-003r.htm
       css2.1/20110323/floats-wrap-top-below-inline-001l.htm
       css2.1/20110323/floats-wrap-top-below-inline-001r.htm
       css2.1/20110323/floats-wrap-top-below-inline-002l.htm
       css2.1/20110323/floats-wrap-top-below-inline-002r.htm
       css2.1/20110323/floats-wrap-top-below-inline-003l.htm
       css2.1/20110323/floats-wrap-top-below-inline-003r.htm
       css2.1/20110323/floats-zero-height-wrap-001.htm
       css2.1/20110323/floats-zero-height-wrap-002.htm
       fast/block/float/floats-wrap-inside-inline-001.htm
       fast/block/float/floats-wrap-inside-inline-002.htm
       fast/block/float/floats-wrap-inside-inline-003.htm
       fast/block/float/floats-wrap-inside-inline-004.htm
       fast/block/float/floats-wrap-inside-inline-005.htm

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
(WebCore::::collectIfNeeded):
(WebCore::RenderBlock::logicalLeftOffsetForLine):
(WebCore::RenderBlock::logicalRightOffsetForLine):
(WebCore::RenderBlock::getClearDelta):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::availableLogicalWidthForLine):
(WebCore::RenderBlock::logicalRightOffsetForLine):
(WebCore::RenderBlock::logicalLeftOffsetForLine):
(WebCore::RenderBlock::startOffsetForLine):
(WebCore::RenderBlock::endOffsetForLine):
(WebCore::RenderBlock::pixelSnappedLogicalLeftOffsetForLine):
(WebCore::RenderBlock::pixelSnappedLogicalRightOffsetForLine):
(RenderBlock):
(WebCore::RenderBlock::FloatIntervalSearchAdapter::FloatIntervalSearchAdapter):
(WebCore::RenderBlock::FloatIntervalSearchAdapter::lowValue):
(WebCore::RenderBlock::FloatIntervalSearchAdapter::highValue):
(FloatIntervalSearchAdapter):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::logicalBottomForLine):
(WebCore):
(WebCore::LineWidth::updateAvailableWidth):
(WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):

LayoutTests:

* css2.1/20110323/floats-wrap-top-below-001l-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-001r-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-002l-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-002r-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-003l-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-003r-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-bfc-001l-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-bfc-001l.htm: Added.
* css2.1/20110323/floats-wrap-top-below-bfc-001r-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-bfc-001r.htm: Added.
* css2.1/20110323/floats-wrap-top-below-bfc-002l-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-bfc-002l.htm: Added.
* css2.1/20110323/floats-wrap-top-below-bfc-002r-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-bfc-002r.htm: Added.
* css2.1/20110323/floats-wrap-top-below-bfc-003l-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-bfc-003l.htm: Added.
* css2.1/20110323/floats-wrap-top-below-bfc-003r-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-bfc-003r.htm: Added.
* css2.1/20110323/floats-wrap-top-below-inline-001l-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-inline-001l.htm: Added.
* css2.1/20110323/floats-wrap-top-below-inline-001r-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-inline-001r.htm: Added.
* css2.1/20110323/floats-wrap-top-below-inline-002l-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-inline-002l.htm: Added.
* css2.1/20110323/floats-wrap-top-below-inline-002r-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-inline-002r.htm: Added.
* css2.1/20110323/floats-wrap-top-below-inline-003l-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-inline-003l.htm: Added.
* css2.1/20110323/floats-wrap-top-below-inline-003r-expected.html: Added.
* css2.1/20110323/floats-wrap-top-below-inline-003r.htm: Added.
* css2.1/20110323/floats-zero-height-wrap-001-expected.html: Added.
* css2.1/20110323/floats-zero-height-wrap-001.htm: Added.
* css2.1/20110323/floats-zero-height-wrap-002.htm: Added.
* css2.1/20110323/floats-zero-height-wrap-002-expected.html: Added.
All of these are taken from the CSS test suite, including the expected.html files which have been renamed
from *-ref.html so that new-run-webkit-tests will parse use them.
* fast/block/float/floats-wrap-inside-inline-001-expected.html: Added.
* fast/block/float/floats-wrap-inside-inline-001.htm: Added.
The span should avoid a float even when its top and bottom does not overlap with the top of the span.
In this test the float starts and ends inside the span's first linebox.
* fast/block/float/floats-wrap-inside-inline-002-expected.html: Added.
* fast/block/float/floats-wrap-inside-inline-002.htm: Added.
The span should avoid a float even when its top and bottom does not overlap with the top of the span.
In this test the float overlaps the bottom of the span, but is below the span's first linebox.
* fast/block/float/floats-wrap-inside-inline-003-expected.html: Added.
* fast/block/float/floats-wrap-inside-inline-003.htm: Added.
An inline span should avoid a float even when its top and bottom does not overlap with the top of the span.
In this test the float starts and ends inside the span's first linebox.
* fast/block/float/floats-wrap-inside-inline-004-expected.html: Added.
* fast/block/float/floats-wrap-inside-inline-004.htm: Added.
The span should avoid a float even when its top and bottom does not overlap with the top of the span.
In this test the float overlaps inside the span and the span has height set by its style.
* fast/block/float/floats-wrap-inside-inline-005-expected.html: Added.
* fast/block/float/floats-wrap-inside-inline-005.htm: Added.
In this test the float starts and ends inside the span's second linebox, so only the second linebox should avoid the float.
* platform/chromium-win/css1/formatting_model/floating_elements-expected.txt:
This is a progression due to lineboxes now avoiding floats they overlap.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121789 268f45cc-cd09-0410-ab3c-d52691b4dbfc

50 files changed:
LayoutTests/ChangeLog
LayoutTests/css2.1/20110323/floats-wrap-top-below-001l-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-001r-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-002l-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-002r-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-003l-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-003r-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001l-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001l.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001r-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001r.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002l-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002l.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002r-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002r.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003l-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003l.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003r-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003r.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001l-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001l.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001r-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001r.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002l-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002l.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002r-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002r.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003l-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003l.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003r-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003r.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-zero-height-wrap-001-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-zero-height-wrap-001.htm [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-zero-height-wrap-002-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/floats-zero-height-wrap-002.htm [new file with mode: 0644]
LayoutTests/fast/block/float/floats-wrap-inside-inline-001-expected.html [new file with mode: 0644]
LayoutTests/fast/block/float/floats-wrap-inside-inline-001.htm [new file with mode: 0644]
LayoutTests/fast/block/float/floats-wrap-inside-inline-002-expected.html [new file with mode: 0644]
LayoutTests/fast/block/float/floats-wrap-inside-inline-002.htm [new file with mode: 0644]
LayoutTests/fast/block/float/floats-wrap-inside-inline-003-expected.html [new file with mode: 0644]
LayoutTests/fast/block/float/floats-wrap-inside-inline-003.htm [new file with mode: 0644]
LayoutTests/fast/block/float/floats-wrap-inside-inline-004-expected.html [new file with mode: 0644]
LayoutTests/fast/block/float/floats-wrap-inside-inline-004.htm [new file with mode: 0644]
LayoutTests/fast/block/float/floats-wrap-inside-inline-005-expected.html [new file with mode: 0644]
LayoutTests/platform/chromium-win/css1/formatting_model/floating_elements-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderBox.cpp

index afeaadb..b8fdd12 100644 (file)
@@ -1,3 +1,68 @@
+2012-07-03  Robert Hogan  <robert@webkit.org>
+
+        CSS 2.1 failure: floats-wrap-top-below-inline-* fail
+        https://bugs.webkit.org/show_bug.cgi?id=88171
+
+        Reviewed by Eric Seidel.
+
+        * css2.1/20110323/floats-wrap-top-below-001l-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-001r-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-002l-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-002r-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-003l-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-003r-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-bfc-001l-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-bfc-001l.htm: Added.
+        * css2.1/20110323/floats-wrap-top-below-bfc-001r-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-bfc-001r.htm: Added.
+        * css2.1/20110323/floats-wrap-top-below-bfc-002l-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-bfc-002l.htm: Added.
+        * css2.1/20110323/floats-wrap-top-below-bfc-002r-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-bfc-002r.htm: Added.
+        * css2.1/20110323/floats-wrap-top-below-bfc-003l-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-bfc-003l.htm: Added.
+        * css2.1/20110323/floats-wrap-top-below-bfc-003r-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-bfc-003r.htm: Added.
+        * css2.1/20110323/floats-wrap-top-below-inline-001l-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-inline-001l.htm: Added.
+        * css2.1/20110323/floats-wrap-top-below-inline-001r-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-inline-001r.htm: Added.
+        * css2.1/20110323/floats-wrap-top-below-inline-002l-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-inline-002l.htm: Added.
+        * css2.1/20110323/floats-wrap-top-below-inline-002r-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-inline-002r.htm: Added.
+        * css2.1/20110323/floats-wrap-top-below-inline-003l-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-inline-003l.htm: Added.
+        * css2.1/20110323/floats-wrap-top-below-inline-003r-expected.html: Added.
+        * css2.1/20110323/floats-wrap-top-below-inline-003r.htm: Added.
+        * css2.1/20110323/floats-zero-height-wrap-001-expected.html: Added.
+        * css2.1/20110323/floats-zero-height-wrap-001.htm: Added.
+        * css2.1/20110323/floats-zero-height-wrap-002.htm: Added.
+        * css2.1/20110323/floats-zero-height-wrap-002-expected.html: Added.
+        All of these are taken from the CSS test suite, including the expected.html files which have been renamed
+        from *-ref.html so that new-run-webkit-tests will parse use them.
+        * fast/block/float/floats-wrap-inside-inline-001-expected.html: Added.
+        * fast/block/float/floats-wrap-inside-inline-001.htm: Added.
+        The span should avoid a float even when its top and bottom does not overlap with the top of the span.
+        In this test the float starts and ends inside the span's first linebox.
+        * fast/block/float/floats-wrap-inside-inline-002-expected.html: Added.
+        * fast/block/float/floats-wrap-inside-inline-002.htm: Added.
+        The span should avoid a float even when its top and bottom does not overlap with the top of the span.
+        In this test the float overlaps the bottom of the span, but is below the span's first linebox.
+        * fast/block/float/floats-wrap-inside-inline-003-expected.html: Added.
+        * fast/block/float/floats-wrap-inside-inline-003.htm: Added.
+        An inline span should avoid a float even when its top and bottom does not overlap with the top of the span.
+        In this test the float starts and ends inside the span's first linebox.
+        * fast/block/float/floats-wrap-inside-inline-004-expected.html: Added.
+        * fast/block/float/floats-wrap-inside-inline-004.htm: Added.
+        The span should avoid a float even when its top and bottom does not overlap with the top of the span.
+        In this test the float overlaps inside the span and the span has height set by its style.
+        * fast/block/float/floats-wrap-inside-inline-005-expected.html: Added.
+        * fast/block/float/floats-wrap-inside-inline-005.htm: Added.
+        In this test the float starts and ends inside the span's second linebox, so only the second linebox should avoid the float.
+        * platform/chromium-win/css1/formatting_model/floating_elements-expected.txt:
+        This is a progression due to lineboxes now avoiding floats they overlap.
+
 2012-07-03  Emil A Eklund  <eae@chromium.org>
 
         Unreviewed chromium rebaseline for r121728.
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-001l-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-001l-expected.html
new file mode 100644 (file)
index 0000000..aee29e5
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; text-align: left; }
+div { float: left; clear: left; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="width: 50px; height: 50px;"></div>
+<div style="width: 100px; height: 100px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-001r-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-001r-expected.html
new file mode 100644 (file)
index 0000000..7f4e886
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; text-align: right; }
+div { float: right; clear: right; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="width: 50px; height: 50px;"></div>
+<div style="width: 100px; height: 100px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-002l-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-002l-expected.html
new file mode 100644 (file)
index 0000000..794ed98
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: left; width: 150px; height: 25px;"></div>
+<span></span>
+<div style="height: 100px"></div>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-002r-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-002r-expected.html
new file mode 100644 (file)
index 0000000..e3f25ef
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: right; width: 150px; height: 25px;"></div>
+<span></span>
+<div style="height: 100px"></div>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-003l-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-003l-expected.html
new file mode 100644 (file)
index 0000000..57f58b7
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: left; width: 250px; height: 25px;"></div>
+<span></span>
+<span style="margin-top: 25px; margin-right: 250px"></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-003r-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-003r-expected.html
new file mode 100644 (file)
index 0000000..e6e7887
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: right; width: 250px; height: 25px;"></div>
+<span></span>
+<span style="margin-top: 25px; margin-left: 250px"></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001l-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001l-expected.html
new file mode 100644 (file)
index 0000000..aee29e5
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; text-align: left; }
+div { float: left; clear: left; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="width: 50px; height: 50px;"></div>
+<div style="width: 100px; height: 100px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001l.htm b/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001l.htm
new file mode 100644 (file)
index 0000000..59f4425
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+<link rel="match" href="floats-wrap-top-below-001l-ref.htm">
+<link rel="mismatch" href="floats-wrap-top-below-001l-notref.htm">
+<meta name="assert" content="The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap any floats in the same block formatting context as the element itself.">
+<meta name="flags" content="">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+div { float: left; clear: left; }
+span { display: block; overflow: hidden; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="width: 50px; height: 75px;"></div>
+<div style="width: 100px; height: 75px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001r-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001r-expected.html
new file mode 100644 (file)
index 0000000..9228f46
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; text-align: right; }
+div { float: right; clear: right; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+<div style="width: 50px; height: 50px;"></div>
+<div style="width: 100px; height: 100px;"></div><span></span><span></span>
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001r.htm b/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-001r.htm
new file mode 100644 (file)
index 0000000..cd11708
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+<link rel="match" href="floats-wrap-top-below-001r-ref.htm">
+<link rel="mismatch" href="floats-wrap-top-below-001r-notref.htm">
+<meta name="assert" content="The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap any floats in the same block formatting context as the element itself.">
+<meta name="flags" content="">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+div { float: right; clear: right; }
+span { display: block; overflow: hidden; width: 200px; height: 50px; background: aqua; margin-left: auto; }
+
+</style>
+</head>
+<body>
+
+<div style="width: 50px; height: 75px;"></div>
+<div style="width: 100px; height: 75px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002l-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002l-expected.html
new file mode 100644 (file)
index 0000000..794ed98
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: left; width: 150px; height: 25px;"></div>
+<span></span>
+<div style="height: 100px"></div>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002l.htm b/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002l.htm
new file mode 100644 (file)
index 0000000..0ce9eb8
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+<link rel="match" href="floats-wrap-top-below-002l-ref.htm">
+<meta name="assert" content="The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap any floats in the same block formatting context as the element itself.">
+<meta name="flags" content="">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: block; overflow: hidden; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: left; width: 150px; height: 75px;"></div>
+<div style="float: right; width: 300px; height: 75px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002r-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002r-expected.html
new file mode 100644 (file)
index 0000000..e3f25ef
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: right; width: 150px; height: 25px;"></div>
+<span></span>
+<div style="height: 100px"></div>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002r.htm b/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-002r.htm
new file mode 100644 (file)
index 0000000..5a7171e
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+<link rel="match" href="floats-wrap-top-below-002r-ref.htm">
+<meta name="assert" content="The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap any floats in the same block formatting context as the element itself.">
+<meta name="flags" content="">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: block; overflow: hidden; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: right; width: 150px; height: 75px;"></div>
+<div style="float: left; width: 300px; height: 75px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003l-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003l-expected.html
new file mode 100644 (file)
index 0000000..57f58b7
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: left; width: 250px; height: 25px;"></div>
+<span></span>
+<span style="margin-top: 25px; margin-right: 250px"></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003l.htm b/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003l.htm
new file mode 100644 (file)
index 0000000..c1ebe29
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+<link rel="match" href="floats-wrap-top-below-003l-ref.htm">
+<meta name="assert" content="The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap any floats in the same block formatting context as the element itself.">
+<meta name="flags" content="">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: block; overflow: hidden; width: 100px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: left; width: 250px; height: 75px;"></div>
+<div style="float: right; width: 250px; height: 75px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003r-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003r-expected.html
new file mode 100644 (file)
index 0000000..e6e7887
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: right; width: 250px; height: 25px;"></div>
+<span></span>
+<span style="margin-top: 25px; margin-left: 250px"></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003r.htm b/LayoutTests/css2.1/20110323/floats-wrap-top-below-bfc-003r.htm
new file mode 100644 (file)
index 0000000..e1d575b
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+<link rel="match" href="floats-wrap-top-below-003r-ref.htm">
+<meta name="assert" content="The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap any floats in the same block formatting context as the element itself.">
+<meta name="flags" content="">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: block; overflow: hidden; width: 100px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: right; width: 250px; height: 75px;"></div>
+<div style="float: left; width: 250px; height: 75px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001l-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001l-expected.html
new file mode 100644 (file)
index 0000000..aee29e5
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; text-align: left; }
+div { float: left; clear: left; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="width: 50px; height: 50px;"></div>
+<div style="width: 100px; height: 100px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001l.htm b/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001l.htm
new file mode 100644 (file)
index 0000000..e0a3127
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+<link rel="match" href="floats-wrap-top-below-001l-ref.htm">
+<link rel="mismatch" href="floats-wrap-top-below-001l-notref.htm">
+<meta name="assert" content="However, line boxes created next to the float are shortened to make room for the margin box of the float.">
+<meta name="flags" content="">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; text-align: left; }
+div { float: left; clear: left; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="width: 50px; height: 75px;"></div>
+<div style="width: 100px; height: 75px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001r-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001r-expected.html
new file mode 100644 (file)
index 0000000..7f4e886
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; text-align: right; }
+div { float: right; clear: right; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="width: 50px; height: 50px;"></div>
+<div style="width: 100px; height: 100px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001r.htm b/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-001r.htm
new file mode 100644 (file)
index 0000000..005bb12
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+<link rel="match" href="floats-wrap-top-below-001r-ref.htm">
+<link rel="mismatch" href="floats-wrap-top-below-001r-notref.htm">
+<meta name="assert" content="However, line boxes created next to the float are shortened to make room for the margin box of the float.">
+<meta name="flags" content="">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; text-align: right; }
+div { float: right; clear: right; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="width: 50px; height: 75px;"></div>
+<div style="width: 100px; height: 75px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002l-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002l-expected.html
new file mode 100644 (file)
index 0000000..794ed98
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: left; width: 150px; height: 25px;"></div>
+<span></span>
+<div style="height: 100px"></div>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002l.htm b/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002l.htm
new file mode 100644 (file)
index 0000000..c350939
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+<link rel="match" href="floats-wrap-top-below-002l-ref.htm">
+<meta name="assert" content="However, line boxes created next to the float are shortened to make room for the margin box of the float.">
+<meta name="flags" content="">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: left; width: 150px; height: 75px;"></div>
+<div style="float: right; width: 300px; height: 75px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002r-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002r-expected.html
new file mode 100644 (file)
index 0000000..e3f25ef
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: right; width: 150px; height: 25px;"></div>
+<span></span>
+<div style="height: 100px"></div>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002r.htm b/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-002r.htm
new file mode 100644 (file)
index 0000000..6815c58
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+<link rel="match" href="floats-wrap-top-below-002r-ref.htm">
+<meta name="assert" content="However, line boxes created next to the float are shortened to make room for the margin box of the float.">
+<meta name="flags" content="">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 200px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: right; width: 150px; height: 75px;"></div>
+<div style="float: left; width: 300px; height: 75px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003l-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003l-expected.html
new file mode 100644 (file)
index 0000000..57f58b7
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: left; width: 250px; height: 25px;"></div>
+<span></span>
+<span style="margin-top: 25px; margin-right: 250px"></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003l.htm b/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003l.htm
new file mode 100644 (file)
index 0000000..7dc2f5a
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+<link rel="match" href="floats-wrap-top-below-003l-ref.htm">
+<meta name="assert" content="However, line boxes created next to the float are shortened to make room for the margin box of the float.">
+<meta name="flags" content="">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: left; width: 250px; height: 75px;"></div>
+<div style="float: right; width: 250px; height: 75px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003r-expected.html b/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003r-expected.html
new file mode 100644 (file)
index 0000000..e6e7887
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: right; width: 250px; height: 25px;"></div>
+<span></span>
+<span style="margin-top: 25px; margin-left: 250px"></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003r.htm b/LayoutTests/css2.1/20110323/floats-wrap-top-below-inline-003r.htm
new file mode 100644 (file)
index 0000000..669cce5
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head>
+<title>CSS Test: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
+<link rel="author" title="L. David Baron" href="http://dbaron.org/">
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+<link rel="match" href="floats-wrap-top-below-003r-ref.htm">
+<meta name="assert" content="However, line boxes created next to the float are shortened to make room for the margin box of the float.">
+<meta name="flags" content="">
+<style type="text/css">
+
+body { width: 400px; border: medium solid; }
+span { display: inline-block; vertical-align: top; width: 100px; height: 50px; background: aqua; }
+
+</style>
+</head>
+<body>
+
+<div style="float: right; width: 250px; height: 75px;"></div>
+<div style="float: left; width: 250px; height: 75px;"></div>
+<span></span>
+<span></span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-zero-height-wrap-001-expected.html b/LayoutTests/css2.1/20110323/floats-zero-height-wrap-001-expected.html
new file mode 100644 (file)
index 0000000..ab28710
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head><title>Test for wrapping around zero-height floats</title>
+
+</head><body><div style="width: 500px; height: 500px; float: left; font-size: 12px;">
+
+  <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: blue; margin-left: 10px;"></span>
+  <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: purple; margin-left: 100px;"></span>
+  <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: fuchsia"></span>
+
+</div>
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-zero-height-wrap-001.htm b/LayoutTests/css2.1/20110323/floats-zero-height-wrap-001.htm
new file mode 100644 (file)
index 0000000..582665d
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head><title>CSS Test: wrapping around zero-height floats</title>
+    <link rel="author" title="L. David Baron" href="http://dbaron.org/">
+    <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+    <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+    <link rel="match" href="floats-zero-height-wrap-001-ref.htm">
+    <meta name="flags" content="">
+    <meta name="assert" content="wrapping around zero-height floats">
+
+</head><body><div style="width: 500px; height: 500px; float: left; font-size: 12px;">
+
+  <div style="float: left; width: 10px; height: 30px"></div>
+  <div style="float: left; clear: left; width: 100px; height: 1px"></div>
+
+  <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: blue;"></span>
+  <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: purple;"></span>
+  <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: fuchsia"></span>
+
+</div>
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-zero-height-wrap-002-expected.html b/LayoutTests/css2.1/20110323/floats-zero-height-wrap-002-expected.html
new file mode 100644 (file)
index 0000000..ab28710
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head><title>Test for wrapping around zero-height floats</title>
+
+</head><body><div style="width: 500px; height: 500px; float: left; font-size: 12px;">
+
+  <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: blue; margin-left: 10px;"></span>
+  <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: purple; margin-left: 100px;"></span>
+  <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: fuchsia"></span>
+
+</div>
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/css2.1/20110323/floats-zero-height-wrap-002.htm b/LayoutTests/css2.1/20110323/floats-zero-height-wrap-002.htm
new file mode 100644 (file)
index 0000000..7568193
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html><head><title>CSS Test: wrapping around zero-height floats</title>
+    <link rel="author" title="L. David Baron" href="http://dbaron.org/">
+    <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
+    <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+    <link rel="match" href="floats-zero-height-wrap-001-ref.htm">
+    <meta name="flags" content="">
+    <meta name="assert" content="wrapping around zero-height floats">
+
+</head><body><div style="width: 500px; height: 500px; float: left; font-size: 12px;">
+
+  <div style="float: left; width: 10px; height: 30px"></div>
+  <div style="float: left; clear: left; width: 100px; height: 0"></div>
+
+  <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: blue;"></span>
+  <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: purple;"></span>
+  <span style="display:inline-block; vertical-align: bottom; height: 20px; width: 300px; background: fuchsia"></span>
+
+</div>
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/fast/block/float/floats-wrap-inside-inline-001-expected.html b/LayoutTests/fast/block/float/floats-wrap-inside-inline-001-expected.html
new file mode 100644 (file)
index 0000000..0bb1b4b
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+    <title>CSS Test: Reference Result</title>
+    <link rel="author" title="WebKit" href="http://webkit.org/">
+    <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+    <style type="text/css">
+        body { width: 400px; background: white}
+        span { display: inline-block; vertical-align: top; width: 40px; background: black; }
+        div { background: black; }
+    </style>
+</head>
+<body>
+<p>There should be two black boxes below.</p>
+<div style="position: absolute; width: 40px; height: 40px; background: black;"></div>
+<div style="position: absolute; left: 58px; width: 40px; height: 40px; background: black;"></div>
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/fast/block/float/floats-wrap-inside-inline-001.htm b/LayoutTests/fast/block/float/floats-wrap-inside-inline-001.htm
new file mode 100644 (file)
index 0000000..c4bea92
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+    <title>CSS Test: Test for wrapping around floats which are overlapped by the element that must avoid them</title>
+    <link rel="author" title="WebKit" href="http://webkit.org/">
+    <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+    <style type="text/css">
+        body { width: 400px; background: white}
+        span { display: inline-block; vertical-align: top; width: 40px; background: black; }
+        div { background: black; }
+    </style>
+</head>
+<body>
+<!--The span should avoid a float even when its top and bottom does not overlap with the top of the span.
+    In this test the float starts and ends inside the span's first linebox.-->
+<p>There should be two black boxes below.</p>
+<div style="position: absolute; width: 40px; height: 40px; background: black;"></div>
+<div style="float: left; width: 40px; height: 5px;  background: white"></div>
+<div style="float: left; clear:left; width: 50px; height: 5px; background: white"></div>
+<span style="line-height: 20px">test<br>test</span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/fast/block/float/floats-wrap-inside-inline-002-expected.html b/LayoutTests/fast/block/float/floats-wrap-inside-inline-002-expected.html
new file mode 100644 (file)
index 0000000..0bb1b4b
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+    <title>CSS Test: Reference Result</title>
+    <link rel="author" title="WebKit" href="http://webkit.org/">
+    <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+    <style type="text/css">
+        body { width: 400px; background: white}
+        span { display: inline-block; vertical-align: top; width: 40px; background: black; }
+        div { background: black; }
+    </style>
+</head>
+<body>
+<p>There should be two black boxes below.</p>
+<div style="position: absolute; width: 40px; height: 40px; background: black;"></div>
+<div style="position: absolute; left: 58px; width: 40px; height: 40px; background: black;"></div>
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/fast/block/float/floats-wrap-inside-inline-002.htm b/LayoutTests/fast/block/float/floats-wrap-inside-inline-002.htm
new file mode 100644 (file)
index 0000000..168dacf
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+    <title>CSS Test: Test for wrapping around floats which are overlapped by the element that must avoid them</title>
+    <link rel="author" title="WebKit" href="http://webkit.org/">
+    <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+    <style type="text/css">
+        body { width: 400px; background: white}
+        span { display: inline-block; vertical-align: top; width: 40px; background: black; }
+        div { background: black; }
+    </style>
+</head>
+<body>
+<!--The span should avoid a float even when its top and bottom does not overlap with the top of the span.
+    In this test the float overlaps the bottom of the span, but is below the span's first linebox.-->
+<p>There should be two black boxes below.</p>
+<div style="position: absolute; width: 40px; height: 40px; background: black;"></div>
+<div style="float: left; width: 40px; height: 21px;  background: white"></div>
+<div style="float: left; clear:left; width: 50px; height: 25px; background: white"></div>
+<span style="line-height: 20px">test<br>test</span>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/fast/block/float/floats-wrap-inside-inline-003-expected.html b/LayoutTests/fast/block/float/floats-wrap-inside-inline-003-expected.html
new file mode 100644 (file)
index 0000000..693c7b7
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+    <title>CSS Test: Reference Result</title>
+    <link rel="author" title="WebKit" href="http://webkit.org/">
+    <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+    <style type="text/css">
+        body { width: 400px; background: white}
+        span { display: inline-block; vertical-align: top; width: 40px; background: black; }
+        div { background: black; }
+    </style>
+</head>
+<body>
+<p>There should be two black boxes below.</p>
+<div style="position: absolute; width: 40px; height: 40px; background: black;"></div>
+<div style="position: absolute; left: 108px; width: 60px; height: 20px; background: black;"></div>
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/fast/block/float/floats-wrap-inside-inline-003.htm b/LayoutTests/fast/block/float/floats-wrap-inside-inline-003.htm
new file mode 100644 (file)
index 0000000..7b2070b
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+    <title>CSS Test: Test for wrapping around floats which are overlapped by the element that must avoid them</title>
+    <link rel="author" title="WebKit" href="http://webkit.org/">
+    <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+    <style type="text/css">
+        body { width: 400px; background: white}
+        span { display: inline; vertical-align: top; width: 40px; background: black; font: 20px Ahem; margin: 0px;}
+        div { background: black; }
+    </style>
+</head>
+<body>
+<!--An inline span should avoid a float even when its top and bottom does not overlap with the top of the span.
+    In this test the float starts and ends inside the span's first linebox.-->
+<p>There should be two black boxes below.</p>
+<div style="position: absolute; width: 40px; height: 40px; background: black;"></div>
+<div style="float: left; width: 40px; height: 15px;  background: white;"></div>
+<div style="float: left; clear:left; width: 100px; height: 35px; background: white;"></div>
+<span>aaa</span>
+
+</body></html>
diff --git a/LayoutTests/fast/block/float/floats-wrap-inside-inline-004-expected.html b/LayoutTests/fast/block/float/floats-wrap-inside-inline-004-expected.html
new file mode 100644 (file)
index 0000000..58ed6a7
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+    <title>CSS Test: Test for wrapping around floats which are overlapped by the element that must avoid them</title>
+    <link rel="author" title="WebKit" href="http://webkit.org/">
+    <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+    <style type="text/css">
+        body { width: 400px; background: white}
+    </style>
+</head>
+<body>
+<!--The span should avoid a float even when its top and bottom does not overlap with the top of the span.
+    In this test the float overlaps inside the span and the span has height set by its style.-->
+<p>There should be two black boxes below.</p>
+<div style="position: absolute; width: 40px; height: 40px; background: black;"></div>
+<div style="position: absolute; left: 58px; width: 40px; height: 20px; background: black;"></div>
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/fast/block/float/floats-wrap-inside-inline-004.htm b/LayoutTests/fast/block/float/floats-wrap-inside-inline-004.htm
new file mode 100644 (file)
index 0000000..0b00273
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+    <title>CSS Test: Test for wrapping around floats which are overlapped by the element that must avoid them</title>
+    <link rel="author" title="WebKit" href="http://webkit.org/">
+    <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+    <style type="text/css">
+        body { width: 400px; background: white}
+        span { display: inline-block; vertical-align: top; width: 40px; background: black;}
+    </style>
+</head>
+<body>
+<!--The span should avoid a float even when its top and bottom does not overlap with the top of the span.
+    In this test the float overlaps inside the span and the span has height set by its style.-->
+<p>There should be two black boxes below.</p>
+<div style="position: absolute; width: 40px; height: 40px; background: black;"></div>
+<div style="float: left; width: 40px; height: 15px;  background: white"></div>
+<div style="float: left; clear:left; width: 50px; height: 25px; background: white"></div>
+<span style="height: 20px; margin: 0px;"></span>
+
+</body></html>
\ No newline at end of file
diff --git a/LayoutTests/fast/block/float/floats-wrap-inside-inline-005-expected.html b/LayoutTests/fast/block/float/floats-wrap-inside-inline-005-expected.html
new file mode 100644 (file)
index 0000000..ad812f2
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+    <title>CSS Test: Reference Test</title>
+    <link rel="author" title="WebKit" href="http://webkit.org/">
+    <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats">
+    <style type="text/css">
+        body { width: 400px; background: white}
+    </style>
+</head>
+<body>
+<p>There should be two black boxes below.</p>
+<div style="display: inline-block; width: 40px; height: 40px; background: black;"></div>
+<div style="display: inline-block; margin-left: 36px; margin-bottom: -1px; width: 40px; height: 20px; background: black;"></div>
+
+</body></html>
\ No newline at end of file
index 59bb63f..25c0903 100644 (file)
@@ -1,8 +1,8 @@
-layer at (0,0) size 785x6441
+layer at (0,0) size 785x6501
   RenderView at (0,0) size 785x600
-layer at (0,0) size 785x6441
-  RenderBlock {HTML} at (0,0) size 785x6441
-    RenderBody {BODY} at (8,8) size 769x6425 [bgcolor=#CCCCCC]
+layer at (0,0) size 785x6501
+  RenderBlock {HTML} at (0,0) size 785x6501
+    RenderBody {BODY} at (8,8) size 769x6485 [bgcolor=#CCCCCC]
       RenderBlock {P} at (0,0) size 769x20
         RenderText {#text} at (0,0) size 337x19
           text run at (0,0) width 337: "The style declarations which apply to the text below are:"
@@ -105,7 +105,7 @@ layer at (0,0) size 785x6441
           text run at (5,165) width 340: "first two should be side by side, whereas the third should"
           text run at (5,185) width 123: "be on the next \"line.\""
       RenderBlock {HR} at (24,992) size 579x2 [border: (1px inset #000000)]
-      RenderBlock {DIV} at (2,1018) size 314x350 [border: (5px solid #800080)]
+      RenderBlock {DIV} at (2,1018) size 314x364 [border: (5px solid #800080)]
         RenderBlock (floating) {P} at (5,5) size 194x74 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)]
           RenderText {#text} at (17,17) size 159x39
             text run at (17,17) width 120: "This is a left-floating"
@@ -115,48 +115,47 @@ layer at (0,0) size 785x6441
             text run at (17,17) width 128: "This is a right-floating"
             text run at (17,37) width 127: "paragraph (second in"
             text run at (17,57) width 49: "source)."
-        RenderText {#text} at (199,5) size 303x339
+        RenderText {#text} at (199,5) size 303x353
           text run at (199,5) width 103: "This is text within"
           text run at (199,25) width 57: "the DIV. "
           text run at (256,25) width 23: "The"
           text run at (199,45) width 99: "floating elements"
-          text run at (199,65) width 90: "within this DIV"
-          text run at (5,85) width 81: "should not go"
-          text run at (5,105) width 106: "beyond the left or"
-          text run at (5,125) width 108: "right inner edge of"
-          text run at (5,145) width 94: "this DIV, which"
-          text run at (5,165) width 86: "means that the"
-          text run at (5,185) width 303: "borders of the floating elements should not overlap"
-          text run at (5,205) width 283: "the top or side borders of the DIV in any way. "
-          text run at (288,205) width 12: "In"
-          text run at (5,225) width 302: "addition, they should not overlap each other in any"
-          text run at (5,245) width 238: "way, nor should the floated elements be"
-          text run at (5,265) width 174: "overwritten by the DIV text. "
-          text run at (179,265) width 90: "In addition, the"
-          text run at (5,285) width 288: "floated elements should not be side-by-side, but"
-          text run at (5,305) width 271: "instead the first should be floated left, and the"
-          text run at (5,325) width 249: "second floated to the right below the first."
-      RenderBlock {HR} at (364,1376) size 41x2 [border: (1px inset #000000)]
-      RenderBlock {DIV} at (2,1386) size 410x230 [border: (5px solid #800080)]
+          text run at (5,79) width 90: "within this DIV"
+          text run at (5,99) width 81: "should not go"
+          text run at (5,119) width 106: "beyond the left or"
+          text run at (5,139) width 108: "right inner edge of"
+          text run at (5,159) width 94: "this DIV, which"
+          text run at (5,179) width 278: "means that the borders of the floating elements"
+          text run at (5,199) width 291: "should not overlap the top or side borders of the"
+          text run at (5,219) width 103: "DIV in any way. "
+          text run at (108,219) width 163: "In addition, they should not"
+          text run at (5,239) width 273: "overlap each other in any way, nor should the"
+          text run at (5,259) width 290: "floated elements be overwritten by the DIV text."
+          text run at (5,279) width 276: "In addition, the floated elements should not be"
+          text run at (5,299) width 303: "side-by-side, but instead the first should be floated"
+          text run at (5,319) width 293: "left, and the second floated to the right below the"
+          text run at (5,339) width 26: "first."
+      RenderBlock {HR} at (364,1390) size 41x2 [border: (1px inset #000000)]
+      RenderBlock {DIV} at (2,1400) size 410x246 [border: (5px solid #800080)]
         RenderImage {IMG} at (5,5) size 256x36 [border: (3px solid #000000)]
         RenderImage {IMG} at (149,41) size 256x36 [border: (3px solid #000000)]
-        RenderText {#text} at (261,5) size 397x219
+        RenderText {#text} at (261,5) size 400x235
           text run at (261,5) width 125: "This is text within the"
-          text run at (261,25) width 35: "DIV. "
-          text run at (296,25) width 70: "The floating"
-          text run at (5,45) width 135: "images within this DIV"
-          text run at (5,65) width 130: "should not go beyond"
-          text run at (5,85) width 357: "the left or right inner edge of this DIV, which means that the"
-          text run at (5,105) width 383: "borders of the floating images should not overlap the top or side"
-          text run at (5,125) width 192: "borders of the DIV in any way. "
-          text run at (197,125) width 163: "In addition, they should not"
-          text run at (5,145) width 393: "overlap each other in any way, nor should the floated elements be"
-          text run at (5,165) width 174: "overwritten by the DIV text. "
-          text run at (179,165) width 223: "In addition, the floated images should"
-          text run at (5,185) width 397: "not be side-by-side, but instead the first should be floated left, and"
-          text run at (5,205) width 271: "the second floated to the right below the first."
-      RenderBlock {HR} at (24,1640) size 579x2 [border: (1px inset #000000)]
-      RenderBlock {DIV} at (2,1666) size 765x130 [border: (5px solid #800080)]
+          text run at (5,41) width 35: "DIV. "
+          text run at (40,41) width 70: "The floating"
+          text run at (5,61) width 135: "images within this DIV"
+          text run at (5,81) width 362: "should not go beyond the left or right inner edge of this DIV,"
+          text run at (5,101) width 372: "which means that the borders of the floating images should not"
+          text run at (5,121) width 332: "overlap the top or side borders of the DIV in any way. "
+          text run at (337,121) width 68: "In addition,"
+          text run at (5,141) width 368: "they should not overlap each other in any way, nor should the"
+          text run at (5,161) width 294: "floated elements be overwritten by the DIV text. "
+          text run at (299,161) width 90: "In addition, the"
+          text run at (5,181) width 371: "floated images should not be side-by-side, but instead the first"
+          text run at (5,201) width 400: "should be floated left, and the second floated to the right below the"
+          text run at (5,221) width 26: "first."
+      RenderBlock {HR} at (24,1670) size 579x2 [border: (1px inset #000000)]
+      RenderBlock {DIV} at (2,1696) size 765x130 [border: (5px solid #800080)]
         RenderBlock (floating) {P} at (566,5) size 194x74 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)]
           RenderText {#text} at (17,17) size 159x39
             text run at (17,17) width 128: "This is a right-floating"
@@ -175,8 +174,8 @@ layer at (0,0) size 785x6441
           text run at (531,65) width 12: "In"
           text run at (199,85) width 551: "addition, the top of the left-floating box should not be higher than the top of the right-floating"
           text run at (5,105) width 27: "box."
-      RenderBlock {HR} at (364,1804) size 41x2 [border: (1px inset #000000)]
-      RenderBlock {DIV} at (2,1814) size 765x70 [border: (5px solid #800080)]
+      RenderBlock {HR} at (364,1834) size 41x2 [border: (1px inset #000000)]
+      RenderBlock {DIV} at (2,1844) size 765x70 [border: (5px solid #800080)]
         RenderImage {IMG} at (5,5) size 15x36 [border: (3px solid #000000)]
         RenderImage {IMG} at (745,5) size 15x36 [border: (3px solid #000000)]
         RenderText {#text} at (20,5) size 710x59
@@ -185,8 +184,8 @@ layer at (0,0) size 785x6441
           text run at (20,25) width 669: "means that the borders of the floating images should not overlap the top or side borders of the DIV in any way. "
           text run at (689,25) width 12: "In"
           text run at (5,45) width 606: "addition, the top of the left-floating image should not be higher than the top of the right-floating image."
-      RenderBlock {HR} at (24,1908) size 579x2 [border: (1px inset #000000)]
-      RenderBlock {DIV} at (2,1934) size 765x130 [border: (5px solid #800080)]
+      RenderBlock {HR} at (24,1938) size 579x2 [border: (1px inset #000000)]
+      RenderBlock {DIV} at (2,1964) size 765x130 [border: (5px solid #800080)]
         RenderText {#text} at (199,5) size 172x19
           text run at (199,5) width 164: "This is text within the DIV. "
           text run at (363,5) width 8: "*"
@@ -210,8 +209,8 @@ layer at (0,0) size 785x6441
           text run at (5,85) width 225: "floating elements occur in the source. "
           text run at (230,85) width 314: "In order to mark these points clearly, an asterisk has"
           text run at (5,105) width 279: "been inserted just before each floated element."
-      RenderBlock {HR} at (364,2073) size 41x2 [border: (1px inset #000000)]
-      RenderBlock {DIV} at (2,2083) size 765x90 [border: (5px solid #800080)]
+      RenderBlock {HR} at (364,2103) size 41x2 [border: (1px inset #000000)]
+      RenderBlock {DIV} at (2,2113) size 765x90 [border: (5px solid #800080)]
         RenderText {#text} at (20,5) size 172x19
           text run at (20,5) width 164: "This is text within the DIV. "
           text run at (184,5) width 8: "*"
@@ -226,8 +225,8 @@ layer at (0,0) size 785x6441
           text run at (5,45) width 560: "of the inline element containing the content just before the floating images occur in the source. "
           text run at (565,45) width 175: "In order to mark these points"
           text run at (5,65) width 407: "clearly, an asterisk has been inserted just before each floated image."
-      RenderBlock {HR} at (24,2197) size 579x2 [border: (1px inset #000000)]
-      RenderBlock {DIV} at (2,2223) size 765x230 [border: (5px solid #800080)]
+      RenderBlock {HR} at (24,2227) size 579x2 [border: (1px inset #000000)]
+      RenderBlock {DIV} at (2,2253) size 765x230 [border: (5px solid #800080)]
         RenderText {#text} at (199,5) size 172x19
           text run at (199,5) width 164: "This is text within the DIV. "
           text run at (363,5) width 8: "*"
@@ -271,8 +270,8 @@ layer at (0,0) size 785x6441
           text run at (373,165) width 379: "If a line has room for a floated element, then the element should"
           text run at (199,185) width 517: "float so that its top is aligned with the top of the line-box in which the asterisk appears."
           text run at (199,205) width 380: "Otherwise, its top should align with the top of the next line-box."
-      RenderBlock {HR} at (364,2462) size 41x2 [border: (1px inset #000000)]
-      RenderBlock {DIV} at (2,2472) size 765x130 [border: (5px solid #800080)]
+      RenderBlock {HR} at (364,2492) size 41x2 [border: (1px inset #000000)]
+      RenderBlock {DIV} at (2,2502) size 765x130 [border: (5px solid #800080)]
         RenderText {#text} at (20,5) size 172x19
           text run at (20,5) width 164: "This is text within the DIV. "
           text run at (184,5) width 8: "*"
@@ -297,8 +296,8 @@ layer at (0,0) size 785x6441
           text run at (571,65) width 181: "If a line has room for a floated"
           text run at (5,85) width 693: "image, then the image should float so that its top is aligned with the top of the line-box in which the asterisk appears."
           text run at (5,105) width 380: "Otherwise, its top should align with the top of the next line-box."
-      RenderBlock {HR} at (24,2626) size 579x2 [border: (1px inset #000000)]
-      RenderBlock {DIV} at (2,2652) size 490x310 [border: (5px solid #800080)]
+      RenderBlock {HR} at (24,2656) size 579x2 [border: (1px inset #000000)]
+      RenderBlock {DIV} at (2,2682) size 490x310 [border: (5px solid #800080)]
         RenderText {#text} at (199,5) size 50x19
           text run at (199,5) width 50: "This is *"
         RenderBlock (floating) {P} at (5,5) size 194x74 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)]
@@ -329,8 +328,8 @@ layer at (0,0) size 785x6441
           text run at (5,245) width 478: "floated elements to align with the top of the line-box following the insertion point"
           text run at (5,265) width 456: "of the floated element to avoid floating elements appearing before text which"
           text run at (5,285) width 213: "precedes it in the source document."
-      RenderBlock {HR} at (364,2970) size 41x2 [border: (1px inset #000000)]
-      RenderBlock {DIV} at (2,2980) size 490x230 [border: (5px solid #800080)]
+      RenderBlock {HR} at (364,3000) size 41x2 [border: (1px inset #000000)]
+      RenderBlock {DIV} at (2,3010) size 490x230 [border: (5px solid #800080)]
         RenderText {#text} at (20,5) size 50x19
           text run at (20,5) width 50: "This is *"
         RenderImage {IMG} at (5,5) size 15x36 [border: (3px solid #000000)]
@@ -352,19 +351,19 @@ layer at (0,0) size 785x6441
           text run at (5,165) width 452: "the top of floated elements to align with the top of the line-box following the"
           text run at (5,185) width 479: "insertion point of the floated element to avoid floating elements appearing before"
           text run at (5,205) width 278: "text which precedes it in the source document."
-      RenderBlock {HR} at (24,3234) size 579x2 [border: (1px inset #000000)]
-      RenderTable {TABLE} at (0,3260) size 769x3165 [border: (1px outset #808080)]
-        RenderTableSection {TBODY} at (1,1) size 767x3163
+      RenderBlock {HR} at (24,3264) size 579x2 [border: (1px inset #000000)]
+      RenderTable {TABLE} at (0,3290) size 769x3195 [border: (1px outset #808080)]
+        RenderTableSection {TBODY} at (1,1) size 767x3193
           RenderTableRow {TR} at (0,0) size 767x28
             RenderTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2]
               RenderInline {STRONG} at (0,0) size 159x19
                 RenderText {#text} at (4,4) size 159x19
                   text run at (4,4) width 159: "TABLE Testing Section"
-          RenderTableRow {TR} at (0,28) size 767x3135
-            RenderTableCell {TD} at (0,1581) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
+          RenderTableRow {TR} at (0,28) size 767x3165
+            RenderTableCell {TD} at (0,1596) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
               RenderText {#text} at (4,4) size 4x19
                 text run at (4,4) width 4: " "
-            RenderTableCell {TD} at (12,28) size 755x3135 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (12,28) size 755x3165 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]
               RenderBlock {P} at (4,4) size 747x40
                 RenderText {#text} at (0,0) size 731x39
                   text run at (0,0) width 645: "On this test page, each test is performed once with floating paragraphs, and then again with floating images. "
@@ -445,7 +444,7 @@ layer at (0,0) size 785x6441
                   text run at (5,165) width 340: "first two should be side by side, whereas the third should"
                   text run at (5,185) width 123: "be on the next \"line.\""
               RenderBlock {HR} at (28,804) size 563x2 [border: (1px inset #000000)]
-              RenderBlock {DIV} at (6,830) size 314x350 [border: (5px solid #800080)]
+              RenderBlock {DIV} at (6,830) size 314x364 [border: (5px solid #800080)]
                 RenderBlock (floating) {P} at (5,5) size 194x74 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)]
                   RenderText {#text} at (17,17) size 159x39
                     text run at (17,17) width 120: "This is a left-floating"
@@ -455,48 +454,47 @@ layer at (0,0) size 785x6441
                     text run at (17,17) width 128: "This is a right-floating"
                     text run at (17,37) width 127: "paragraph (second in"
                     text run at (17,57) width 49: "source)."
-                RenderText {#text} at (199,5) size 303x339
+                RenderText {#text} at (199,5) size 303x353
                   text run at (199,5) width 103: "This is text within"
                   text run at (199,25) width 57: "the DIV. "
                   text run at (256,25) width 23: "The"
                   text run at (199,45) width 99: "floating elements"
-                  text run at (199,65) width 90: "within this DIV"
-                  text run at (5,85) width 81: "should not go"
-                  text run at (5,105) width 106: "beyond the left or"
-                  text run at (5,125) width 108: "right inner edge of"
-                  text run at (5,145) width 94: "this DIV, which"
-                  text run at (5,165) width 86: "means that the"
-                  text run at (5,185) width 303: "borders of the floating elements should not overlap"
-                  text run at (5,205) width 283: "the top or side borders of the DIV in any way. "
-                  text run at (288,205) width 12: "In"
-                  text run at (5,225) width 302: "addition, they should not overlap each other in any"
-                  text run at (5,245) width 238: "way, nor should the floated elements be"
-                  text run at (5,265) width 174: "overwritten by the DIV text. "
-                  text run at (179,265) width 90: "In addition, the"
-                  text run at (5,285) width 288: "floated elements should not be side-by-side, but"
-                  text run at (5,305) width 271: "instead the first should be floated left, and the"
-                  text run at (5,325) width 249: "second floated to the right below the first."
-              RenderBlock {HR} at (357,1188) size 41x2 [border: (1px inset #000000)]
-              RenderBlock {DIV} at (6,1198) size 410x230 [border: (5px solid #800080)]
+                  text run at (5,79) width 90: "within this DIV"
+                  text run at (5,99) width 81: "should not go"
+                  text run at (5,119) width 106: "beyond the left or"
+                  text run at (5,139) width 108: "right inner edge of"
+                  text run at (5,159) width 94: "this DIV, which"
+                  text run at (5,179) width 278: "means that the borders of the floating elements"
+                  text run at (5,199) width 291: "should not overlap the top or side borders of the"
+                  text run at (5,219) width 103: "DIV in any way. "
+                  text run at (108,219) width 163: "In addition, they should not"
+                  text run at (5,239) width 273: "overlap each other in any way, nor should the"
+                  text run at (5,259) width 290: "floated elements be overwritten by the DIV text."
+                  text run at (5,279) width 276: "In addition, the floated elements should not be"
+                  text run at (5,299) width 303: "side-by-side, but instead the first should be floated"
+                  text run at (5,319) width 293: "left, and the second floated to the right below the"
+                  text run at (5,339) width 26: "first."
+              RenderBlock {HR} at (357,1202) size 41x2 [border: (1px inset #000000)]
+              RenderBlock {DIV} at (6,1212) size 410x246 [border: (5px solid #800080)]
                 RenderImage {IMG} at (5,5) size 256x36 [border: (3px solid #000000)]
                 RenderImage {IMG} at (149,41) size 256x36 [border: (3px solid #000000)]
-                RenderText {#text} at (261,5) size 397x219
+                RenderText {#text} at (261,5) size 400x235
                   text run at (261,5) width 125: "This is text within the"
-                  text run at (261,25) width 35: "DIV. "
-                  text run at (296,25) width 70: "The floating"
-                  text run at (5,45) width 135: "images within this DIV"
-                  text run at (5,65) width 130: "should not go beyond"
-                  text run at (5,85) width 357: "the left or right inner edge of this DIV, which means that the"
-                  text run at (5,105) width 383: "borders of the floating images should not overlap the top or side"
-                  text run at (5,125) width 192: "borders of the DIV in any way. "
-                  text run at (197,125) width 163: "In addition, they should not"
-                  text run at (5,145) width 393: "overlap each other in any way, nor should the floated elements be"
-                  text run at (5,165) width 174: "overwritten by the DIV text. "
-                  text run at (179,165) width 223: "In addition, the floated images should"
-                  text run at (5,185) width 397: "not be side-by-side, but instead the first should be floated left, and"
-                  text run at (5,205) width 271: "the second floated to the right below the first."
-              RenderBlock {HR} at (28,1452) size 563x2 [border: (1px inset #000000)]
-              RenderBlock {DIV} at (6,1478) size 743x130 [border: (5px solid #800080)]
+                  text run at (5,41) width 35: "DIV. "
+                  text run at (40,41) width 70: "The floating"
+                  text run at (5,61) width 135: "images within this DIV"
+                  text run at (5,81) width 362: "should not go beyond the left or right inner edge of this DIV,"
+                  text run at (5,101) width 372: "which means that the borders of the floating images should not"
+                  text run at (5,121) width 332: "overlap the top or side borders of the DIV in any way. "
+                  text run at (337,121) width 68: "In addition,"
+                  text run at (5,141) width 368: "they should not overlap each other in any way, nor should the"
+                  text run at (5,161) width 294: "floated elements be overwritten by the DIV text. "
+                  text run at (299,161) width 90: "In addition, the"
+                  text run at (5,181) width 371: "floated images should not be side-by-side, but instead the first"
+                  text run at (5,201) width 400: "should be floated left, and the second floated to the right below the"
+                  text run at (5,221) width 26: "first."
+              RenderBlock {HR} at (28,1482) size 563x2 [border: (1px inset #000000)]
+              RenderBlock {DIV} at (6,1508) size 743x130 [border: (5px solid #800080)]
                 RenderBlock (floating) {P} at (544,5) size 194x74 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)]
                   RenderText {#text} at (17,17) size 159x39
                     text run at (17,17) width 128: "This is a right-floating"
@@ -515,8 +513,8 @@ layer at (0,0) size 785x6441
                   text run at (199,85) width 58: "any way. "
                   text run at (257,85) width 466: "In addition, the top of the left-floating box should not be higher than the top of"
                   text run at (5,105) width 128: "the right-floating box."
-              RenderBlock {HR} at (357,1616) size 41x2 [border: (1px inset #000000)]
-              RenderBlock {DIV} at (6,1626) size 743x70 [border: (5px solid #800080)]
+              RenderBlock {HR} at (357,1646) size 41x2 [border: (1px inset #000000)]
+              RenderBlock {DIV} at (6,1656) size 743x70 [border: (5px solid #800080)]
                 RenderImage {IMG} at (5,5) size 15x36 [border: (3px solid #000000)]
                 RenderImage {IMG} at (723,5) size 15x36 [border: (3px solid #000000)]
                 RenderText {#text} at (20,5) size 710x59
@@ -525,8 +523,8 @@ layer at (0,0) size 785x6441
                   text run at (20,25) width 669: "means that the borders of the floating images should not overlap the top or side borders of the DIV in any way. "
                   text run at (689,25) width 12: "In"
                   text run at (5,45) width 606: "addition, the top of the left-floating image should not be higher than the top of the right-floating image."
-              RenderBlock {HR} at (28,1720) size 563x2 [border: (1px inset #000000)]
-              RenderBlock {DIV} at (6,1746) size 743x130 [border: (5px solid #800080)]
+              RenderBlock {HR} at (28,1750) size 563x2 [border: (1px inset #000000)]
+              RenderBlock {DIV} at (6,1776) size 743x130 [border: (5px solid #800080)]
                 RenderText {#text} at (199,5) size 172x19
                   text run at (199,5) width 164: "This is text within the DIV. "
                   text run at (363,5) width 8: "*"
@@ -550,8 +548,8 @@ layer at (0,0) size 785x6441
                   text run at (5,85) width 315: "just before the floating elements occur in the source. "
                   text run at (320,85) width 222: "In order to mark these points clearly,"
                   text run at (5,105) width 371: "an asterisk has been inserted just before each floated element."
-              RenderBlock {HR} at (357,1885) size 41x2 [border: (1px inset #000000)]
-              RenderBlock {DIV} at (6,1895) size 743x90 [border: (5px solid #800080)]
+              RenderBlock {HR} at (357,1915) size 41x2 [border: (1px inset #000000)]
+              RenderBlock {DIV} at (6,1925) size 743x90 [border: (5px solid #800080)]
                 RenderText {#text} at (20,5) size 172x19
                   text run at (20,5) width 164: "This is text within the DIV. "
                   text run at (184,5) width 8: "*"
@@ -566,8 +564,8 @@ layer at (0,0) size 785x6441
                   text run at (5,45) width 617: "top edge of the inline element containing the content just before the floating images occur in the source. "
                   text run at (622,45) width 100: "In order to mark"
                   text run at (5,65) width 482: "these points clearly, an asterisk has been inserted just before each floated image."
-              RenderBlock {HR} at (28,2009) size 563x2 [border: (1px inset #000000)]
-              RenderBlock {DIV} at (6,2035) size 743x290 [border: (5px solid #800080)]
+              RenderBlock {HR} at (28,2039) size 563x2 [border: (1px inset #000000)]
+              RenderBlock {DIV} at (6,2065) size 743x290 [border: (5px solid #800080)]
                 RenderText {#text} at (199,5) size 172x19
                   text run at (199,5) width 164: "This is text within the DIV. "
                   text run at (363,5) width 8: "*"
@@ -615,8 +613,8 @@ layer at (0,0) size 785x6441
                   text run at (5,245) width 709: "line has room for a floated element, then the element should float so that its top is aligned with the top of the line-box in"
                   text run at (5,265) width 167: "which the asterisk appears. "
                   text run at (172,265) width 380: "Otherwise, its top should align with the top of the next line-box."
-              RenderBlock {HR} at (357,2333) size 41x2 [border: (1px inset #000000)]
-              RenderBlock {DIV} at (6,2343) size 743x130 [border: (5px solid #800080)]
+              RenderBlock {HR} at (357,2363) size 41x2 [border: (1px inset #000000)]
+              RenderBlock {DIV} at (6,2373) size 743x130 [border: (5px solid #800080)]
                 RenderText {#text} at (20,5) size 172x19
                   text run at (20,5) width 164: "This is text within the DIV. "
                   text run at (184,5) width 8: "*"
@@ -642,8 +640,8 @@ layer at (0,0) size 785x6441
                   text run at (5,85) width 714: "for a floated image, then the image should float so that its top is aligned with the top of the line-box in which the asterisk"
                   text run at (5,105) width 56: "appears. "
                   text run at (61,105) width 380: "Otherwise, its top should align with the top of the next line-box."
-              RenderBlock {HR} at (28,2497) size 563x2 [border: (1px inset #000000)]
-              RenderBlock {DIV} at (6,2523) size 490x310 [border: (5px solid #800080)]
+              RenderBlock {HR} at (28,2527) size 563x2 [border: (1px inset #000000)]
+              RenderBlock {DIV} at (6,2553) size 490x310 [border: (5px solid #800080)]
                 RenderText {#text} at (199,5) size 50x19
                   text run at (199,5) width 50: "This is *"
                 RenderBlock (floating) {P} at (5,5) size 194x74 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)]
@@ -674,8 +672,8 @@ layer at (0,0) size 785x6441
                   text run at (5,245) width 478: "floated elements to align with the top of the line-box following the insertion point"
                   text run at (5,265) width 456: "of the floated element to avoid floating elements appearing before text which"
                   text run at (5,285) width 213: "precedes it in the source document."
-              RenderBlock {HR} at (357,2841) size 41x2 [border: (1px inset #000000)]
-              RenderBlock {DIV} at (6,2851) size 490x230 [border: (5px solid #800080)]
+              RenderBlock {HR} at (357,2871) size 41x2 [border: (1px inset #000000)]
+              RenderBlock {DIV} at (6,2881) size 490x230 [border: (5px solid #800080)]
                 RenderText {#text} at (20,5) size 50x19
                   text run at (20,5) width 50: "This is *"
                 RenderImage {IMG} at (5,5) size 15x36 [border: (3px solid #000000)]
@@ -697,4 +695,4 @@ layer at (0,0) size 785x6441
                   text run at (5,165) width 452: "the top of floated elements to align with the top of the line-box following the"
                   text run at (5,185) width 479: "insertion point of the floated element to avoid floating elements appearing before"
                   text run at (5,205) width 278: "text which precedes it in the source document."
-              RenderBlock {HR} at (28,3105) size 563x2 [border: (1px inset #000000)]
+              RenderBlock {HR} at (28,3135) size 563x2 [border: (1px inset #000000)]
index e606ad9..f82eac9 100644 (file)
@@ -1,3 +1,66 @@
+2012-07-03  Robert Hogan  <robert@webkit.org>
+
+        CSS 2.1 failure: floats-wrap-top-below-inline-* fail
+        https://bugs.webkit.org/show_bug.cgi?id=88171
+
+        Reviewed by Eric Seidel.
+
+        When shifting a line or element left or right to avoid a float use the height
+        of the line or element to determine whether the float is inside the element or
+        if it overlaps the bottom of the element. 
+
+        Do this by passing the height of the element to the interval tree used to detect
+        the overlap with it's containing block's floats. The height is zero by default so
+        callers to logical[Left|Right]OffsetForLine will need to pass the height if they
+        want to use it to detect floats to avoid.
+
+        Tests: css2.1/20110323/floats-wrap-top-below-bfc-001l.htm
+               css2.1/20110323/floats-wrap-top-below-bfc-001r.htm
+               css2.1/20110323/floats-wrap-top-below-bfc-002l.htm
+               css2.1/20110323/floats-wrap-top-below-bfc-002r.htm
+               css2.1/20110323/floats-wrap-top-below-bfc-003l.htm
+               css2.1/20110323/floats-wrap-top-below-bfc-003r.htm
+               css2.1/20110323/floats-wrap-top-below-inline-001l.htm
+               css2.1/20110323/floats-wrap-top-below-inline-001r.htm
+               css2.1/20110323/floats-wrap-top-below-inline-002l.htm
+               css2.1/20110323/floats-wrap-top-below-inline-002r.htm
+               css2.1/20110323/floats-wrap-top-below-inline-003l.htm
+               css2.1/20110323/floats-wrap-top-below-inline-003r.htm
+               css2.1/20110323/floats-zero-height-wrap-001.htm
+               css2.1/20110323/floats-zero-height-wrap-002.htm
+               fast/block/float/floats-wrap-inside-inline-001.htm
+               fast/block/float/floats-wrap-inside-inline-002.htm
+               fast/block/float/floats-wrap-inside-inline-003.htm
+               fast/block/float/floats-wrap-inside-inline-004.htm
+               fast/block/float/floats-wrap-inside-inline-005.htm
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
+        (WebCore::::collectIfNeeded):
+        (WebCore::RenderBlock::logicalLeftOffsetForLine):
+        (WebCore::RenderBlock::logicalRightOffsetForLine):
+        (WebCore::RenderBlock::getClearDelta):
+        * rendering/RenderBlock.h:
+        (WebCore::RenderBlock::availableLogicalWidthForLine):
+        (WebCore::RenderBlock::logicalRightOffsetForLine):
+        (WebCore::RenderBlock::logicalLeftOffsetForLine):
+        (WebCore::RenderBlock::startOffsetForLine):
+        (WebCore::RenderBlock::endOffsetForLine):
+        (WebCore::RenderBlock::pixelSnappedLogicalLeftOffsetForLine):
+        (WebCore::RenderBlock::pixelSnappedLogicalRightOffsetForLine):
+        (RenderBlock):
+        (WebCore::RenderBlock::FloatIntervalSearchAdapter::FloatIntervalSearchAdapter):
+        (WebCore::RenderBlock::FloatIntervalSearchAdapter::lowValue):
+        (WebCore::RenderBlock::FloatIntervalSearchAdapter::highValue):
+        (FloatIntervalSearchAdapter):
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::logicalBottomForLine):
+        (WebCore):
+        (WebCore::LineWidth::updateAvailableWidth):
+        (WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
+
 2012-07-03  Vsevolod Vlasov  <vsevik@chromium.org>
 
         Web Inspector: Introduce Workspace make it UISourceCode provider for ScriptsPanel.
index 0c7d894..ce7aceb 100755 (executable)
@@ -2137,7 +2137,8 @@ LayoutUnit RenderBlock::computeStartPositionDeltaForChildAvoidingFloats(const Re
     if (region)
         blockOffset = max(blockOffset, blockOffset + (region->offsetFromLogicalTopOfFirstPage() - offsetFromLogicalTopOfFirstPage));
 
-    LayoutUnit startOff = startOffsetForLine(blockOffset, false, region, offsetFromLogicalTopOfFirstPage);
+    LayoutUnit startOff = startOffsetForLine(blockOffset, false, region, offsetFromLogicalTopOfFirstPage, logicalHeightForChild(child));
+
     if (style()->textAlign() != WEBKIT_CENTER && !child->style()->marginStartUsing(style()).isAuto()) {
         if (childMarginStart < 0)
             startOff += childMarginStart;
@@ -3961,27 +3962,48 @@ void RenderBlock::clearPercentHeightDescendantsFrom(RenderBox* parent)
     }
 }
 
+static bool rangesIntersect(int floatTop, int floatBottom, int objectTop, int objectBottom)
+{
+    if (objectTop >= floatBottom || objectBottom < floatTop)
+        return false;
+
+    // The top of the object overlaps the float
+    if (objectTop >= floatTop)
+        return true;
+
+    // The object encloses the float
+    if (objectTop < floatTop && objectBottom > floatBottom)
+        return true;
+
+    // The bottom of the object overlaps the float
+    if (objectBottom > objectTop && objectBottom > floatTop && objectBottom <= floatBottom)
+        return true;
+
+    return false;
+}
+
 template <RenderBlock::FloatingObject::Type FloatTypeValue>
 inline void RenderBlock::FloatIntervalSearchAdapter<FloatTypeValue>::collectIfNeeded(const IntervalType& interval) const
 {
     const FloatingObject* r = interval.data();
-    if (r->type() == FloatTypeValue && interval.low() <= m_value && m_value < interval.high()) {
-        // All the objects returned from the tree should be already placed.
-        ASSERT(r->isPlaced() && m_renderer->pixelSnappedLogicalTopForFloat(r) <= m_value && m_renderer->pixelSnappedLogicalBottomForFloat(r) > m_value);
+    if (r->type() != FloatTypeValue || !rangesIntersect(interval.low(), interval.high(), m_lowValue, m_highValue))
+        return;
 
-        if (FloatTypeValue == FloatingObject::FloatLeft 
-            && m_renderer->logicalRightForFloat(r) > m_offset) {
-            m_offset = m_renderer->logicalRightForFloat(r);
-            if (m_heightRemaining)
-                *m_heightRemaining = m_renderer->logicalBottomForFloat(r) - m_value;
-        }
+    // All the objects returned from the tree should be already placed.
+    ASSERT(r->isPlaced() && rangesIntersect(m_renderer->pixelSnappedLogicalTopForFloat(r), m_renderer->pixelSnappedLogicalBottomForFloat(r), m_lowValue, m_highValue));
 
-        if (FloatTypeValue == FloatingObject::FloatRight
-            && m_renderer->logicalLeftForFloat(r) < m_offset) {
-            m_offset = m_renderer->logicalLeftForFloat(r);
-            if (m_heightRemaining)
-                *m_heightRemaining = m_renderer->logicalBottomForFloat(r) - m_value;
-        }
+    if (FloatTypeValue == FloatingObject::FloatLeft 
+        && m_renderer->logicalRightForFloat(r) > m_offset) {
+        m_offset = m_renderer->logicalRightForFloat(r);
+        if (m_heightRemaining)
+            *m_heightRemaining = m_renderer->logicalBottomForFloat(r) - m_lowValue;
+    }
+
+    if (FloatTypeValue == FloatingObject::FloatRight
+        && m_renderer->logicalLeftForFloat(r) < m_offset) {
+        m_offset = m_renderer->logicalLeftForFloat(r);
+        if (m_heightRemaining)
+            *m_heightRemaining = m_renderer->logicalBottomForFloat(r) - m_lowValue;
     }
 }
 
@@ -4015,14 +4037,14 @@ LayoutUnit RenderBlock::logicalRightOffsetForContent(RenderRegion* region, Layou
     return logicalRightOffset - (logicalWidth() - (isHorizontalWritingMode() ? boxRect.maxX() : boxRect.maxY()));
 }
 
-LayoutUnit RenderBlock::logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const
+LayoutUnit RenderBlock::logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining, LayoutUnit logicalHeight) const
 {
     LayoutUnit left = fixedOffset;
     if (m_floatingObjects && m_floatingObjects->hasLeftObjects()) {
         if (heightRemaining)
             *heightRemaining = 1;
 
-        FloatIntervalSearchAdapter<FloatingObject::FloatLeft> adapter(this, roundToInt(logicalTop), left, heightRemaining);
+        FloatIntervalSearchAdapter<FloatingObject::FloatLeft> adapter(this, roundToInt(logicalTop), roundToInt(logicalTop + logicalHeight), left, heightRemaining);
         m_floatingObjects->placedFloatsTree().allOverlapsWithAdapter(adapter);
     }
 
@@ -4062,7 +4084,7 @@ LayoutUnit RenderBlock::logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUn
     return left;
 }
 
-LayoutUnit RenderBlock::logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const
+LayoutUnit RenderBlock::logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining, LayoutUnit logicalHeight) const
 {
     LayoutUnit right = fixedOffset;
     if (m_floatingObjects && m_floatingObjects->hasRightObjects()) {
@@ -4070,7 +4092,7 @@ LayoutUnit RenderBlock::logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutU
             *heightRemaining = 1;
 
         LayoutUnit rightFloatOffset = fixedOffset;
-        FloatIntervalSearchAdapter<FloatingObject::FloatRight> adapter(this, roundToInt(logicalTop), rightFloatOffset, heightRemaining);
+        FloatIntervalSearchAdapter<FloatingObject::FloatRight> adapter(this, roundToInt(logicalTop), roundToInt(logicalTop + logicalHeight), rightFloatOffset, heightRemaining);
         m_floatingObjects->placedFloatsTree().allOverlapsWithAdapter(adapter);
         right = min(right, rightFloatOffset);
     }
@@ -4511,7 +4533,7 @@ LayoutUnit RenderBlock::getClearDelta(RenderBox* child, LayoutUnit logicalTop)
     if (!result && child->avoidsFloats()) {
         LayoutUnit newLogicalTop = logicalTop;
         while (true) {
-            LayoutUnit availableLogicalWidthAtNewLogicalTopOffset = availableLogicalWidthForLine(newLogicalTop, false);
+            LayoutUnit availableLogicalWidthAtNewLogicalTopOffset = availableLogicalWidthForLine(newLogicalTop, false, logicalHeightForChild(child));
             if (availableLogicalWidthAtNewLogicalTopOffset == availableLogicalWidthForContent(newLogicalTop))
                 return newLogicalTop - logicalTop;
 
index 5d39398..3351c20 100644 (file)
@@ -131,62 +131,62 @@ public:
 
     // Versions that can compute line offsets with the region and page offset passed in. Used for speed to avoid having to
     // compute the region all over again when you already know it.
-    LayoutUnit availableLogicalWidthForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage) const
+    LayoutUnit availableLogicalWidthForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const
     {
-        return max(ZERO_LAYOUT_UNIT, logicalRightOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage)
-            - logicalLeftOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage));
+        return max(ZERO_LAYOUT_UNIT, logicalRightOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage, logicalHeight)
+            - logicalLeftOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage, logicalHeight));
     }
-    LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage) const 
+    LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const 
     {
-        return logicalRightOffsetForLine(position, logicalRightOffsetForContent(region, offsetFromLogicalTopOfFirstPage), firstLine);
+        return logicalRightOffsetForLine(position, logicalRightOffsetForContent(region, offsetFromLogicalTopOfFirstPage), firstLine, 0, logicalHeight);
     }
-    LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage) const 
+    LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const 
     {
-        return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(region, offsetFromLogicalTopOfFirstPage), firstLine);
+        return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(region, offsetFromLogicalTopOfFirstPage), firstLine, 0, logicalHeight);
     }
-    LayoutUnit startOffsetForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage) const
+    LayoutUnit startOffsetForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const
     {
-        return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage)
-            : logicalWidth() - logicalRightOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage);
+        return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage, logicalHeight)
+            : logicalWidth() - logicalRightOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage, logicalHeight);
     }
-    LayoutUnit endOffsetForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage) const
+    LayoutUnit endOffsetForLine(LayoutUnit position, bool firstLine, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage, LayoutUnit logicalHeight = 0) const
     {
-        return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage)
-            : logicalWidth() - logicalRightOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage);
+        return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage, logicalHeight)
+            : logicalWidth() - logicalRightOffsetForLine(position, firstLine, region, offsetFromLogicalTopOfFirstPage, logicalHeight);
     }
 
-    LayoutUnit availableLogicalWidthForLine(LayoutUnit position, bool firstLine) const
+    LayoutUnit availableLogicalWidthForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const
     {
-        return availableLogicalWidthForLine(position, firstLine, regionAtBlockOffset(position), offsetFromLogicalTopOfFirstPage());
+        return availableLogicalWidthForLine(position, firstLine, regionAtBlockOffset(position), offsetFromLogicalTopOfFirstPage(), logicalHeight);
     }
-    LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool firstLine) const 
+    LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const 
     {
-        return logicalRightOffsetForLine(position, logicalRightOffsetForContent(position), firstLine, 0);
+        return logicalRightOffsetForLine(position, logicalRightOffsetForContent(position), firstLine, 0, logicalHeight);
     }
-    LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool firstLine) const 
+    LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const 
     {
-        return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(position), firstLine, 0);
+        return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(position), firstLine, 0, logicalHeight);
     }
-    LayoutUnit pixelSnappedLogicalLeftOffsetForLine(LayoutUnit position, bool firstLine) const 
+    LayoutUnit pixelSnappedLogicalLeftOffsetForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const 
     {
-        return roundToInt(logicalLeftOffsetForLine(position, firstLine));
+        return roundToInt(logicalLeftOffsetForLine(position, firstLine, logicalHeight));
     }
-    LayoutUnit pixelSnappedLogicalRightOffsetForLine(LayoutUnit position, bool firstLine) const 
+    LayoutUnit pixelSnappedLogicalRightOffsetForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const 
     {
         // FIXME: Multicolumn layouts break carrying over subpixel values to the logical right offset because the lines may be shifted
         // by a subpixel value for all but the first column. This can lead to the actual pixel snapped width of the column being off
         // by one pixel when rendered versus layed out, which can result in the line being clipped. For now, we have to floor.
-        return floorToInt(logicalRightOffsetForLine(position, firstLine));
+        return floorToInt(logicalRightOffsetForLine(position, firstLine, logicalHeight));
     }
-    LayoutUnit startOffsetForLine(LayoutUnit position, bool firstLine) const
+    LayoutUnit startOffsetForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const
     {
-        return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine)
-            : logicalWidth() - logicalRightOffsetForLine(position, firstLine);
+        return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine, logicalHeight)
+            : logicalWidth() - logicalRightOffsetForLine(position, firstLine, logicalHeight);
     }
-    LayoutUnit endOffsetForLine(LayoutUnit position, bool firstLine) const
+    LayoutUnit endOffsetForLine(LayoutUnit position, bool firstLine, LayoutUnit logicalHeight = 0) const
     {
-        return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine)
-            : logicalWidth() - logicalRightOffsetForLine(position, firstLine);
+        return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine, logicalHeight)
+            : logicalWidth() - logicalRightOffsetForLine(position, firstLine, logicalHeight);
     }
 
     LayoutUnit startAlignedOffsetForLine(RenderBox* child, LayoutUnit position, bool firstLine);
@@ -415,8 +415,8 @@ protected:
     virtual void paint(PaintInfo&, const LayoutPoint&);
     virtual void paintObject(PaintInfo&, const LayoutPoint&);
    
-    LayoutUnit logicalRightOffsetForLine(LayoutUnit position, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* logicalHeightRemaining = 0) const;
-    LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* logicalHeightRemaining = 0) const;
+    LayoutUnit logicalRightOffsetForLine(LayoutUnit position, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* logicalHeightRemaining = 0, LayoutUnit logicalHeight = 0) const;
+    LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, LayoutUnit fixedOffset, bool applyTextIndent, LayoutUnit* logicalHeightRemaining = 0, LayoutUnit logicalHeight = 0) const;
 
     virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const;
     virtual void adjustInlineDirectionLineBounds(int /* expansionOpportunityCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { }
@@ -1000,21 +1000,23 @@ protected:
     public:
         typedef FloatingObjectInterval IntervalType;
         
-        FloatIntervalSearchAdapter(const RenderBlock* renderer, int value, LayoutUnit& offset, LayoutUnit* heightRemaining)
+        FloatIntervalSearchAdapter(const RenderBlock* renderer, int lowValue, int highValue, LayoutUnit& offset, LayoutUnit* heightRemaining)
             : m_renderer(renderer)
-            , m_value(value)
+            , m_lowValue(lowValue)
+            , m_highValue(highValue)
             , m_offset(offset)
             , m_heightRemaining(heightRemaining)
         {
         }
         
-        inline int lowValue() const { return m_value; }
-        inline int highValue() const { return m_value; }
+        inline int lowValue() const { return m_lowValue; }
+        inline int highValue() const { return m_highValue; }
         void collectIfNeeded(const IntervalType&) const;
 
     private:
         const RenderBlock* m_renderer;
-        int m_value;
+        int m_lowValue;
+        int m_highValue;
         LayoutUnit& m_offset;
         LayoutUnit* m_heightRemaining;
     };
index b1ce611..088c14c 100755 (executable)
@@ -112,11 +112,26 @@ private:
     bool m_isFirstLine;
 };
 
+static LayoutUnit logicalHeightForLine(RenderBlock* block)
+{
+    InlineFlowBox* lineBox = block->firstRootBox();
+    LayoutUnit logicalHeight = 0;
+    if (!lineBox)
+        return logicalHeight;
+
+    if (lineBox->firstChild() && lineBox->firstChild()->renderer() && lineBox->firstChild()->renderer()->isRenderBlock())
+        logicalHeight = toRenderBlock(lineBox->firstChild()->renderer())->logicalHeight();
+    else
+        logicalHeight = lineBox->height();
+    return logicalHeight;
+}
+
 inline void LineWidth::updateAvailableWidth()
 {
     LayoutUnit height = m_block->logicalHeight();
-    m_left = m_block->logicalLeftOffsetForLine(height, m_isFirstLine);
-    m_right = m_block->logicalRightOffsetForLine(height, m_isFirstLine);
+    LayoutUnit logicalHeight = logicalHeightForLine(m_block);
+    m_left = m_block->logicalLeftOffsetForLine(height, m_isFirstLine, logicalHeight);
+    m_right = m_block->logicalRightOffsetForLine(height, m_isFirstLine, logicalHeight);
 
     computeAvailableWidthFromLeftAndRight();
 }
@@ -751,8 +766,10 @@ void RenderBlock::computeInlineDirectionPositionsForLine(RootInlineBox* lineBox,
                                                          GlyphOverflowAndFallbackFontsMap& textBoxDataMap, VerticalPositionCache& verticalPositionCache)
 {
     ETextAlign textAlign = textAlignmentForLine(!reachedEnd && !lineBox->endsWithBreak());
-    float logicalLeft = pixelSnappedLogicalLeftOffsetForLine(logicalHeight(), lineInfo.isFirstLine());
-    float availableLogicalWidth = pixelSnappedLogicalRightOffsetForLine(logicalHeight(), lineInfo.isFirstLine()) - logicalLeft;
+    
+    LayoutUnit lineLogicalHeight = logicalHeightForLine(this);
+    float logicalLeft = pixelSnappedLogicalLeftOffsetForLine(logicalHeight(), lineInfo.isFirstLine(), lineLogicalHeight);
+    float availableLogicalWidth = pixelSnappedLogicalRightOffsetForLine(logicalHeight(), lineInfo.isFirstLine(), lineLogicalHeight) - logicalLeft;
 
     bool needsWordSpacing = false;
     float totalLogicalWidth = lineBox->getFlowSpacingLogicalWidth();
index 3fd97df..8d82820 100644 (file)
@@ -1238,7 +1238,7 @@ LayoutUnit RenderBox::containingBlockAvailableLineWidthInRegion(RenderRegion* re
         logicalTopPosition = max(logicalTopPosition, logicalTopPosition + offsetFromLogicalTopOfRegion);
         containingBlockRegion = cb->clampToStartAndEndRegions(region);
     }
-    return cb->availableLogicalWidthForLine(logicalTopPosition, false, containingBlockRegion, adjustedPageOffsetForContainingBlock);
+    return cb->availableLogicalWidthForLine(logicalTopPosition, false, containingBlockRegion, adjustedPageOffsetForContainingBlock, availableLogicalHeight());
 }
 
 LayoutUnit RenderBox::perpendicularContainingBlockLogicalHeight() const