2011-07-01 Ryosuke Niwa <rniwa@webkit.org>
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jul 2011 21:07:39 +0000 (21:07 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jul 2011 21:07:39 +0000 (21:07 +0000)
        Reviewed by Ojan Vafai.

        Move m_isDirectional from FrameSelection to VisibleSelection
        https://bugs.webkit.org/show_bug.cgi?id=63473

        Added a test to ensure WebKit preserves non-directional selection after undo on Mac.

        The directionality of selection is still lost after undoing DeleteSelectionCommand or TypingCommand
        and this will be fixed in follow up patches.

        * editing/deleting/delete-br-011-expected.txt:
        * editing/selection/after-line-break-expected.txt:
        * editing/selection/anchor-focus2-expected.txt:
        * editing/selection/anchor-focus3-expected.txt:
        * editing/selection/directionality-after-undo-replace-expected.txt: Added.
        * editing/selection/directionality-after-undo-replace.html: Added.
        * platform/mac/editing/deleting/delete-br-002-expected.txt:
        * platform/mac/editing/deleting/delete-br-004-expected.txt:
        * platform/mac/editing/deleting/delete-br-005-expected.txt:
        * platform/mac/editing/deleting/delete-br-006-expected.txt:
        * platform/mac/editing/deleting/delete-br-009-expected.txt:
        * platform/mac/editing/deleting/delete-br-010-expected.txt:
        * platform/mac/editing/deleting/smart-delete-002-expected.txt:
        * platform/mac/editing/inserting/insert-3800346-fix-expected.txt:
        * platform/mac/editing/inserting/insert-at-end-01-expected.txt:
        * platform/mac/editing/inserting/insert-at-end-02-expected.txt:
        * platform/mac/editing/inserting/insert-div-010-expected.txt:
        * platform/mac/editing/inserting/insert-div-013-expected.txt:
        * platform/mac/editing/inserting/insert-div-015-expected.txt:
        * platform/mac/editing/inserting/insert-div-019-expected.txt:
        * platform/mac/editing/inserting/insert-paragraph-03-expected.txt:
        * platform/mac/editing/pasteboard/3976872-expected.txt:
        * platform/mac/editing/pasteboard/emacs-ctrl-a-k-y-expected.txt:
        * platform/mac/editing/pasteboard/emacs-ctrl-k-y-001-expected.txt:
        * platform/mac/editing/pasteboard/paste-text-014-expected.txt:
        * platform/mac/editing/selection/4932260-1-expected.txt:
        * platform/mac/editing/selection/expanding-selections-expected.txt:
        * platform/mac/editing/selection/expanding-selections2-expected.txt:
        * platform/mac/editing/selection/fake-drag-expected.txt:
        * platform/mac/editing/selection/move-by-word-001-expected.txt:
        * platform/mac/editing/selection/triple-click-in-pre-expected.txt:
        * platform/mac/editing/style/create-block-for-style-008-expected.txt:
        * platform/mac/editing/undo/4063751-expected.txt:
        * platform/mac/editing/undo/undo-forward-delete-boundary-expected.txt:
        * platform/mac/editing/undo/undo-forward-delete-expected.txt:
2011-07-01  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Ojan Vafai.

        Move m_isDirectional from FrameSelection to VisibleSelection
        https://bugs.webkit.org/show_bug.cgi?id=63473

        Don't pass MakeNonDirectionalSelection to setSelection since no other port does this.

        * src/WebFrameImpl.cpp:
        (WebKit::WebFrameImpl::selectRange):
2011-07-01  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Ojan Vafai.

        Move m_isDirectional from FrameSelection to VisibleSelection
        https://bugs.webkit.org/show_bug.cgi?id=63473

        Move m_isDirectional from FrameSelection to VisibleSelection.

        Also fixed a bug that WebKit does not preserve non-directional selection after undo.

        Test: editing/selection/directionality-after-undo-replace.html

        * WebCore.exp.in: Updated the signature of setSelection.
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::FrameSelection): Removed the call to setIsDirectional.
        (WebCore::shouldAlwaysUseDirectionalSelection): Added.
        (WebCore::FrameSelection::setSelection): No longer takes DirectionalityPolicy.
        Calls setIsDirectional(true) when the platform doesn't support non-directional selection.
        Passes align and granularity to setSelection of the base end point as expected.
        No longer updates granularity when updating the selection of a different frame.
        (WebCore::FrameSelection::willBeModified): Calls VisibleSelection::isDirectional().
        (WebCore::FrameSelection::modify): No longer calls trialFrameSelection.setIsDirectional
        because the directionality is passed from m_selection automatically.
        Also calls shouldAlwaysUseDirectionalSelection.
        * editing/FrameSelection.h: Remove m_isDirectional. Make all boolean bit fields.
        (WebCore::FrameSelection::setSelection): No longer takes DirectionalityPolicy.
        * editing/VisibleSelection.cpp:
        (WebCore::VisibleSelection::VisibleSelection): Initializes m_isDirectional to true.
        This should be changed to false to fix the bug 60529.
        * editing/VisibleSelection.h:
        (WebCore::VisibleSelection::isDirectional): Added.
        (WebCore::VisibleSelection::setIsDirectional): Added.
        * page/EventHandler.cpp:
        (WebCore::setNonDirectionalSelectionIfNeeded): Creates a non-directional selection instead of
        calling setSelection with MakeNonDirectionalSelection.
        (WebCore::EventHandler::handleMousePressEventSingleClick): Remove the call to setIsDirectional
        because it already calls setNonDirectionalSelectionIfNeeded.

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

