2006-05-13 Mitz Pettel <opendarwin.org@mitzpettel.com>
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 May 2006 16:28:31 +0000 (16:28 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 May 2006 16:28:31 +0000 (16:28 +0000)
        Reviewed by Darin, landed by ap.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8485
          iExploder(#11705): Freeze in RenderBlock::layout()

        Test: fast/text/midword-break-hang.html

        * rendering/bidi.cpp:
        (WebCore::RenderBlock::findNextLineBreak): If this is a mid-word break,
        ignore breakOnlyAfterWhiteSpace.

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

LayoutTests/ChangeLog
LayoutTests/fast/text/midword-break-hang-expected.checksum [new file with mode: 0644]
LayoutTests/fast/text/midword-break-hang-expected.png [new file with mode: 0644]
LayoutTests/fast/text/midword-break-hang-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/midword-break-hang.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/bidi.cpp

index 4e8c7df8018f16bb38228c581300574ac37dc174..767019562f88d46004e5c97dc07a8d7631b9b61a 100644 (file)
@@ -1,3 +1,15 @@
+2006-05-13  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin, landed by ap.
+
+        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8485
+          iExploder(#11705): Freeze in RenderBlock::layout()
+
+        * fast/text/midword-break-hang-expected.checksum: Added.
+        * fast/text/midword-break-hang-expected.png: Added.
+        * fast/text/midword-break-hang-expected.txt: Added.
+        * fast/text/midword-break-hang.html: Added.
+
 2006-05-13  Rob Buis  <buis@kde.org>
 
         Reviewed by Darin, landed by ap.
diff --git a/LayoutTests/fast/text/midword-break-hang-expected.checksum b/LayoutTests/fast/text/midword-break-hang-expected.checksum
new file mode 100644 (file)
index 0000000..8386210
--- /dev/null
@@ -0,0 +1 @@
+d9e6aa7254626a19ec6fa0eb2fb16e91
\ No newline at end of file
diff --git a/LayoutTests/fast/text/midword-break-hang-expected.png b/LayoutTests/fast/text/midword-break-hang-expected.png
new file mode 100644 (file)
index 0000000..7484aed
Binary files /dev/null and b/LayoutTests/fast/text/midword-break-hang-expected.png differ
diff --git a/LayoutTests/fast/text/midword-break-hang-expected.txt b/LayoutTests/fast/text/midword-break-hang-expected.txt
new file mode 100644 (file)
index 0000000..e6167c5
--- /dev/null
@@ -0,0 +1,23 @@
+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 784x584
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 172x18
+          text run at (0,0) width 172: "This is a regression test for "
+        RenderInline {I} at (0,0) size 712x36
+          RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
+            RenderText {#text} at (172,0) size 348x18
+              text run at (172,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8485"
+          RenderText {#text} at (520,0) size 712x36
+            text run at (520,0) width 4: " "
+            text run at (524,0) width 188: "iExploder(#11705): Freeze in"
+            text run at (0,18) width 141: "RenderBlock::layout()"
+        RenderText {#text} at (141,18) size 4x18
+          text run at (141,18) width 4: "."
+      RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
+      RenderBlock {DIV} at (0,62) size 30x276
+        RenderText {#text} at (0,0) size 87x276
+          text run at (0,0) width 0: " "
+          text run at (0,138) width 87: "A"
diff --git a/LayoutTests/fast/text/midword-break-hang.html b/LayoutTests/fast/text/midword-break-hang.html
new file mode 100644 (file)
index 0000000..053598e
--- /dev/null
@@ -0,0 +1,13 @@
+<html>
+<head>
+    <title></title>
+</head>
+<body>
+<p>
+    This is a regression test for <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=8485">http://bugzilla.opendarwin.org/show_bug.cgi?id=8485</a>
+    iExploder(#11705): Freeze in RenderBlock::layout()</i>.
+</p>
+<hr>
+<div style="width: 30px; font-size: 120px; white-space: pre; word-wrap:break-word; -webkit-line-break:after-white-space;">
+A</div>
+</body>
index 33ccb633f261401fa59037e9cde96af84d420b4e..e20ca897dc23336a89917d2822fc26d9b18b8759 100644 (file)
@@ -1,3 +1,16 @@
+2006-05-13  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin, landed by ap.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8485
+          iExploder(#11705): Freeze in RenderBlock::layout()
+
+        Test: fast/text/midword-break-hang.html
+
+        * rendering/bidi.cpp:
+        (WebCore::RenderBlock::findNextLineBreak): If this is a mid-word break,
+        ignore breakOnlyAfterWhiteSpace.
+
 2006-05-13  Alexey Proskuryakov  <ap@nypop.com>
 
         Fix release build.
index ab13aca20e42beaea3788d22ee83899411eabcfa..840501b440283402490fb0d49456c4ac0910102c 100644 (file)
@@ -2258,10 +2258,10 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
                     if (o->style()->autoWrap() || breakWords) {
                         // If we break only after white-space, consider the current character
                         // as candidate width for this line.
-                        int charWidth = o->style()->breakOnlyAfterWhiteSpace() ?
+                        int charWidth = o->style()->breakOnlyAfterWhiteSpace() && !midWordBreak ?
                                             t->width(pos, 1, f, w + tmpW) + (applyWordSpacing ? wordSpacing : 0) : 0;
                         if (w + tmpW + charWidth > width) {
-                            if (o->style()->breakOnlyAfterWhiteSpace()) {
+                            if (o->style()->breakOnlyAfterWhiteSpace() && !midWordBreak) {
                                 // Check if line is too big even without the extra space
                                 // at the end of the line. If it is not, do nothing. 
                                 // If the line needs the extra whitespace to be too long,