LayoutTests:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Mar 2007 01:36:18 +0000 (01:36 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Mar 2007 01:36:18 +0000 (01:36 +0000)
        Reviewed by Hyatt.

        - test for://bugs.webkit.org/show_bug.cgi?id=13071
          REGRESSION: Plain text files no longer wrap lines longer than the width of the browser window

        * fast/loader/resources/text-document-wrapping.txt: Added.
        * fast/loader/text-document-wrapping-expected.checksum: Added.
        * fast/loader/text-document-wrapping-expected.png: Added.
        * fast/loader/text-document-wrapping-expected.txt: Added.
        * fast/loader/text-document-wrapping.html: Added.

WebCore:

        Reviewed by Hyatt.

        - http://bugs.webkit.org/show_bug.cgi?id=13071
          REGRESSION: Plain text files no longer wrap lines longer than the width of the browser window

        Test: fast/loader/text-document-wrapping.html

        * loader/TextDocument.cpp:
        (WebCore::TextTokenizer::write): Specified word-wrap:break-word for the <pre> element.

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

LayoutTests/ChangeLog
LayoutTests/fast/loader/resources/text-document-wrapping.txt [new file with mode: 0644]
LayoutTests/fast/loader/text-document-wrapping-expected.checksum [new file with mode: 0644]
LayoutTests/fast/loader/text-document-wrapping-expected.png [new file with mode: 0644]
LayoutTests/fast/loader/text-document-wrapping-expected.txt [new file with mode: 0644]
LayoutTests/fast/loader/text-document-wrapping.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/loader/TextDocument.cpp

index 2d2a06f..5a5272c 100644 (file)
@@ -1,3 +1,16 @@
+t: 2007-03-15  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Hyatt.
+
+        - test for://bugs.webkit.org/show_bug.cgi?id=13071
+          REGRESSION: Plain text files no longer wrap lines longer than the width of the browser window
+
+        * fast/loader/resources/text-document-wrapping.txt: Added.
+        * fast/loader/text-document-wrapping-expected.checksum: Added.
+        * fast/loader/text-document-wrapping-expected.png: Added.
+        * fast/loader/text-document-wrapping-expected.txt: Added.
+        * fast/loader/text-document-wrapping.html: Added.
+
 2007-03-14  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Hyatt.
diff --git a/LayoutTests/fast/loader/resources/text-document-wrapping.txt b/LayoutTests/fast/loader/resources/text-document-wrapping.txt
new file mode 100644 (file)
index 0000000..2d446eb
--- /dev/null
@@ -0,0 +1,3 @@
+This line should wrap with no horizontal scroll bar:
+
+abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
diff --git a/LayoutTests/fast/loader/text-document-wrapping-expected.checksum b/LayoutTests/fast/loader/text-document-wrapping-expected.checksum
new file mode 100644 (file)
index 0000000..3f3cb97
--- /dev/null
@@ -0,0 +1 @@
+c359bad668142b5c0874b1d4e0e326f8
\ No newline at end of file
diff --git a/LayoutTests/fast/loader/text-document-wrapping-expected.png b/LayoutTests/fast/loader/text-document-wrapping-expected.png
new file mode 100644 (file)
index 0000000..816a6b9
Binary files /dev/null and b/LayoutTests/fast/loader/text-document-wrapping-expected.png differ
diff --git a/LayoutTests/fast/loader/text-document-wrapping-expected.txt b/LayoutTests/fast/loader/text-document-wrapping-expected.txt
new file mode 100644 (file)
index 0000000..c84c3ba
--- /dev/null
@@ -0,0 +1,20 @@
+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
+    RenderFrameSet {FRAMESET} at (0,0) size 800x600
+      RenderFrame {FRAME} at (0,0) size 800x600
+        layer at (0,0) size 798x596
+          RenderView at (0,0) size 798x596
+        layer at (0,0) size 798x596
+          RenderBlock {HTML} at (0,0) size 798x596
+            RenderBody {BODY} at (8,8) size 782x575
+              RenderBlock {PRE} at (0,0) size 782x75
+                RenderText {#text} at (0,0) size 776x75
+                  text run at (0,0) width 416: "This line should wrap with no horizontal scroll bar:"
+                  text run at (416,0) width 0: " "
+                  text run at (0,15) width 0: " "
+                  text run at (0,30) width 776: "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs"
+                  text run at (0,45) width 776: "tuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl"
+                  text run at (0,60) width 528: "mnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"
+                  text run at (528,60) width 0: " "
diff --git a/LayoutTests/fast/loader/text-document-wrapping.html b/LayoutTests/fast/loader/text-document-wrapping.html
new file mode 100644 (file)
index 0000000..bbd0f2a
--- /dev/null
@@ -0,0 +1,3 @@
+<frameset>
+    <frame src="resources/text-document-wrapping.txt">
+</frameset>
index 496ebb9..f4eb776 100644 (file)
@@ -2,6 +2,18 @@
 
         Reviewed by Hyatt.
 
+        - http://bugs.webkit.org/show_bug.cgi?id=13071
+          REGRESSION: Plain text files no longer wrap lines longer than the width of the browser window
+
+        Test: fast/loader/text-document-wrapping.html
+
+        * loader/TextDocument.cpp:
+        (WebCore::TextTokenizer::write): Specified word-wrap:break-word for the <pre> element.
+
+2007-03-14  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Hyatt.
+
         - fix http://bugs.webkit.org/show_bug.cgi?id=13072
           REGRESSION (r15617): white-space: pre-wrap breaks off the last character of a wide word
 
index eca9ecf..3432020 100644 (file)
@@ -119,7 +119,7 @@ bool TextTokenizer::write(const SegmentedString& s, bool appendData)
         rootElement->appendChild(body, ec);
 
         RefPtr<Element> preElement = m_doc->createElementNS(xhtmlNamespaceURI, "pre", ec);
-        preElement->setAttribute("style", "white-space: pre-wrap;", ec);
+        preElement->setAttribute("style", "word-wrap: break-word; white-space: pre-wrap;", ec);
 
         body->appendChild(preElement, ec);