зеркало из https://github.com/mozilla/pjs.git
Bug 405632, can't pan maps by dragging on maps.live.com , r+sr=jst, a=sicking
This commit is contained in:
Родитель
b9f9d128a4
Коммит
07608b789d
|
@ -85,6 +85,7 @@ static char *sPopupAllowedEvents;
|
|||
nsDOMEvent::nsDOMEvent(nsPresContext* aPresContext, nsEvent* aEvent)
|
||||
{
|
||||
mPresContext = aPresContext;
|
||||
mPrivateDataDuplicated = PR_FALSE;
|
||||
|
||||
if (aEvent) {
|
||||
mEvent = aEvent;
|
||||
|
@ -907,6 +908,7 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData()
|
|||
mEvent = newEvent;
|
||||
mPresContext = nsnull;
|
||||
mEventIsInternal = PR_TRUE;
|
||||
mPrivateDataDuplicated = PR_TRUE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -184,6 +184,7 @@ protected:
|
|||
nsCOMPtr<nsIDOMEventTarget> mTmpRealOriginalTarget;
|
||||
nsCOMPtr<nsIDOMEventTarget> mExplicitOriginalTarget;
|
||||
PRPackedBool mEventIsInternal;
|
||||
PRPackedBool mPrivateDataDuplicated;
|
||||
};
|
||||
|
||||
#define NS_FORWARD_TO_NSDOMEVENT \
|
||||
|
|
|
@ -215,7 +215,9 @@ nsDOMUIEvent::GetPagePoint()
|
|||
nsPresContext::AppUnitsToIntCSSPixels(pt.y));
|
||||
}
|
||||
|
||||
return mPagePoint;
|
||||
// If event was initialized manually using InitMouseEvent(...),
|
||||
// page coordinates must be the same as client coordinates. See bug 405632.
|
||||
return mPrivateDataDuplicated ? mPagePoint : GetClientPoint();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ _TEST_FILES = \
|
|||
test_bug379120.html \
|
||||
test_bug391568.xhtml \
|
||||
test_bug402089.html \
|
||||
test_bug405632.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=405632
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 405632</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=405632">Mozilla Bug 405632</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 405632 **/
|
||||
|
||||
var me = document.createEvent("mouseevent");
|
||||
me.initMouseEvent("foo", false, false, window, 0, 100, 100, 100, 100,
|
||||
false, false, false, false, 0, null);
|
||||
ok(me.clientX == me.pageX,
|
||||
"mouseEvent.clientX should be the same as mouseEvent.pageX when event is initialized manually");
|
||||
ok(me.clientY == me.pageY,
|
||||
"mouseEvent.clientY should be the same as mouseEvent.pageY when event is initialized manually");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
Загрузка…
Ссылка в новой задаче