Reviewed by Darin.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Mar 2005 21:31:25 +0000 (21:31 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Mar 2005 21:31:25 +0000 (21:31 +0000)
        <rdar://problem/4055127> Dictionary pop-up panel misplaced at beginning of text blocks (breaks double-clicking in Dictionary.app)

        SimplifiedBackwardsTextIterator::advance() needed to not limit to textnodes
        when checking whether moving back across block boundaries

        VisibleUnits previousBoundary() needed to INIT_DOWN when creating result VisiblePosition

        All editing tests pass.

        * khtml/editing/visible_text.cpp:
        (khtml::SimplifiedBackwardsTextIterator::advance):
        * khtml/editing/visible_units.cpp:
        (khtml::previousBoundary):

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

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

index 60a606d84c161c41949b0a2b7bdbd3f9f33d4949..9dad30c69d6f6be0ab22fc94b3b49ed719d55fce 100644 (file)
@@ -1,3 +1,21 @@
+2005-03-20  David Harrison  <harrison@apple.com>
+
+        Reviewed by Darin.
+        
+        <rdar://problem/4055127> Dictionary pop-up panel misplaced at beginning of text blocks (breaks double-clicking in Dictionary.app)
+
+        SimplifiedBackwardsTextIterator::advance() needed to not limit to textnodes
+        when checking whether moving back across block boundaries
+
+        VisibleUnits previousBoundary() needed to INIT_DOWN when creating result VisiblePosition
+
+        All editing tests pass.
+
+        * khtml/editing/visible_text.cpp:
+        (khtml::SimplifiedBackwardsTextIterator::advance):
+        * khtml/editing/visible_units.cpp:
+        (khtml::previousBoundary):
+
 2005-03-20  Darin Adler  <darin@apple.com>
 
         Reviewed by Harrison.
index 1c9d257c936e39f34301c75ed8cdd535a2cd5334..ecc90f06189a8c52edb9feabf8fc75f28a227aaa 100644 (file)
@@ -582,13 +582,12 @@ void SimplifiedBackwardsTextIterator::advance()
             }
         }
         
-        // Check for leaving a text node and iterating backwards
+        // Check for leaving a node and iterating backwards
         // into a different block that is an descendent of the
-        // block containing the text node (as in leaving
+        // block containing the node (as in leaving
         // the "bar" node in this example: <p>foo</p>bar).
         // Must emit newline when leaving node containing "bar".
-        if (next && m_node->renderer() && m_node->renderer()->isText() &&
-            m_node->renderer()->style()->visibility() == VISIBLE) {
+        if (next && m_node->renderer() && m_node->renderer()->style()->visibility() == VISIBLE) {
             NodeImpl *block = m_node->enclosingBlockFlowElement();
             if (block) {
                 NodeImpl *nextBlock = next->enclosingBlockFlowElement();
index 62ffa6cf23445fb0584fd883b63a789a522b50ef..7bb9e23d1b075906dc789bd0cb2425589c6f623b 100644 (file)
@@ -117,7 +117,7 @@ static VisiblePosition previousBoundary(const VisiblePosition &c, unsigned (*sea
         }
     }
 
-    return VisiblePosition(pos, DOWNSTREAM, VisiblePosition::INIT_UP);
+    return VisiblePosition(pos, DOWNSTREAM, VisiblePosition::INIT_DOWN);
 }
 
 static VisiblePosition nextBoundary(const VisiblePosition &c, unsigned (*searchFunction)(const QChar *, unsigned))