45 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/deleting/delete-br-011-expected.txt
LayoutTests/editing/selection/after-line-break-expected.txt
LayoutTests/editing/selection/anchor-focus2-expected.txt
LayoutTests/editing/selection/anchor-focus3-expected.txt
LayoutTests/editing/selection/directionality-after-undo-replace-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/directionality-after-undo-replace.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/deleting/delete-br-002-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-br-004-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-br-005-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-br-006-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-br-009-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-br-010-expected.txt
LayoutTests/platform/mac/editing/deleting/smart-delete-002-expected.txt
LayoutTests/platform/mac/editing/inserting/insert-3800346-fix-expected.txt
LayoutTests/platform/mac/editing/inserting/insert-at-end-01-expected.txt
LayoutTests/platform/mac/editing/inserting/insert-at-end-02-expected.txt
LayoutTests/platform/mac/editing/inserting/insert-div-010-expected.txt
LayoutTests/platform/mac/editing/inserting/insert-div-013-expected.txt
LayoutTests/platform/mac/editing/inserting/insert-div-015-expected.txt
LayoutTests/platform/mac/editing/inserting/insert-div-019-expected.txt
LayoutTests/platform/mac/editing/inserting/insert-paragraph-03-expected.txt
LayoutTests/platform/mac/editing/pasteboard/3976872-expected.txt
LayoutTests/platform/mac/editing/pasteboard/emacs-ctrl-a-k-y-expected.txt
LayoutTests/platform/mac/editing/pasteboard/emacs-ctrl-k-y-001-expected.txt
LayoutTests/platform/mac/editing/pasteboard/paste-text-014-expected.txt
LayoutTests/platform/mac/editing/selection/4932260-1-expected.txt
LayoutTests/platform/mac/editing/selection/expanding-selections-expected.txt
LayoutTests/platform/mac/editing/selection/expanding-selections2-expected.txt
LayoutTests/platform/mac/editing/selection/fake-drag-expected.txt
LayoutTests/platform/mac/editing/selection/move-by-word-001-expected.txt
LayoutTests/platform/mac/editing/selection/triple-click-in-pre-expected.txt
LayoutTests/platform/mac/editing/style/create-block-for-style-008-expected.txt
LayoutTests/platform/mac/editing/undo/4063751-expected.txt
LayoutTests/platform/mac/editing/undo/undo-forward-delete-boundary-expected.txt
LayoutTests/platform/mac/editing/undo/undo-forward-delete-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/FrameSelection.h
Source/WebCore/editing/VisibleSelection.cpp
Source/WebCore/editing/VisibleSelection.h
Source/WebCore/page/EventHandler.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebFrameImpl.cpp

index 47a5134d8a2f75265f56e235537611110f28d79e..926a73f4dcc1211013174eadfb47ba7ccbcd00da 100644 (file)
@@ -1,3 +1,51 @@
+2011-07-01  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Reviewed by Ojan Vafai.
+
+        Move m_isDirectional from FrameSelection to VisibleSelection
+        https://bugs.webkit.org/show_bug.cgi?id=63473
+
+        Added a test to ensure WebKit preserves non-directional selection after undo on Mac.
+
+        The directionality of selection is still lost after undoing DeleteSelectionCommand or TypingCommand
+        and this will be fixed in follow up patches.
+
+        * editing/deleting/delete-br-011-expected.txt:
+        * editing/selection/after-line-break-expected.txt:
+        * editing/selection/anchor-focus2-expected.txt:
+        * editing/selection/anchor-focus3-expected.txt:
+        * editing/selection/directionality-after-undo-replace-expected.txt: Added.
+        * editing/selection/directionality-after-undo-replace.html: Added.
+        * platform/mac/editing/deleting/delete-br-002-expected.txt:
+        * platform/mac/editing/deleting/delete-br-004-expected.txt:
+        * platform/mac/editing/deleting/delete-br-005-expected.txt:
+        * platform/mac/editing/deleting/delete-br-006-expected.txt:
+        * platform/mac/editing/deleting/delete-br-009-expected.txt:
+        * platform/mac/editing/deleting/delete-br-010-expected.txt:
+        * platform/mac/editing/deleting/smart-delete-002-expected.txt:
+        * platform/mac/editing/inserting/insert-3800346-fix-expected.txt:
+        * platform/mac/editing/inserting/insert-at-end-01-expected.txt:
+        * platform/mac/editing/inserting/insert-at-end-02-expected.txt:
+        * platform/mac/editing/inserting/insert-div-010-expected.txt:
+        * platform/mac/editing/inserting/insert-div-013-expected.txt:
+        * platform/mac/editing/inserting/insert-div-015-expected.txt:
+        * platform/mac/editing/inserting/insert-div-019-expected.txt:
+        * platform/mac/editing/inserting/insert-paragraph-03-expected.txt:
+        * platform/mac/editing/pasteboard/3976872-expected.txt:
+        * platform/mac/editing/pasteboard/emacs-ctrl-a-k-y-expected.txt:
+        * platform/mac/editing/pasteboard/emacs-ctrl-k-y-001-expected.txt:
+        * platform/mac/editing/pasteboard/paste-text-014-expected.txt:
+        * platform/mac/editing/selection/4932260-1-expected.txt:
+        * platform/mac/editing/selection/expanding-selections-expected.txt:
+        * platform/mac/editing/selection/expanding-selections2-expected.txt:
+        * platform/mac/editing/selection/fake-drag-expected.txt:
+        * platform/mac/editing/selection/move-by-word-001-expected.txt:
+        * platform/mac/editing/selection/triple-click-in-pre-expected.txt:
+        * platform/mac/editing/style/create-block-for-style-008-expected.txt:
+        * platform/mac/editing/undo/4063751-expected.txt:
+        * platform/mac/editing/undo/undo-forward-delete-boundary-expected.txt:
+        * platform/mac/editing/undo/undo-forward-delete-expected.txt:
+
 2011-07-01  Mihai Parparita  <mihaip@chromium.org>
 
         Add more Chromium flaky expectations.
