2010-11-23 Sheriff Bot <webkit.review.bot@gmail.com>
authorjparent@chromium.org <jparent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Nov 2010 20:50:02 +0000 (20:50 +0000)
committerjparent@chromium.org <jparent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Nov 2010 20:50:02 +0000 (20:50 +0000)
        Unreviewed, rolling out r72618.
        http://trac.webkit.org/changeset/72618
        https://bugs.webkit.org/show_bug.cgi?id=49987

        "Newly added test is failing on Chromium-linux, patch author
        said to rollout" (Requested by jparent on #webkit).

        * editing/EditingBehavior.h:
        * page/EventHandler.cpp:
        (WebCore::EventHandler::sendContextMenuEvent):
2010-11-23  Sheriff Bot  <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r72618.
        http://trac.webkit.org/changeset/72618
        https://bugs.webkit.org/show_bug.cgi?id=49987

        "Newly added test is failing on Chromium-linux, patch author
        said to rollout" (Requested by jparent on #webkit).

        * editing/selection/context-menu-text-selection-expected.txt: Removed.
        * editing/selection/context-menu-text-selection.html: Removed.

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

LayoutTests/ChangeLog
LayoutTests/editing/selection/context-menu-text-selection-expected.txt [deleted file]
LayoutTests/editing/selection/context-menu-text-selection.html [deleted file]
WebCore/ChangeLog
WebCore/editing/EditingBehavior.h
WebCore/page/EventHandler.cpp

index 3d5af619b8b22f380161f3f23018759eae0da529..b89cb8447d373f8895c0adf62c240814c1b42597 100644 (file)
@@ -1,3 +1,15 @@
+2010-11-23  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r72618.
+        http://trac.webkit.org/changeset/72618
+        https://bugs.webkit.org/show_bug.cgi?id=49987
+
+        "Newly added test is failing on Chromium-linux, patch author
+        said to rollout" (Requested by jparent on #webkit).
+
+        * editing/selection/context-menu-text-selection-expected.txt: Removed.
+        * editing/selection/context-menu-text-selection.html: Removed.
+
 2010-11-23  Julie Parent  <jparent@chromium.org>
 
         Unreviewed, fixing chromium baselines.
diff --git a/LayoutTests/editing/selection/context-menu-text-selection-expected.txt b/LayoutTests/editing/selection/context-menu-text-selection-expected.txt
deleted file mode 100644 (file)
index 3caf907..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-This test checks that triggering the context menu selects/doesn't select as platform-appropriate.
-
-Lorem ipsum
-SUCCESS
-SUCCESS
-SUCCESS
diff --git a/LayoutTests/editing/selection/context-menu-text-selection.html b/LayoutTests/editing/selection/context-menu-text-selection.html
deleted file mode 100644 (file)
index 69c470d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<body onload="load()">
-<p>This test checks that triggering the context menu selects/doesn't select as platform-appropriate.</p>
-<div id="text">Lorem ipsum</div>
-<div id="resultmac">RUNNING</div>
-<div id="resultwin">RUNNING</div>
-<div id="resultunix">RUNNING</div>
-</body>
-<script>
-function test(platform, selectionExpected, result)
-{
-    // clear selection
-    window.getSelection().removeAllRanges();
-
-    layoutTestController.setEditingBehavior(platform);
-
-    var text = document.getElementById("text");
-    var resultElement = document.getElementById(result);
-
-    var x = text.offsetParent.offsetLeft + text.offsetLeft + 4;
-    var y = text.offsetParent.offsetTop + text.offsetTop + text.offsetHeight / 2;
-
-    eventSender.mouseMoveTo(x, y);
-
-    var items = eventSender.contextClick();
-    if (items.length == 0) {
-        resultElement.innerHTML = 'FAILURE: No context menu';
-        return;
-    }
-
-    // esc key to kill the context menu
-    eventSender.keyDown(String.fromCharCode(0x001B), null);
-
-    var selectionType = window.getSelection().type;
-    if (selectionExpected) {
-        if (selectionType == "Range")
-            resultElement.innerHTML = "SUCCESS";
-        else
-            resultElement.innerHTML = "FAILURE: There should be a selection.";
-    } else {
-        if (selectionType == "Range")
-            resultElement.innerHTML = "FAILURE: There shouldn't be a selection.";
-        else
-            resultElement.innerHTML = "SUCCESS";
-    }
-}
-
-function load()
-{
-    if (!window.eventSender || !window.layoutTestController)
-        return;
-
-    layoutTestController.dumpAsText();
-
-    test('mac', true, 'resultmac');
-    test('win', false, 'resultwin');
-    test('unix', false, 'resultunix');
-}
-</script>
index fdb34613d316d75cd9d34b73cd38b67e975fdae2..6e820c4daa1de83a9bdc4fd7966c60c12e81d1fb 100644 (file)
@@ -1,3 +1,16 @@
+2010-11-23  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r72618.
+        http://trac.webkit.org/changeset/72618
+        https://bugs.webkit.org/show_bug.cgi?id=49987
+
+        "Newly added test is failing on Chromium-linux, patch author
+        said to rollout" (Requested by jparent on #webkit).
+
+        * editing/EditingBehavior.h:
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::sendContextMenuEvent):
+
 2010-11-23  Avi Drissman  <avi@google.com>
 
         Reviewed by Antonio Gomes.
index a367c526ccfc18d1a6960d3c8a4d8e260c118ea5..842d3f207a5ccaee7ee608139cbc2a04c4e8a4fb 100644 (file)
@@ -57,9 +57,6 @@ public:
     // in place and moving the extent. Matches NSTextView.
     bool shouldAlwaysGrowSelectionWhenExtendingToBoundary() const { return m_type == EditingMacBehavior; }
 
-    // On Mac, when processing a contextual click, the object being clicked upon should be selected.
-    bool shouldSelectOnContextualMenuClick() const { return m_type == EditingMacBehavior; }
-
 private:
     EditingBehaviorType m_type;
 };
index e095136d947ac1299aa4cba329e257588e543e00..f6a2353815f61adbd1dc4181005e25ca076baba1 100644 (file)
@@ -2007,8 +2007,11 @@ bool EventHandler::sendContextMenuEvent(const PlatformMouseEvent& event)
     HitTestRequest request(HitTestRequest::Active);
     MouseEventWithHitTestResults mev = doc->prepareMouseEvent(request, viewportPos, event);
 
-    if (m_frame->editor()->behavior().shouldSelectOnContextualMenuClick()
-        && !m_frame->selection()->contains(viewportPos)
+    // Context menu events shouldn't select text in GTK+ applications or in Chromium.
+    // FIXME: This should probably be configurable by embedders. Consider making it a WebPreferences setting.
+    // See: https://bugs.webkit.org/show_bug.cgi?id=15279
+#if !PLATFORM(GTK) && !PLATFORM(CHROMIUM)
+    if (!m_frame->selection()->contains(viewportPos)
         // FIXME: In the editable case, word selection sometimes selects content that isn't underneath the mouse.
         // If the selection is non-editable, we do word selection to make it easier to use the contextual menu items
         // available for text selections.  But only if we're above text.
@@ -2016,6 +2019,7 @@ bool EventHandler::sendContextMenuEvent(const PlatformMouseEvent& event)
         m_mouseDownMayStartSelect = true; // context menu events are always allowed to perform a selection
         selectClosestWordOrLinkFromMouseEvent(mev);
     }
+#endif
 
     swallowEvent = dispatchMouseEvent(eventNames().contextmenuEvent, mev.targetNode(), true, 0, event, false);