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.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@14358 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/rendering/bidi.cpp b/WebCore/rendering/bidi.cpp
index ab13aca..840501b 100644
--- a/WebCore/rendering/bidi.cpp
+++ b/WebCore/rendering/bidi.cpp
@@ -2258,10 +2258,10 @@
                     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,