index 6025b046627624d546ecfa113a643abd5bdf85df..bbd41c5c0f9e4dee771a2f9b36dbe4dd8a19c10e 100644 (file)
@@ -2,6 +2,10 @@ EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #do
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 0 of DIV > BODY > HTML > #document to 2 of BODY > HTML > #document
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index ff6c72fb9b07ee6a3626cc8a67faf2a3628dc801..8f15bbd1fc63b574473b73d123c2ab0f8503fd3d 100644 (file)
@@ -3,6 +3,7 @@ EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 6 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document toDOMRange:range from 6 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 Test for rdar://problem/5973313 REGRESSION (r32508): Down arrow doesn't change caret with non-user entered newlines in textareas.
 
 To test manually, click to the right of the first word on the first line to place the caret at the end of the line, then press the down arrow. The caret should move to the next (empty) line. Then click somewhere on that line. The caret should not stay there.
index 7f28b121a9616826d4c8276373e2c7417d8bf4ce..d0ce562c208bd8ed5ba080402add1c49b3f69fac 100644 (file)
@@ -1,5 +1,6 @@
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 This tests the anchorNode, anchorOffset, focusNode and focusOffset properties of the Selection object. These properties are part of Mozilla's Selection object API, and so their values should be consistent in both browsers.
index 4ef6c6fa87310a4483a3207bb546051f5780fc84..8bdd4fbee88231a42c1aa9835e2eed0f402a1971 100644 (file)
@@ -1,5 +1,6 @@
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 This tests the anchorNode, anchorOffset, focusNode and focusOffset properties of the Selection object. These properties are part of Mozilla's Selection object API, and so their values should be consistent in both browsers.
diff --git a/LayoutTests/editing/selection/directionality-after-undo-replace-expected.txt b/LayoutTests/editing/selection/directionality-after-undo-replace-expected.txt
new file mode 100644 (file)
index 0000000..3646b6a
--- /dev/null
@@ -0,0 +1,10 @@
+This tests WebKit preserves non-directional selection after unapplying replacement on Mac. To manually test on Mac,
+
+Select "world" by double-clicking the word
+Replace "world" by a character by pressing a key
+Undo
+Extend selection to the left
+" world" should be selected.
+
+hello world WebKit
+PASS
diff --git a/LayoutTests/editing/selection/directionality-after-undo-replace.html b/LayoutTests/editing/selection/directionality-after-undo-replace.html
new file mode 100644 (file)
index 0000000..5b346b9
--- /dev/null
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests WebKit preserves non-directional selection after unapplying replacement on Mac. To manually test on Mac,</p>
+<ol>
+<li>Select "world" by double-clicking the word</li>
+<li>Replace "world" by a character by pressing a key</li>
+<li>Undo</li>
+<li>Extend selection to the left</li>
+</ol>
+<p>" world" should be selected.</p>
+<div contenteditable>hello wo<span id="target">r</span>ld WebKit</div>
+<script>
+
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+
+    if (!window.eventSender)
+        document.writeln('FAIL - this test requires eventSender');
+    else {
+        layoutTestController.setEditingBehavior('mac');
+
+        var test = document.getElementById('target');
+        eventSender.mouseMoveTo(target.offsetLeft + target.offsetWidth / 2, target.offsetTop + target.offsetHeight / 2);
+        eventSender.mouseDown();
+        eventSender.leapForward(200);
+        eventSender.mouseUp();
+
+        eventSender.leapForward(200);
+        eventSender.mouseDown();
+        eventSender.leapForward(200);
+        eventSender.mouseUp();
+
+        document.execCommand('InsertText', false, 'a');
+        document.execCommand('Undo');
+        window.getSelection().modify('extend', 'left', 'character');
+
+        var actual = window.getSelection().toString();
+        document.writeln(actual == ' world' ? 'PASS' : 'FAIL - expected " world" but got "' + actual + '"');
+    }
+}
+
+</script>
+</body>
+</html>
index 5191b312d8defea79418c3b27e9c12597157a89c..593e41683975c3df837f89d5a359e97983a7242b 100644 (file)
@@ -24,6 +24,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 2 of SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 2 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index d3fb5eff1e5706c34bc3f3fc581e0be94972778f..f1bb0011524d792f94651ad75e4ce8d70dc3d89b 100644 (file)
@@ -25,6 +25,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 4 of SPAN > DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 32dffeccae37ed998c93967b8dee7cb38215e4b5..572398c43eac5e407ced89d520d0e63a7b9bee31 100644 (file)
@@ -25,6 +25,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 4 of SPAN > DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document
index 028ba0601c118f1a02a6f531c24e198d866fe235..7c839c814c93ae8a31d3e8cdf9d466067679123f 100644 (file)
@@ -25,6 +25,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 4 of SPAN > DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document
index e3f4195030697368d610dbac7bb57133537b237e..6364e8a733502ae1fedc88e4b166876c0c9ffcd4 100644 (file)
@@ -7,6 +7,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 2 of BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 4af99478a6267cb5ab21411b2936f8a6949cef9c..8635422ae1be94a67cc12bff37a4e14c84a80274 100644 (file)
@@ -7,6 +7,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 2 of BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
index 1a90aa4528e43a648b8394167d47835d7c52eaab..c1912065b2a57867c2296c7c3a928e339a312356 100644 (file)
@@ -3,6 +3,7 @@ EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document
index 8e75d39a8f7289108dc86cb77aa0f726ebb2a593..7a27759c6d614c32978eddce78ba939be644ee82 100644 (file)
@@ -11,6 +11,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of DIV > DIV > BODY > HTML > #document to 3 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 3 of DIV > DIV > BODY > HTML > #document to 3 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
index 5713840d7a46fa0d112ec3f01a57e2410f5c365e..926c72699fc0e76347d4e8214b7d760b862305bc 100644 (file)
@@ -4,6 +4,8 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
index f3377e5b1557e04b313452587ef929a55c922641..e5e49eaefa4c87c5aae592784ba1110872f2e389 100644 (file)
@@ -4,6 +4,8 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
index 02e2bda45bd0d6565b302d09c40ceaf660c4b054..c40b7521970e9aba10c77a01305eefef10cd945e 100644 (file)
@@ -6,6 +6,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 3ebace28903bfebcf4e4d2f5c276c2ba70b9f954..f2761eeef04a2651efc825a0cfa3cd0c9d1f5496 100644 (file)
@@ -5,6 +5,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > BODY > HTML > #document to 0 of #text > BODY > HTML > #document toDOMRange:range from 0 of #text > BODY > HTML > #document to 0 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 8ec5634280b6ef108ac7269d8c1be23a8716d621..95ff5f64c3415b888a124aaa856e947106ba6c30 100644 (file)
@@ -9,6 +9,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 38a45117fb62523172616ebbae6e64c9bb9ee7db..3ab0795f65e0e04ab9e270c8f44710ae46cb5fba 100644 (file)
@@ -5,6 +5,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of BODY > HTML > #document to 5 of BODY > HTML > #document toDOMRange:range from 5 of BODY > HTML > #document to 5 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 4baa202d9e934adf878e6b549ae28f9f7842f99f..cdae545e3c88239ba85106046660398d4c657cfc 100644 (file)
@@ -3,6 +3,7 @@ EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document toDOMRange:range from 3 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 23308a216e219810910f7df5a2754d22fce8735a..089c2a3353fdd1db8c2cab565e540fe2a3a3890c 100644 (file)
@@ -7,6 +7,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
index f7123c39169896e0ef139520ee0beaec6f4cfa4b..5418d3ca518a08e8358efe3fac9f00a92a78785d 100644 (file)
@@ -4,6 +4,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 23 of #text > DIV > DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index 2100b88bf3c40deb8906777f0337ab84fe831868..dfed110bc96a14f3f637caee8ba24fcb5df4caab 100644 (file)
@@ -4,6 +4,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 14 of #text > DIV > DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document
index c408e04e4a14176d904a70b2072b72a09344c64c..0b33eae424dd77a83c0b95566726721d747c0f48 100644 (file)
@@ -11,6 +11,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 0670356523ddced973bc1c1cc83a4173da81e4b8..a6b4fbb349bae171da817cb998916bbc8d6b21db 100644 (file)
@@ -3,6 +3,7 @@ EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
index 4a0654aa2595cea0bb6cd8449544e07e0299cd1e..58c78cc5b648268abc56f3c5bcba816940b40ba0 100644 (file)
@@ -2,6 +2,7 @@ EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
index a7fdfda8f0da9bd92962efc5c54828af7860e71d..8a0a30e9588683ce3606615c34af3c5ac74f5e44 100644 (file)
@@ -2,6 +2,7 @@ EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
index 0ea025d64c19f57c461fc9ca906dd6e212bacd17..1e7325cb47183d6095013e30abf22fb2768ad77d 100644 (file)
@@ -4,6 +4,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 8 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index 9f09b036cc6236f4c7ebed760833b32b366bee47..b6e7abe7ab5299fcf895f91fd1a7133828d863f8 100644 (file)
@@ -4,6 +4,10 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
index ba1686f48c0cd18cd151c6184bd4a02847b4fe88..31e2f07253b21ed39cfbc3acde33f431bf58afd0 100644 (file)
@@ -4,6 +4,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 30 o
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 30 of #text > PRE > DIV > DIV > BODY > HTML > #document to 30 of #text > PRE > DIV > DIV > BODY > HTML > #document toDOMRange:range from 16 of #text > PRE > DIV > DIV > BODY > HTML > #document to 30 of #text > PRE > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 16 of #text > PRE > DIV > DIV > BODY > HTML > #document to 30 of #text > PRE > DIV > DIV > BODY > HTML > #document toDOMRange:range from 16 of #text > PRE > DIV > DIV > BODY > HTML > #document to 30 of #text > PRE > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
index 24c189cfd3738bc4abcb8aa5d8e3a0a66af66948..36dfde78d8ea6dfe8f4d60861b6e760c9c822d20 100644 (file)
@@ -2,6 +2,7 @@ EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #do
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index c99bbdde31a5f93f0ccca0d8d8dfc8cfa6193a2a..764dabe8199d0b6d319850a671507bb2994b2f48 100644 (file)
@@ -83,6 +83,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
@@ -105,6 +106,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
index 4a5c132edfa2dbfb8b04fc5b71570b6045a303d0..2a72ee7b5636c522091358b5ca7e69dc3c86b6dd 100644 (file)
@@ -4,6 +4,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 5 of #text > SPAN > DIV > BODY > HTML > #document to 6 of #text > SPAN > DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > SPAN > DIV > BODY > HTML > #document to 5 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > SPAN > DIV > BODY > HTML > #document to 5 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 5 of #text > SPAN > DIV > BODY > HTML > #document to 6 of #text > SPAN > DIV > BODY > HTML > #document
index 2e883d6c6734e438079732159789bff038ee9f75..d411b8cc6aa6156724b8e53c0adf99feb150d33e 100644 (file)
@@ -4,6 +4,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 5 of #text > SPAN > DIV > BODY > HTML > #document to 6 of #text > SPAN > DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > SPAN > DIV > BODY > HTML > #document to 5 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > SPAN > DIV > BODY > HTML > #document to 5 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldDeleteDOMRange:range from 5 of #text > SPAN > DIV > BODY > HTML > #document to 6 of #text > SPAN > DIV > BODY > HTML > #document
index dad028e912707ac2c611d41699ca6b1f5f4d0ed6..fe90e4c6ed6dd50ee74526e8d8dc056788c2168c 100644 (file)
@@ -1,3 +1,42 @@
+2011-07-01  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Reviewed by Ojan Vafai.
+
+        Move m_isDirectional from FrameSelection to VisibleSelection
+        https://bugs.webkit.org/show_bug.cgi?id=63473
+
+        Move m_isDirectional from FrameSelection to VisibleSelection.
+
+        Also fixed a bug that WebKit does not preserve non-directional selection after undo.
+
+        Test: editing/selection/directionality-after-undo-replace.html
+
+        * WebCore.exp.in: Updated the signature of setSelection.
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::FrameSelection): Removed the call to setIsDirectional.
+        (WebCore::shouldAlwaysUseDirectionalSelection): Added.
+        (WebCore::FrameSelection::setSelection): No longer takes DirectionalityPolicy.
+        Calls setIsDirectional(true) when the platform doesn't support non-directional selection.
+        Passes align and granularity to setSelection of the base end point as expected.
+        No longer updates granularity when updating the selection of a different frame.
+        (WebCore::FrameSelection::willBeModified): Calls VisibleSelection::isDirectional().
+        (WebCore::FrameSelection::modify): No longer calls trialFrameSelection.setIsDirectional
+        because the directionality is passed from m_selection automatically.
+        Also calls shouldAlwaysUseDirectionalSelection.
+        * editing/FrameSelection.h: Remove m_isDirectional. Make all boolean bit fields.
+        (WebCore::FrameSelection::setSelection): No longer takes DirectionalityPolicy.
+        * editing/VisibleSelection.cpp:
+        (WebCore::VisibleSelection::VisibleSelection): Initializes m_isDirectional to true.
+        This should be changed to false to fix the bug 60529.
+        * editing/VisibleSelection.h:
+        (WebCore::VisibleSelection::isDirectional): Added.
+        (WebCore::VisibleSelection::setIsDirectional): Added.
+        * page/EventHandler.cpp:
+        (WebCore::setNonDirectionalSelectionIfNeeded): Creates a non-directional selection instead of
+        calling setSelection with MakeNonDirectionalSelection.
+        (WebCore::EventHandler::handleMousePressEventSingleClick): Remove the call to setIsDirectional
+        because it already calls setNonDirectionalSelectionIfNeeded.
+
 2011-07-01  Tony Chang  <tony@chromium.org>
 
         cleanup of flexbox and marquee data naming in StyleRareNonInheritedData
