Commit a77a7e69 authored by jparent@chromium.org's avatar jparent@chromium.org

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  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: http://svn.webkit.org/repository/webkit/trunk@72622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 31c1cb0c
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.
This test checks that triggering the context menu selects/doesn't select as platform-appropriate.
Lorem ipsum
SUCCESS
SUCCESS
SUCCESS
<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>
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.
......@@ -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;
};
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment