Reviewed by Darin, landed by Beth.

        Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=3230
        CSS1: Words with inline elements get extra capital letters

        Update existing tests for new results and add new test



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@13103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7bac286..0ef067f 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,26 @@
+2006-03-02  Andrew Wellington  <proton@wiretapped.net>
+
+        Reviewed by Darin, landed by Beth.
+
+        Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=3230
+        CSS1: Words with inline elements get extra capital letters
+
+        Update existing tests for new results and add new test
+
+        * css1/text_properties/text-transCapitalize-expected.txt:
+        * css1/text_properties/text_transform-expected.checksum:
+        * css1/text_properties/text_transform-expected.png:
+        * css1/text_properties/text_transform-expected.txt:
+        * css2.1/t1605-c545-txttrans-00-b-ag-expected.checksum:
+        * css2.1/t1605-c545-txttrans-00-b-ag-expected.png:
+        * css2.1/t1605-c545-txttrans-00-b-ag-expected.txt:
+        * fast/css/resources: Added.
+        * fast/css/resources/greenbox.png: Added.
+        * fast/css/textCapitalizeEdgeCases-expected.checksum: Added.
+        * fast/css/textCapitalizeEdgeCases-expected.png: Added.
+        * fast/css/textCapitalizeEdgeCases-expected.txt: Added.
+        * fast/css/textCapitalizeEdgeCases.html: Added.
+
 2006-03-02  Justin Garcia  <justin.garcia@apple.com>
         
         Patch reviewed by sullivan
diff --git a/LayoutTests/css1/text_properties/text-transCapitalize-expected.txt b/LayoutTests/css1/text_properties/text-transCapitalize-expected.txt
index cb800ba..122515e 100644
--- a/LayoutTests/css1/text_properties/text-transCapitalize-expected.txt
+++ b/LayoutTests/css1/text_properties/text-transCapitalize-expected.txt
@@ -414,21 +414,21 @@
               RenderInline {SPAN} at (0,0) size 34x18
                 RenderText {TEXT} at (2,38) size 34x18
                   text run at (2,38) width 34: "Earth"
-              RenderText {TEXT} at (36,38) size 80x18
-                text run at (36,38) width 80: "Quake Earth"
-              RenderInline {SPAN} at (0,0) size 40x18
-                RenderText {TEXT} at (116,38) size 40x18
-                  text run at (116,38) width 40: "Worm"
-              RenderText {TEXT} at (156,38) size 4x18
-                text run at (156,38) width 4: " "
+              RenderText {TEXT} at (36,38) size 76x18
+                text run at (36,38) width 76: "quake Earth"
+              RenderInline {SPAN} at (0,0) size 37x18
+                RenderText {TEXT} at (112,38) size 37x18
+                  text run at (112,38) width 37: "worm"
+              RenderText {TEXT} at (149,38) size 4x18
+                text run at (149,38) width 4: " "
               RenderInline {SPAN} at (0,0) size 46x18
-                RenderText {TEXT} at (160,38) size 46x18
-                  text run at (160,38) width 46: "Cheese"
-              RenderInline {SPAN} at (0,0) size 44x18
-                RenderText {TEXT} at (206,38) size 44x18
-                  text run at (206,38) width 44: "Burger"
-              RenderText {TEXT} at (250,38) size 126x18
-                text run at (250,38) width 126: " [House] ~Six -Big-"
+                RenderText {TEXT} at (153,38) size 46x18
+                  text run at (153,38) width 46: "Cheese"
+              RenderInline {SPAN} at (0,0) size 41x18
+                RenderText {TEXT} at (199,38) size 41x18
+                  text run at (199,38) width 41: "burger"
+              RenderText {TEXT} at (240,38) size 126x18
+                text run at (240,38) width 126: " [House] ~Six -Big-"
           RenderTableRow {TR} at (0,0) size 0x0
             RenderTableCell {TH} at (2,170) size 53x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=4 c=0 rs=1 cs=1]
               RenderText {TEXT} at (20,2) size 13x18