index 199cebb85d340273a188be090dade8aac64e94bb..33a6b842ebbd86941d37d7f152c6a753e506ece3 100644 (file)
@@ -349,7 +349,7 @@ __ZN7WebCore14DocumentLoaderD2Ev
 __ZN7WebCore14DocumentWriter11setEncodingERKN3WTF6StringEb
 __ZN7WebCore14FileIconLoader14notifyFinishedEN3WTF10PassRefPtrINS_4IconEEE
 __ZN7WebCore14FrameSelection10setFocusedEb
-__ZN7WebCore14FrameSelection12setSelectionERKNS_16VisibleSelectionEjNS0_19CursorAlignOnScrollENS_15TextGranularityENS_20DirectionalityPolicyE
+__ZN7WebCore14FrameSelection12setSelectionERKNS_16VisibleSelectionEjNS0_19CursorAlignOnScrollENS_15TextGranularityE
 __ZN7WebCore14FrameSelection15revealSelectionERKNS_15ScrollAlignmentEb
 __ZN7WebCore14FrameSelection16setSelectedRangeEPNS_5RangeENS_9EAffinityEb
 __ZN7WebCore14FrameSelection20setSelectionFromNoneEv
index bc94941d7b5ad37a128405e1b100704e36237723..b4f48b9c8ed1456c24c71fe4bdf42b46c346ec0a 100644 (file)
@@ -100,7 +100,6 @@ FrameSelection::FrameSelection(Frame* frame)
     , m_isCaretBlinkingSuspended(false)
     , m_focused(frame && frame->page() && frame->page()->focusController()->focusedFrame() == frame)
 {
-    setIsDirectional(false);
 }
 
 void FrameSelection::moveTo(const VisiblePosition &pos, EUserTriggered userTriggered, CursorAlignOnScroll align)
