WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 May 2008 05:06:58 +0000 (05:06 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 May 2008 05:06:58 +0000 (05:06 +0000)
        Reviewed by Mark Rowe.

        - fix https://bugs.webkit.org/show_bug.cgi?id=18818
          <rdar://problem/5901544> REGRESSION (3.1.1-TOT): Character order (float:left ordered after the first letter)

        Test: fast/css/first-letter-float-after-float.html

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::updateFirstLetter): Changed to add the first
        letter container right before the rest of the text it is taken from,
        instead of at the beginning of the block.

LayoutTests:

        Reviewed by Mark Rowe.

        - test and updated results for https://bugs.webkit.org/show_bug.cgi?id=18818
          <rdar://problem/5901544> REGRESSION (3.1.1-TOT): Character order (float:left ordered after the first letter)

        * ChangeLog:
        * fast/css/first-letter-float-after-float.html: Added.
        * platform/mac-leopard/fast/css/first-letter-skip-out-of-flow-expected.checksum:
        * platform/mac-leopard/fast/css/first-letter-skip-out-of-flow-expected.png:
        * platform/mac/fast/css/first-letter-float-after-float-expected.checksum: Added.
        * platform/mac/fast/css/first-letter-float-after-float-expected.png: Added.
        * platform/mac/fast/css/first-letter-float-after-float-expected.txt: Added.
        * platform/mac/fast/css/first-letter-skip-out-of-flow-expected.txt:

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

LayoutTests/ChangeLog
LayoutTests/fast/css/first-letter-float-after-float.html [new file with mode: 0644]
LayoutTests/platform/mac-leopard/fast/css/first-letter-skip-out-of-flow-expected.checksum
LayoutTests/platform/mac-leopard/fast/css/first-letter-skip-out-of-flow-expected.png
LayoutTests/platform/mac/fast/css/first-letter-float-after-float-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/first-letter-float-after-float-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/first-letter-float-after-float-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/first-letter-skip-out-of-flow-expected.txt
WebCore/ChangeLog
WebCore/rendering/RenderBlock.cpp

index de2f5f3..f10e097 100644 (file)
@@ -1,3 +1,19 @@
+2008-05-08  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        - test and updated results for https://bugs.webkit.org/show_bug.cgi?id=18818
+          <rdar://problem/5901544> REGRESSION (3.1.1-TOT): Character order (float:left ordered after the first letter)
+
+        * ChangeLog:
+        * fast/css/first-letter-float-after-float.html: Added.
+        * platform/mac-leopard/fast/css/first-letter-skip-out-of-flow-expected.checksum:
+        * platform/mac-leopard/fast/css/first-letter-skip-out-of-flow-expected.png:
+        * platform/mac/fast/css/first-letter-float-after-float-expected.checksum: Added.
+        * platform/mac/fast/css/first-letter-float-after-float-expected.png: Added.
+        * platform/mac/fast/css/first-letter-float-after-float-expected.txt: Added.
+        * platform/mac/fast/css/first-letter-skip-out-of-flow-expected.txt:
+
 2008-05-08  Simon Hausmann  <hausmann@webkit.org>
 
         Reviewed by Holger.
