mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Bug 879838 dblclick event sometimes has incorrect explicitOriginalTarget r=smaug
This commit is contained in:
parent
8bde04eebd
commit
8a5c98103a
@ -4567,7 +4567,10 @@ nsEventStateManager::CheckForAndDispatchClick(nsPresContext* aPresContext,
|
||||
if (!mouseContent && !mCurrentTarget) {
|
||||
return NS_OK;
|
||||
}
|
||||
ret = presShell->HandleEventWithTarget(&event, mCurrentTarget,
|
||||
|
||||
// HandleEvent clears out mCurrentTarget which we might need again
|
||||
nsWeakFrame currentTarget = mCurrentTarget;
|
||||
ret = presShell->HandleEventWithTarget(&event, currentTarget,
|
||||
mouseContent, aStatus);
|
||||
if (NS_SUCCEEDED(ret) && aEvent->clickCount == 2) {
|
||||
//fire double click
|
||||
@ -4581,7 +4584,7 @@ nsEventStateManager::CheckForAndDispatchClick(nsPresContext* aPresContext,
|
||||
event2.button = aEvent->button;
|
||||
event2.inputSource = aEvent->inputSource;
|
||||
|
||||
ret = presShell->HandleEventWithTarget(&event2, mCurrentTarget,
|
||||
ret = presShell->HandleEventWithTarget(&event2, currentTarget,
|
||||
mouseContent, aStatus);
|
||||
}
|
||||
}
|
||||
|
@ -104,6 +104,7 @@ MOCHITEST_FILES = \
|
||||
test_focus_disabled.html \
|
||||
test_bug847597.html \
|
||||
test_bug855741.html \
|
||||
test_dblclick_explicit_original_target.html \
|
||||
$(NULL)
|
||||
|
||||
ifeq (,$(filter gonk,$(MOZ_WIDGET_TOOLKIT)))
|
||||
|
@ -0,0 +1,33 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test explicit original target of dblclick event</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<p id="display">Test explicit original target of dblclick event</p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
|
||||
function runTests()
|
||||
{
|
||||
synthesizeMouse(document.getElementById("display"), 5, 5, { clickCount: 2 });
|
||||
}
|
||||
|
||||
window.ondblclick = function(event) {
|
||||
is(event.explicitOriginalTarget.nodeType, Node.TEXT_NODE, "explicitOriginalTarget is a text node");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user