@@ -151,15 +150,20 @@ void DragCaretController::setCaretPosition(const VisiblePosition& position)
         updateCaretRect(document, m_position);
 }
 
-void FrameSelection::setSelection(const VisibleSelection& s, SetSelectionOptions options, CursorAlignOnScroll align, TextGranularity granularity, DirectionalityPolicy directionalityPolicy)
+static inline bool shouldAlwaysUseDirectionalSelection(Frame* frame)
 {
-    m_granularity = granularity;
+    return !frame || frame->editor()->behavior().shouldConsiderSelectionAsDirectional();
+}
 
+void FrameSelection::setSelection(const VisibleSelection& newSelection, SetSelectionOptions options, CursorAlignOnScroll align, TextGranularity granularity)
+{
     bool closeTyping = options & CloseTyping;
     bool shouldClearTypingStyle = options & ClearTypingStyle;
     EUserTriggered userTriggered = selectionOptionsToUserTriggered(options);
 
-    setIsDirectional(directionalityPolicy == MakeDirectionalSelection);
+    VisibleSelection s = newSelection;
+    if (shouldAlwaysUseDirectionalSelection(m_frame))
+        s.setIsDirectional(true);
 
     if (!m_frame) {
         m_selection = s;
@@ -171,11 +175,13 @@ void FrameSelection::setSelection(const VisibleSelection& s, SetSelectionOptions
     if (s.base().anchorNode()) {
         Document* document = s.base().anchorNode()->document();
         if (document && document->frame() && document->frame() != m_frame && document != m_frame->document()) {
-            document->frame()->selection()->setSelection(s, options);
+            document->frame()->selection()->setSelection(s, options, align, granularity);
             return;
         }
     }
 
+    m_granularity = granularity;
+
     if (closeTyping)
         TypingCommand::closeTyping(m_frame->editor()->lastEditCommand());
 
@@ -357,11 +363,6 @@ void FrameSelection::textWillBeReplaced(CharacterData* node, unsigned offset, un
     respondToNodeModification(node, shouldRemoveBase, shouldRemoveExtent, shouldRemoveStart, shouldRemoveEnd);
 }
 
-void FrameSelection::setIsDirectional(bool isDirectional)
-{
-    m_isDirectional = !m_frame || m_frame->editor()->behavior().shouldConsiderSelectionAsDirectional() || isDirectional;
-}
-
 TextDirection FrameSelection::directionOfEnclosingBlock()
 {
     return WebCore::directionOfEnclosingBlock(m_selection.extent());
@@ -377,7 +378,7 @@ void FrameSelection::willBeModified(EAlteration alter, SelectionDirection direct
 
     bool baseIsStart = true;
 
-    if (m_isDirectional) {
+    if (m_selection.isDirectional()) {
         // Make base and extent match start and end so we extend the user-visible selection.
         // This only matters for cases where base and extend point to different positions than
         // start and end (e.g. after a double-click to select a word).
@@ -782,7 +783,6 @@ bool FrameSelection::modify(EAlteration alter, SelectionDirection direction, Tex
     if (userTriggered == UserTriggered) {
         FrameSelection trialFrameSelection;
         trialFrameSelection.setSelection(m_selection);
-        trialFrameSelection.setIsDirectional(m_isDirectional);
         trialFrameSelection.modify(alter, direction, granularity, NotUserTriggered);
 
         bool change = shouldChangeSelection(trialFrameSelection.selection());
@@ -863,7 +863,7 @@ bool FrameSelection::modify(EAlteration alter, SelectionDirection direction, Tex
 
     setCaretRectNeedsUpdate();
 
-    setIsDirectional(alter == AlterationExtend);
+    m_selection.setIsDirectional(shouldAlwaysUseDirectionalSelection(m_frame) || alter == AlterationExtend);
 
     return true;
 }
@@ -886,7 +886,6 @@ bool FrameSelection::modify(EAlteration alter, unsigned verticalDistance, Vertic
     if (userTriggered == UserTriggered) {
         FrameSelection trialFrameSelection;
         trialFrameSelection.setSelection(m_selection);
-        trialFrameSelection.setIsDirectional(m_isDirectional);
         trialFrameSelection.modify(alter, verticalDistance, direction, NotUserTriggered);
 
         bool change = shouldChangeSelection(trialFrameSelection.selection());
@@ -952,7 +951,7 @@ bool FrameSelection::modify(EAlteration alter, unsigned verticalDistance, Vertic
     if (userTriggered == UserTriggered)
         m_granularity = CharacterGranularity;
 
-    setIsDirectional(alter == AlterationExtend);
+    m_selection.setIsDirectional(shouldAlwaysUseDirectionalSelection(m_frame) || alter == AlterationExtend);
 
     return true;
 }
index fecfd373c1dcbb891fd7540afda50075bd76a4dd..8472a8e681d5b832dec431ce5300a02459b58dbb 100644 (file)
@@ -46,7 +46,6 @@ class RenderView;
 class Settings;
 class VisiblePosition;
 
-enum DirectionalityPolicy { MakeNonDirectionalSelection, MakeDirectionalSelection };
 enum EUserTriggered { NotUserTriggered = 0, UserTriggered = 1 };
 
 class CaretBase {
@@ -135,8 +134,8 @@ public:
     void moveTo(const Position&, const Position&, EAffinity, EUserTriggered = NotUserTriggered);
 
     const VisibleSelection& selection() const { return m_selection; }
-    void setSelection(const VisibleSelection&, SetSelectionOptions = CloseTyping | ClearTypingStyle, CursorAlignOnScroll = AlignCursorOnScrollIfNeeded, TextGranularity = CharacterGranularity, DirectionalityPolicy = MakeDirectionalSelection);
-    void setSelection(const VisibleSelection& selection, TextGranularity granularity, DirectionalityPolicy directionality = MakeDirectionalSelection) { setSelection(selection, CloseTyping | ClearTypingStyle, AlignCursorOnScrollIfNeeded, granularity, directionality); }
+    void setSelection(const VisibleSelection&, SetSelectionOptions = CloseTyping | ClearTypingStyle, CursorAlignOnScroll = AlignCursorOnScrollIfNeeded, TextGranularity = CharacterGranularity);
+    void setSelection(const VisibleSelection& selection, TextGranularity granularity) { setSelection(selection, CloseTyping | ClearTypingStyle, AlignCursorOnScrollIfNeeded, granularity); }
     bool setSelectedRange(Range*, EAffinity, bool closeTyping);
     void selectAll();
     void clear();
@@ -179,7 +178,6 @@ public:
     IntRect absoluteCaretBounds();
     void setCaretRectNeedsUpdate() { CaretBase::setCaretRectNeedsUpdate(); }
 
-    void setIsDirectional(bool);
     void willBeModified(EAlteration, SelectionDirection);
 
     bool isNone() const { return m_selection.isNone(); }
@@ -286,12 +284,10 @@ private:
     Timer<FrameSelection> m_caretBlinkTimer;
     IntRect m_absCaretBounds; // absolute bounding rect for the caret
     IntRect m_absoluteCaretRepaintBounds;
-    bool m_absCaretBoundsDirty;
-    bool m_caretPaint;
-
-    bool m_isDirectional;
-    bool m_isCaretBlinkingSuspended;
-    bool m_focused;
+    bool m_absCaretBoundsDirty : 1;
+    bool m_caretPaint : 1;
+    bool m_isCaretBlinkingSuspended : 1;
+    bool m_focused : 1;
 };
 
 inline EditingStyle* FrameSelection::typingStyle() const
index 64f8484ff160a8f8a128d0e5601dbcf1ce1f6cb4..ec6d74f8cdef696f532b1d8b56e27ce706c8ad0d 100644 (file)
@@ -44,6 +44,7 @@ VisibleSelection::VisibleSelection()
     : m_affinity(DOWNSTREAM)
     , m_selectionType(NoSelection)
     , m_baseIsFirst(true)
+    , m_isDirectional(true)
 {
 }
 
@@ -51,6 +52,7 @@ VisibleSelection::VisibleSelection(const Position& pos, EAffinity affinity)
     : m_base(pos)
     , m_extent(pos)
     , m_affinity(affinity)
+    , m_isDirectional(true)
 {
     validate();
 }
@@ -59,6 +61,7 @@ VisibleSelection::VisibleSelection(const Position& base, const Position& extent,
     : m_base(base)
     , m_extent(extent)
     , m_affinity(affinity)
+    , m_isDirectional(true)
 {
     validate();
 }
@@ -67,6 +70,7 @@ VisibleSelection::VisibleSelection(const VisiblePosition& pos)
     : m_base(pos.deepEquivalent())
     , m_extent(pos.deepEquivalent())
     , m_affinity(pos.affinity())
+    , m_isDirectional(true)
 {
     validate();
 }
@@ -75,6 +79,7 @@ VisibleSelection::VisibleSelection(const VisiblePosition& base, const VisiblePos
     : m_base(base.deepEquivalent())
     , m_extent(extent.deepEquivalent())
     , m_affinity(base.affinity())
+    , m_isDirectional(true)
 {
     validate();
 }
@@ -83,6 +88,7 @@ VisibleSelection::VisibleSelection(const Range* range, EAffinity affinity)
     : m_base(range->startPosition())
     , m_extent(range->endPosition())
     , m_affinity(affinity)
+    , m_isDirectional(true)
 {
     validate();
 }
index e515ae617ddbab9389c26fb0eb97b111af50944b..764d3012150a3328350fa41f11ff2082883464e4 100644 (file)
@@ -78,6 +78,8 @@ public:
     bool isNonOrphanedCaretOrRange() const { return isCaretOrRange() && !start().isOrphan() && !end().isOrphan(); }
 
     bool isBaseFirst() const { return m_baseIsFirst; }
+    bool isDirectional() const { return m_isDirectional; }
+    void setIsDirectional(bool isDirectional) { m_isDirectional = isDirectional; }
 
     bool isAll(EditingBoundaryCrossingRule) const;
 
@@ -122,7 +124,7 @@ private:
     // used to store values in editing commands for use when
     // undoing the command. We need to be able to create a selection that, while currently
     // invalid, will be valid once the changes are undone.
-    
+
     Position m_base;   // Where the first click happened
     Position m_extent; // Where the end click happened
     Position m_start;  // Leftmost position when expanded to respect granularity
@@ -131,13 +133,15 @@ private:
     EAffinity m_affinity;           // the upstream/downstream affinity of the caret
 
     // these are cached, can be recalculated by validate()
-    SelectionType m_selectionType;    // None, Caret, Range
-    bool m_baseIsFirst;               // true if base is before the extent
+    SelectionType m_selectionType; // None, Caret, Range
+    bool m_baseIsFirst : 1; // True if base is before the extent
+    bool m_isDirectional : 1; // Non-directional ignores m_baseIsFirst and selection always extends on shift + arrow key.
 };
 
 inline bool operator==(const VisibleSelection& a, const VisibleSelection& b)
 {
-    return a.start() == b.start() && a.end() == b.end() && a.affinity() == b.affinity() && a.isBaseFirst() == b.isBaseFirst();
+    return a.start() == b.start() && a.end() == b.end() && a.affinity() == b.affinity() && a.isBaseFirst() == b.isBaseFirst()
+        && a.isDirectional() == b.isDirectional();
 }
 
 inline bool operator!=(const VisibleSelection& a, const VisibleSelection& b)
index 153a57a3d5954779e9664babc0604a90c8d79e7e..b8151da05a76dbe87a68321501bd67bd650d050f 100644 (file)
@@ -277,8 +277,13 @@ static void setSelectionIfNeeded(FrameSelection* selection, const VisibleSelecti
 static void setNonDirectionalSelectionIfNeeded(FrameSelection* selection, const VisibleSelection& newSelection, TextGranularity granularity)
 {
     ASSERT(selection);
-    if (selection->selection() != newSelection && selection->shouldChangeSelection(newSelection))
-        selection->setSelection(newSelection, granularity, MakeNonDirectionalSelection);
+    if (selection->selection() == newSelection || !selection->shouldChangeSelection(newSelection))
+        return;
+
+    VisibleSelection newNonDirectionalSelection = newSelection;
+    newNonDirectionalSelection.setIsDirectional(false);
+
+    selection->setSelection(newNonDirectionalSelection, granularity);
 }
 
 static inline bool dispatchSelectStart(Node* node)
@@ -409,13 +414,11 @@ bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestR
     if (visiblePos.isNull())
         visiblePos = VisiblePosition(firstPositionInOrBeforeNode(innerNode), DOWNSTREAM);
     Position pos = visiblePos.deepEquivalent();
-    
+
     VisibleSelection newSelection = m_frame->selection()->selection();
     TextGranularity granularity = CharacterGranularity;
 
     if (extendSelection && newSelection.isCaretOrRange()) {
-        m_frame->selection()->setIsDirectional(false);
-        
         ASSERT(m_frame->settings());
         if (m_frame->settings()->editingBehaviorType() == EditingMacBehavior) {
             // See <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection
index a45779ba826a13ac501291cfbfef823c4038233d..490f0cf7df6f527bedd8e396cc9b7e864a39e3ba 100644 (file)
@@ -1,3 +1,15 @@
+2011-07-01  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Reviewed by Ojan Vafai.
+
+        Move m_isDirectional from FrameSelection to VisibleSelection
+        https://bugs.webkit.org/show_bug.cgi?id=63473
+
+        Don't pass MakeNonDirectionalSelection to setSelection since no other port does this.
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::selectRange):
+
 2011-07-01  Andrew Scherkus  <scherkus@chromium.org>
 
         Reviewed by Darin Fisher.
index 3f0fbd39b0f1c50a91d6d05a48bcc18f31075817..e79e343ad754f2c2332ba453d199a8ae7616578f 100644 (file)
@@ -1286,8 +1286,7 @@ void WebFrameImpl::selectRange(const WebPoint& start, const WebPoint& end)
                                visiblePositionForWindowPoint(end));
 
     if (frame()->selection()->shouldChangeSelection(selection))
-        frame()->selection()->setSelection(selection, CharacterGranularity,
-                                           MakeNonDirectionalSelection);
+        frame()->selection()->setSelection(selection, CharacterGranularity);
 }
 
 VisiblePosition WebFrameImpl::visiblePositionForWindowPoint(const WebPoint& point)