Reviewed by Darin.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Feb 2005 01:52:35 +0000 (01:52 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Feb 2005 01:52:35 +0000 (01:52 +0000)
        <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line

        * khtml/editing/visible_text.cpp:
        (khtml::SimplifiedBackwardsTextIterator::advance):
        Add BR in for <rdar://problem/3917929> fix only if leaving a visible text node.

        * khtml/editing/visible_units.cpp:
        (khtml::endOfWord):
        Do not move left over a paragraph boundary.

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

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

index 34fbcbb9fd2764a08c05fae0723b59950bdcdbb7..47aa1487a093f7e8a0d881b28f448733a0219023 100644 (file)
@@ -1,3 +1,17 @@
+2005-02-14  David Harrison  <harrison@apple.com>
+
+        Reviewed by Darin.
+
+        <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line
+
+        * khtml/editing/visible_text.cpp:
+        (khtml::SimplifiedBackwardsTextIterator::advance):
+        Add BR in for <rdar://problem/3917929> fix only if leaving a visible text node.
+        
+        * khtml/editing/visible_units.cpp:
+        (khtml::endOfWord):
+        Do not move left over a paragraph boundary.
+
 2005-02-14  Darin Adler  <darin@apple.com>
 
         Reviewed by John.
index 21997c762f44af16225f0806f9ccdceac3aebfca..1c9d257c936e39f34301c75ed8cdd535a2cd5334 100644 (file)
@@ -582,12 +582,20 @@ void SimplifiedBackwardsTextIterator::advance()
             }
         }
         
-        // Handle case where markup looks like this: <p>foo</p>bar.
+        // Check for leaving a text node and iterating backwards
+        // into a different block that is an descendent of the
+        // block containing the text node (as in leaving
+        // the "bar" node in this example: <p>foo</p>bar).
         // Must emit newline when leaving node containing "bar".
-        NodeImpl *block = m_node->enclosingBlockFlowElement();
-        NodeImpl *nextBlock = next->enclosingBlockFlowElement();
-        if (block && nextBlock && nextBlock->isAncestor(block))
-            emitNewlineForBROrText();
+        if (next && m_node->renderer() && m_node->renderer()->isText() &&
+            m_node->renderer()->style()->visibility() == VISIBLE) {
+            NodeImpl *block = m_node->enclosingBlockFlowElement();
+            if (block) {
+                NodeImpl *nextBlock = next->enclosingBlockFlowElement();
+                if (nextBlock && nextBlock->isAncestor(block))
+                    emitNewlineForBROrText();
+            }
+        }
         
         m_node = next;
         if (m_node)