[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:41:45 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 02f8d52004f0ae71e8ac293b36f795092fe1232a
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue May 25 21:30:07 2004 +0000
Fixed: <rdar://problem/3546418>: (when dragging text within an editable HTML doc, the selection should be moved not copied)
Reviewed by kocienda.
* khtml/editing/htmlediting_impl.cpp:
(khtml::MoveSelectionCommandImpl::doApply): implemented
* khtml/khtml_part.cpp:
(KHTMLPart::setDragCaret): make the old drag cursor rect dirty
* khtml/khtml_part.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index cb3d978..af9aaf0 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,15 @@
+2004-05-25 Chris Blumenberg <cblu at apple.com>
+
+ Fixed: <rdar://problem/3546418>: (when dragging text within an editable HTML doc, the selection should be moved not copied)
+
+ Reviewed by kocienda.
+
+ * khtml/editing/htmlediting_impl.cpp:
+ (khtml::MoveSelectionCommandImpl::doApply): implemented
+ * khtml/khtml_part.cpp:
+ (KHTMLPart::setDragCaret): make the old drag cursor rect dirty
+ * khtml/khtml_part.h:
+
2004-05-25 Maciej Stachowiak <mjs at apple.com>
Reviewed by John.
diff --git a/WebCore/khtml/editing/htmlediting_impl.cpp b/WebCore/khtml/editing/htmlediting_impl.cpp
index 5683ba8..4302ebc 100644
--- a/WebCore/khtml/editing/htmlediting_impl.cpp
+++ b/WebCore/khtml/editing/htmlediting_impl.cpp
@@ -2030,19 +2030,29 @@ int MoveSelectionCommandImpl::commandID() const
void MoveSelectionCommandImpl::doApply()
{
- Selection originalSelection = endingSelection();
- ASSERT(originalSelection.state() == Selection::RANGE);
+ Selection selection = endingSelection();
+ ASSERT(selection.state() == Selection::RANGE);
+
+ // Update the position otherwise it may become invalid after the selection is deleted.
+ NodeImpl *positionNode = m_position.node();
+ long positionOffset = m_position.offset();
+ Position selectionEnd = selection.end();
+ long selectionEndOffset = selectionEnd.offset();
+ if (selectionEnd.node() == positionNode && selectionEndOffset < positionOffset) {
+ positionOffset -= selectionEndOffset;
+ Position selectionStart = selection.start();
+ if (selectionStart.node() == positionNode) {
+ positionOffset += selectionStart.offset();
+ }
+ }
+
+ deleteSelection();
- // FIXME: Inserting the fragment by calling ReplaceSelectionCommand is not working for some reason.
- /*
- setEndingSelection(m_position);
+ setEndingSelection(Position(positionNode, positionOffset));
ReplaceSelectionCommand cmd(document(), m_fragment, true);
applyCommandToComposite(cmd);
- */
- // FIXME: Need to delete the selection here.
}
-
//------------------------------------------------------------------------------------------
// RemoveCSSPropertyCommandImpl
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index 4374f61..a61223d 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -2292,8 +2292,9 @@ void KHTMLPart::setSelection(const Selection &s, bool closeTyping)
void KHTMLPart::setDragCaret(const DOM::Selection &dragCaret)
{
if (d->m_dragCaret != dragCaret) {
+ d->m_dragCaret.needsCaretRepaint();
d->m_dragCaret = dragCaret;
- notifyDragCaretChanged();
+ d->m_dragCaret.needsCaretRepaint();
}
}
@@ -2405,11 +2406,6 @@ void KHTMLPart::notifySelectionChanged(bool closeTyping)
#endif
}
-void KHTMLPart::notifyDragCaretChanged()
-{
- d->m_dragCaret.needsCaretRepaint();
-}
-
void KHTMLPart::setXPosForVerticalArrowNavigation(int x)
{
d->m_xPosForVerticalArrowNavigation = x;
diff --git a/WebCore/khtml/khtml_part.h b/WebCore/khtml/khtml_part.h
index 71d90d1..791adfe 100644
--- a/WebCore/khtml/khtml_part.h
+++ b/WebCore/khtml/khtml_part.h
@@ -1127,11 +1127,6 @@ private:
* @internal
*/
void notifySelectionChanged(bool closeTyping=true);
-
- /**
- * @internal
- */
- void notifyDragCaretChanged();
/**
* @internal
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list