diff --git a/LayoutTests/fast/css/first-letter-float-after-float.html b/LayoutTests/fast/css/first-letter-float-after-float.html
new file mode 100644 (file)
index 0000000..780ab53
--- /dev/null
@@ -0,0 +1,11 @@
+<style>
+    div:first-letter { float: left; }
+</style>
+<p>
+    Test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=18818">https://bugs.webkit.org/show_bug.cgi?id=18818</a>
+    REGRESSION (3.1.1-TOT): Character order (float:left ordered after the first letter)</i>.
+</p>
+<p>
+    The next line should say &ldquo;123&rdquo;.
+</p>
+<div><span style="float: left;">1</span>23</div>
index 7d9cc40..b82adcc 100644 (file)
Binary files a/LayoutTests/platform/mac-leopard/fast/css/first-letter-skip-out-of-flow-expected.png and b/LayoutTests/platform/mac-leopard/fast/css/first-letter-skip-out-of-flow-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/css/first-letter-float-after-float-expected.checksum b/LayoutTests/platform/mac/fast/css/first-letter-float-after-float-expected.checksum
new file mode 100644 (file)
index 0000000..c13a4f3
--- /dev/null
@@ -0,0 +1 @@
+f2222425c9138fdc6d00c6416a59b127
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/css/first-letter-float-after-float-expected.png b/LayoutTests/platform/mac/fast/css/first-letter-float-after-float-expected.png
new file mode 100644 (file)
index 0000000..7296950
Binary files /dev/null and b/LayoutTests/platform/mac/fast/css/first-letter-float-after-float-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/css/first-letter-float-after-float-expected.txt b/LayoutTests/platform/mac/fast/css/first-letter-float-after-float-expected.txt
new file mode 100644 (file)
index 0000000..0a3b62c
--- /dev/null
@@ -0,0 +1,30 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 53x18
+          text run at (0,0) width 53: "Test for "
+        RenderInline {I} at (0,0) size 769x36
+          RenderInline {A} at (0,0) size 307x18 [color=#0000EE]
+            RenderText {#text} at (53,0) size 307x18
+              text run at (53,0) width 307: "https://bugs.webkit.org/show_bug.cgi?id=18818"
+          RenderText {#text} at (360,0) size 769x36
+            text run at (360,0) width 4: " "
+            text run at (364,0) width 405: "REGRESSION (3.1.1-TOT): Character order (float:left ordered"
+            text run at (0,18) width 121: "after the first letter)"
+        RenderText {#text} at (121,18) size 4x18
+          text run at (121,18) width 4: "."
+      RenderBlock {P} at (0,52) size 784x18
+        RenderText {#text} at (0,0) size 200x18
+          text run at (0,0) width 200: "The next line should say \x{201C}123\x{201D}."
+      RenderBlock {DIV} at (0,86) size 784x18
+        RenderBlock (floating) {SPAN} at (0,0) size 8x18
+          RenderText {#text} at (0,0) size 8x18
+            text run at (0,0) width 8: "1"
+        RenderBlock (floating) at (8,0) size 8x18
+          RenderText {#text} at (0,0) size 8x18
+            text run at (0,0) width 8: "2"
+        RenderText {#text} at (16,0) size 8x18
+          text run at (16,0) width 8: "3"
index 0325b30..baa675a 100644 (file)
@@ -17,10 +17,10 @@ layer at (0,0) size 800x600
         RenderText {#text} at (0,0) size 22x18
           text run at (0,0) width 22: "YZ"
       RenderBlock {DIV} at (0,70) size 784x18
+        RenderImage {IMG} at (0,0) size 0x0
         RenderInline (generated) at (0,0) size 12x18 [color=#008000]
           RenderText {#text} at (0,0) size 12x18
             text run at (0,0) width 12: "X"
-        RenderImage {IMG} at (0,0) size 0x0
         RenderText {#text} at (12,0) size 12x18
           text run at (12,0) width 12: "Y"
       RenderBlock {DIV} at (0,88) size 784x18
@@ -43,12 +43,12 @@ layer at (0,0) size 800x600
             text run at (0,0) width 4: " "
           RenderText {#text} at (4,0) size 22x18
             text run at (4,0) width 22: "YZ"
-layer at (100,114) size 27x18
-  RenderBlock (positioned) {DIV} at (100,114) size 27x18
+layer at (100,96) size 27x18
+  RenderBlock (positioned) {DIV} at (100,96) size 27x18
     RenderText {#text} at (0,0) size 27x18
       text run at (0,0) width 27: "VW"
-layer at (100,132) size 27x18
-  RenderBlock (positioned) {DIV} at (100,132) size 27x18
+layer at (100,114) size 27x18
+  RenderBlock (positioned) {DIV} at (100,114) size 27x18
     RenderText {#text} at (0,0) size 27x18
       text run at (0,0) width 27: "VW"
 layer at (100,150) size 27x18
index 70feb80..1eee699 100644 (file)
@@ -1,3 +1,17 @@
+2008-05-08  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        - fix https://bugs.webkit.org/show_bug.cgi?id=18818
+          <rdar://problem/5901544> REGRESSION (3.1.1-TOT): Character order (float:left ordered after the first letter)
+
+        Test: fast/css/first-letter-float-after-float.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::updateFirstLetter): Changed to add the first
+        letter container right before the rest of the text it is taken from,
+        instead of at the beginning of the block.
+
 2008-05-08  Chris Fleizach  <cfleizach@apple.com>
 
         Reviewed by Darin Adler.
index 8e6c929..a19a7b5 100644 (file)
@@ -4231,9 +4231,7 @@ void RenderBlock::updateFirstLetter()
         pseudoStyle->setPosition( StaticPosition ); // CSS2 says first-letter can't be positioned.
         
         RenderObject* firstLetter = RenderFlow::createAnonymousFlow(document(), pseudoStyle); // anonymous box
-        // FIXME: This adds in the wrong place if list markers were skipped above.  Should be
-        // firstLetterContainer->addChild(firstLetter, currChild);
-        firstLetterContainer->addChild(firstLetter, firstLetterContainer->firstChild());
+        firstLetterContainer->addChild(firstLetter, currChild);
         
         // The original string is going to be either a generated content string or a DOM node's
         // string.  We want the original string before it got transformed in case first-letter has