Reviewed by Darin.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Mar 2005 22:12:55 +0000 (22:12 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Mar 2005 22:12:55 +0000 (22:12 +0000)
        <rdar://problem/4060266> Double-clicking in Dictionary.app doesn't work for some words (coming just after style change)

        * khtml/editing/visible_text.cpp:
        (khtml::TextIterator::handleTextBox):
        Complete the check of whether to emit space for collapsed space.

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/visible_text.cpp

index 2c58c326f5e71d1f9d13df937e9db8f2af339713..71eaffa322c39fd0a914d591f1fb46d12f24d3bf 100644 (file)
@@ -1,3 +1,13 @@
+2005-03-22  David Harrison  <harrison@apple.com>
+
+        Reviewed by Darin.
+        
+        <rdar://problem/4060266> Double-clicking in Dictionary.app doesn't work for some words (coming just after style change)
+
+        * khtml/editing/visible_text.cpp:
+        (khtml::TextIterator::handleTextBox):
+        Complete the check of whether to emit space for collapsed space.
+
 2005-03-22  David Harrison  <harrison@apple.com>
 
         Reviewed by John.
index ecc90f06189a8c52edb9feabf8fc75f28a227aaa..a2e66f628a989d62fecde50ba961d2d50c1c6386 100644 (file)
@@ -264,11 +264,10 @@ void TextIterator::handleTextBox()
         // Check for collapsed space at the start of this run.
         bool needSpace = m_lastTextNodeEndedWithCollapsedSpace
             || (m_textBox == renderer->firstTextBox() && textBoxStart == runStart && runStart > 0);
-        if (needSpace && !m_lastCharacter.isSpace()) {
+        if (needSpace && !isCollapsibleWhitespace(m_lastCharacter) && !m_lastCharacter.isNull()) {
             emitCharacter(' ', m_node, 0, runStart, runStart);
             return;
         }
-
         long textBoxEnd = textBoxStart + m_textBox->m_len;
         long runEnd = kMin(textBoxEnd, end);