@@ -443,9 +443,9 @@
             RenderTableCell {TD} at (57,194) size 710x26 [border: (1px solid #EEEEEE)] [r=5 c=1 rs=1 cs=1]
               RenderText {TEXT} at (2,6) size 223x18
                 text run at (2,6) width 223: "Quelqu'un L\x{2019}amour T'appelles\x{2011}tu 3"
-              RenderInline {SUP} at (0,0) size 24x15
-                RenderText {TEXT} at (225,2) size 24x15
-                  text run at (225,2) width 24: "Eme"
+              RenderInline {SUP} at (0,0) size 22x15
+                RenderText {TEXT} at (225,2) size 22x15
+                  text run at (225,2) width 22: "eme"
           RenderTableRow {TR} at (0,0) size 0x0
             RenderTableCell {TH} at (2,222) size 53x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=6 c=0 rs=1 cs=1]
               RenderText {TEXT} at (17,2) size 18x18
diff --git a/LayoutTests/css1/text_properties/text_transform-expected.checksum b/LayoutTests/css1/text_properties/text_transform-expected.checksum
index 304ae20..6425470 100644
--- a/LayoutTests/css1/text_properties/text_transform-expected.checksum
+++ b/LayoutTests/css1/text_properties/text_transform-expected.checksum
@@ -1 +1 @@
-28ac0d06bcadd45556343215f266e75b
\ No newline at end of file
+011f34abc2c3539f1482ba0b4249b977
\ No newline at end of file
diff --git a/LayoutTests/css1/text_properties/text_transform-expected.png b/LayoutTests/css1/text_properties/text_transform-expected.png
index b5ff613..dcf5af0 100644
--- a/LayoutTests/css1/text_properties/text_transform-expected.png
+++ b/LayoutTests/css1/text_properties/text_transform-expected.png
Binary files differ
diff --git a/LayoutTests/css1/text_properties/text_transform-expected.txt b/LayoutTests/css1/text_properties/text_transform-expected.txt
index 89bfa9e..5efb751 100644
--- a/LayoutTests/css1/text_properties/text_transform-expected.txt
+++ b/LayoutTests/css1/text_properties/text_transform-expected.txt
@@ -26,16 +26,16 @@
         RenderText {TEXT} at (0,0) size 753x36
           text run at (0,0) width 753: "Words with inline elements inside them should only capitalize the first letter of the word. Therefore, the last word in this"
           text run at (0,18) width 304: "sentence should have one, and only one, capital "
-        RenderInline {SPAN} at (0,0) size 46x18
+        RenderInline {SPAN} at (0,0) size 37x18
           RenderText {TEXT} at (304,18) size 17x18
             text run at (304,18) width 17: "Le"
-          RenderInline {SPAN} at (0,0) size 14x18
-            RenderText {TEXT} at (321,18) size 14x18
-              text run at (321,18) width 14: "Tt"
-          RenderText {TEXT} at (335,18) size 15x18
-            text run at (335,18) width 15: "Er"
-        RenderText {TEXT} at (350,18) size 4x18
-          text run at (350,18) width 4: "."
+          RenderInline {SPAN} at (0,0) size 8x18
+            RenderText {TEXT} at (321,18) size 8x18
+              text run at (321,18) width 8: "tt"
+          RenderText {TEXT} at (329,18) size 12x18
+            text run at (329,18) width 12: "er"
+        RenderText {TEXT} at (341,18) size 4x18
+          text run at (341,18) width 4: "."
       RenderBlock {P} at (0,314) size 769x54
         RenderText {TEXT} at (0,0) size 721x36
           text run at (0,0) width 721: "THIS PARAGRAPH IS UPPERCASED AND SMALL CHARACTERS IN THE SOURCE (E.G. A AND \x{C5})"
@@ -75,16 +75,16 @@
                 RenderText {TEXT} at (0,0) size 727x36
                   text run at (0,0) width 727: "Words with inline elements inside them should only capitalize the first letter of the word. Therefore, the last word in"
                   text run at (0,18) width 330: "this sentence should have one, and only one, capital "
-                RenderInline {SPAN} at (0,0) size 46x18
+                RenderInline {SPAN} at (0,0) size 37x18
                   RenderText {TEXT} at (330,18) size 17x18
                     text run at (330,18) width 17: "Le"
-                  RenderInline {SPAN} at (0,0) size 14x18
-                    RenderText {TEXT} at (347,18) size 14x18
-                      text run at (347,18) width 14: "Tt"
-                  RenderText {TEXT} at (361,18) size 15x18
-                    text run at (361,18) width 15: "Er"
-                RenderText {TEXT} at (376,18) size 4x18
-                  text run at (376,18) width 4: "."
+                  RenderInline {SPAN} at (0,0) size 8x18
+                    RenderText {TEXT} at (347,18) size 8x18
+                      text run at (347,18) width 8: "tt"
+                  RenderText {TEXT} at (355,18) size 12x18
+                    text run at (355,18) width 12: "er"
+                RenderText {TEXT} at (367,18) size 4x18
+                  text run at (367,18) width 4: "."
               RenderBlock {P} at (4,178) size 747x54
                 RenderText {TEXT} at (0,0) size 721x36
                   text run at (0,0) width 721: "THIS PARAGRAPH IS UPPERCASED AND SMALL CHARACTERS IN THE SOURCE (E.G. A AND \x{C5})"
diff --git a/LayoutTests/css2.1/t1605-c545-txttrans-00-b-ag-expected.checksum b/LayoutTests/css2.1/t1605-c545-txttrans-00-b-ag-expected.checksum
index 681ee41..cb5b12d 100644
--- a/LayoutTests/css2.1/t1605-c545-txttrans-00-b-ag-expected.checksum
+++ b/LayoutTests/css2.1/t1605-c545-txttrans-00-b-ag-expected.checksum
@@ -1 +1 @@
-19f62f24997a9703a86874af17aa2e29
\ No newline at end of file
+91f8f2e40e8fc13026ce8ee21d4e5783
\ No newline at end of file
diff --git a/LayoutTests/css2.1/t1605-c545-txttrans-00-b-ag-expected.png b/LayoutTests/css2.1/t1605-c545-txttrans-00-b-ag-expected.png
index 34b0b00..6819127 100644
--- a/LayoutTests/css2.1/t1605-c545-txttrans-00-b-ag-expected.png
+++ b/LayoutTests/css2.1/t1605-c545-txttrans-00-b-ag-expected.png
Binary files differ
diff --git a/LayoutTests/css2.1/t1605-c545-txttrans-00-b-ag-expected.txt b/LayoutTests/css2.1/t1605-c545-txttrans-00-b-ag-expected.txt
index 83113e6..9d43814 100644
--- a/LayoutTests/css2.1/t1605-c545-txttrans-00-b-ag-expected.txt
+++ b/LayoutTests/css2.1/t1605-c545-txttrans-00-b-ag-expected.txt
@@ -78,7 +78,7 @@
             RenderText {TEXT} at (230,0) size 20x10
               text run at (230,0) width 20: "Xx"
           RenderText {TEXT} at (250,0) size 40x10
-            text run at (250,0) width 40: "Xxx "
+            text run at (250,0) width 40: "xxx "
           RenderInline {SPAN} at (0,0) size 30x10
             RenderText {TEXT} at (290,0) size 30x10
               text run at (290,0) width 30: "xxx"
@@ -88,7 +88,7 @@
             RenderText {TEXT} at (230,10) size 20x10
               text run at (230,10) width 20: "Pp"
           RenderText {TEXT} at (250,10) size 40x10
-            text run at (250,10) width 40: "Ppp "
+            text run at (250,10) width 40: "ppp "
           RenderInline {SPAN} at (0,0) size 30x10
             RenderText {TEXT} at (290,10) size 30x10
               text run at (290,10) width 30: "ppp"
@@ -98,7 +98,7 @@
             RenderText {TEXT} at (230,20) size 20x10
               text run at (230,20) width 20: "\x{C9}\x{E9}"
           RenderText {TEXT} at (250,20) size 40x10
-            text run at (250,20) width 40: "\x{C9}\x{E9}\x{E9} "
+            text run at (250,20) width 40: "\x{E9}\x{E9}\x{E9} "
           RenderInline {SPAN} at (0,0) size 30x10
             RenderText {TEXT} at (290,20) size 30x10
               text run at (290,20) width 30: "\x{E9}\x{E9}\x{E9}"
diff --git a/LayoutTests/fast/css/resources/greenbox.png b/LayoutTests/fast/css/resources/greenbox.png
new file mode 100644
index 0000000..6e555e3
--- /dev/null
+++ b/LayoutTests/fast/css/resources/greenbox.png
Binary files differ
diff --git a/LayoutTests/fast/css/textCapitalizeEdgeCases-expected.checksum b/LayoutTests/fast/css/textCapitalizeEdgeCases-expected.checksum
new file mode 100644
index 0000000..1b04b63
--- /dev/null
+++ b/LayoutTests/fast/css/textCapitalizeEdgeCases-expected.checksum
@@ -0,0 +1 @@
+09c4ced89975314cca489eb1c6277fd1
\ No newline at end of file
diff --git a/LayoutTests/fast/css/textCapitalizeEdgeCases-expected.png b/LayoutTests/fast/css/textCapitalizeEdgeCases-expected.png
new file mode 100644
index 0000000..5e8305c
--- /dev/null
+++ b/LayoutTests/fast/css/textCapitalizeEdgeCases-expected.png
Binary files differ
diff --git a/LayoutTests/fast/css/textCapitalizeEdgeCases-expected.txt b/LayoutTests/fast/css/textCapitalizeEdgeCases-expected.txt
new file mode 100644
index 0000000..08945d6
--- /dev/null
+++ b/LayoutTests/fast/css/textCapitalizeEdgeCases-expected.txt
@@ -0,0 +1,40 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x572
+      RenderBlock {P} at (0,0) size 784x54
+        RenderText {TEXT} at (0,0) size 776x54
+          text run at (0,0) width 775: "This file tests capitalisation with all sorts of odd things. There is some RTL text, some text with an inlined-div placed inside"
+          text run at (0,18) width 776: "a word, an image between words as well as a div between words. Each word below should be capitalised, and there should"
+          text run at (0,36) width 232: "be no capitals n the middle of words."
+      RenderBlock {DIV} at (20,74) size 744x115 [border: (5px solid #FF0000)]
+        RenderBlock {DIV} at (25,25) size 694x18
+          RenderText {TEXT} at (664,0) size 30x18
+            text run at (664,0) width 30 RTL override: "Capi"
+          RenderInline {SPAN} at (0,0) size 15x18
+            RenderText {TEXT} at (649,0) size 15x18
+              text run at (649,0) width 15 RTL override: "tal"
+          RenderText {TEXT} at (632,0) size 17x18
+            text run at (632,0) width 17 RTL override: "ise"
+        RenderBlock {DIV} at (25,43) size 694x47
+          RenderBlock (anonymous) at (0,0) size 694x29
+            RenderText {TEXT} at (0,11) size 31x18
+              text run at (0,11) width 31: "A W"
+            RenderInline {DIV} at (0,0) size 13x18
+              RenderText {TEXT} at (31,11) size 13x18
+                text run at (31,11) width 13: "or"
+            RenderText {TEXT} at (44,11) size 43x18
+              text run at (44,11) width 43: "d With"
+            RenderImage {IMG} at (87,0) size 25x25
+            RenderText {TEXT} at (112,11) size 63x18
+              text run at (112,11) width 63: "An Image"
+          RenderBlock {DIV} at (0,29) size 694x0
+          RenderBlock (anonymous) at (0,29) size 694x18
+            RenderText {TEXT} at (0,0) size 35x18
+              text run at (0,0) width 35: "In Be"
+            RenderInline {SPAN} at (0,0) size 16x18
+              RenderText {TEXT} at (35,0) size 16x18
+                text run at (35,0) width 16: "tw"
+            RenderText {TEXT} at (51,0) size 22x18
+              text run at (51,0) width 22: "een"
diff --git a/LayoutTests/fast/css/textCapitalizeEdgeCases.html b/LayoutTests/fast/css/textCapitalizeEdgeCases.html
new file mode 100644
index 0000000..72178be
--- /dev/null
+++ b/LayoutTests/fast/css/textCapitalizeEdgeCases.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+<title>Text Transform Capitalize Tests</title>
+</head>
+<body>
+<p>
+This file tests capitalisation with all sorts of odd things. There is some RTL text, some text with an inlined-div placed inside a word, an image between words as well as a div between words. Each word below should be capitalised, and there should be no capitals n the middle of words.
+</p>
+<div style="margin: 20px; padding: 20px; border: 5px solid red;">
+<div style="unicode-bidi: bidi-override; direction: rtl; text-transform: capitalize;">capi<span>tal</span>ise</div>
+<div style="text-transform: capitalize">a w<div style="display: inline">or</div>d with<img src="resources/greenbox.png">an image<div></div>in be<span>tw</span>een</div>
+</div>
+</body>
+</html>
\ No newline at end of file