Title: [148223] trunk
Revision
148223
Author
rob...@webkit.org
Date
2013-04-11 12:17:12 -0700 (Thu, 11 Apr 2013)

Log Message

REGRESSION (142152): ensure we skip past out-of-flow objects when detecting whitespace to ignore after leading empty inlines
https://bugs.webkit.org/show_bug.cgi?id=114311

Reviewed by Emil A Eklund.

Source/WebCore:

When we hit an empty inline in line layout and try to detect whether it has any whitespace after it that we ought to ignore, then
we need to skip past out-of-flow and floating objects when looking for that whitespace. Failure to do so will result in us
adding the width from the first space we encounter to our line width and over-estimating the real width of the line.

We're hitting this bug now because we have broadened the category of empty inlines that get lineboxes so we go into line layout
and have to deal with them and their subsequent whitespace there. Previously this sort of whitespace would have been simply
consumed by |skipLeadingWhitespace|.

Test: fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::shouldSkipWhitespaceAfterStartObject):

LayoutTests:

* fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline-expected.txt: Added.
* fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (148222 => 148223)


--- trunk/LayoutTests/ChangeLog	2013-04-11 19:14:01 UTC (rev 148222)
+++ trunk/LayoutTests/ChangeLog	2013-04-11 19:17:12 UTC (rev 148223)
@@ -1,3 +1,13 @@
+2013-04-11  Robert Hogan  <rob...@webkit.org>
+
+        REGRESSION (142152): ensure we skip past out-of-flow objects when detecting whitespace to ignore after leading empty inlines
+        https://bugs.webkit.org/show_bug.cgi?id=114311
+
+        Reviewed by Emil A Eklund.
+
+        * fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline-expected.txt: Added.
+        * fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline.html: Added.
+
 2013-04-11  Ryosuke Niwa  <rn...@webkit.org>
 
         Autocorrected text doesn't have a marker of type autocorrected

Added: trunk/LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline-expected.txt (0 => 148223)


--- trunk/LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline-expected.txt	2013-04-11 19:17:12 UTC (rev 148223)
@@ -0,0 +1,19 @@
+webkit.org/p/114311: The text should be inside the input controls.
+
+Input 
+PASS
+Input 
+PASS
+Input 
+PASS
+Input 
+PASS
+Input
+PASS
+Input
+PASS
+Input 
+PASS
+Input 
+PASS
+

Added: trunk/LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline.html (0 => 148223)


--- trunk/LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline.html	                        (rev 0)
+++ trunk/LayoutTests/fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline.html	2013-04-11 19:17:12 UTC (rev 148223)
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <style>
+            body > span {
+                display: inline-block;
+                vertical-align: top;
+                font: 20px/1 Ahem;
+            }
+            .container-absolute > label > span {
+                padding: 5px;
+                position: absolute;
+            }
+            .container-float > label > span {
+                padding: 5px;
+                float: left;
+            }
+            input {
+                border-top: 0px;
+                border-bottom: 0px;
+                margin-top: 0px;
+                margin-bottom: 0px;
+                padding-top: 0px;
+                padding-bottom: 0px;
+            }
+        </style>
+        <script src=""
+    </head>
+    <body>
+        <p>webkit.org/p/114311: The text should be inside the input controls. </p>
+        <span id="id1" class="container-absolute" data-expected-height="20px"><label for=""    <input id="input-field" type="text"></span>
+        <span id="id2" class="container-float" data-expected-height="30px"><label for=""    <input id="input-field" type="text"></span>
+        <span id="id3" class="container-absolute" data-expected-height="20px"><label for="" <input id="input-field" type="text"></span>
+        <span id="id4" class="container-float" data-expected-height="30px"><label for="" <input id="input-field" type="text"></span>
+        <span id="id5" class="container-absolute" data-expected-height="20px"><label for="" id="input-field" type="text"></span>
+        <span id="id6" class="container-float" data-expected-height="30px"><label for="" id="input-field" type="text"></span>
+        <span id="id7" class="container-absolute" data-expected-height="20px">
+            <label for=""
+            <input id="input-field" type="text">
+        </span>
+        <span id="id8" class="container-float" data-expected-height="30px">
+            <label for=""
+            <input id="input-field" type="text">
+        </span>
+        <script>
+            checkLayout('#id1');
+            checkLayout('#id2');
+            checkLayout('#id3');
+            checkLayout('#id4');
+            checkLayout('#id5');
+            checkLayout('#id6');
+            checkLayout('#id7');
+            checkLayout('#id8');
+        </script>
+    </body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (148222 => 148223)


--- trunk/Source/WebCore/ChangeLog	2013-04-11 19:14:01 UTC (rev 148222)
+++ trunk/Source/WebCore/ChangeLog	2013-04-11 19:17:12 UTC (rev 148223)
@@ -1,3 +1,23 @@
+2013-04-11  Robert Hogan  <rob...@webkit.org>
+
+        REGRESSION (142152): ensure we skip past out-of-flow objects when detecting whitespace to ignore after leading empty inlines
+        https://bugs.webkit.org/show_bug.cgi?id=114311
+
+        Reviewed by Emil A Eklund.
+
+        When we hit an empty inline in line layout and try to detect whether it has any whitespace after it that we ought to ignore, then
+        we need to skip past out-of-flow and floating objects when looking for that whitespace. Failure to do so will result in us
+        adding the width from the first space we encounter to our line width and over-estimating the real width of the line.
+
+        We're hitting this bug now because we have broadened the category of empty inlines that get lineboxes so we go into line layout 
+        and have to deal with them and their subsequent whitespace there. Previously this sort of whitespace would have been simply
+        consumed by |skipLeadingWhitespace|.
+
+        Test: fast/inline/out-of-flow-objects-and-whitespace-after-empty-inline.html
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::shouldSkipWhitespaceAfterStartObject):
+
 2013-04-11  Ryosuke Niwa  <rn...@webkit.org>
 
         Autocorrected text doesn't have a marker of type autocorrected

Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (148222 => 148223)


--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2013-04-11 19:14:01 UTC (rev 148222)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2013-04-11 19:17:12 UTC (rev 148223)
@@ -2447,6 +2447,9 @@
 static bool shouldSkipWhitespaceAfterStartObject(RenderBlock* block, RenderObject* o, LineMidpointState& lineMidpointState)
 {
     RenderObject* next = bidiNextSkippingEmptyInlines(block, o);
+    while (next && next->isFloatingOrOutOfFlowPositioned())
+        next = bidiNextSkippingEmptyInlines(block, next);
+
     if (next && !next->isBR() && next->isText() && toRenderText(next)->textLength() > 0) {
         RenderText* nextText = toRenderText(next);
         UChar nextChar = nextText->characterAt(0);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to