Bug 405632, can't pan maps by dragging on maps.live.com , r+sr=jst, a=sicking

This commit is contained in:
Olli.Pettay@helsinki.fi 2007-11-28 01:16:01 -08:00
Родитель b9f9d128a4
Коммит 07608b789d
5 изменённых файлов: 42 добавлений и 1 удалений

Просмотреть файл

@ -85,6 +85,7 @@ static char *sPopupAllowedEvents;
nsDOMEvent::nsDOMEvent(nsPresContext* aPresContext, nsEvent* aEvent) nsDOMEvent::nsDOMEvent(nsPresContext* aPresContext, nsEvent* aEvent)
{ {
mPresContext = aPresContext; mPresContext = aPresContext;
mPrivateDataDuplicated = PR_FALSE;
if (aEvent) { if (aEvent) {
mEvent = aEvent; mEvent = aEvent;
@ -907,6 +908,7 @@ NS_METHOD nsDOMEvent::DuplicatePrivateData()
mEvent = newEvent; mEvent = newEvent;
mPresContext = nsnull; mPresContext = nsnull;
mEventIsInternal = PR_TRUE; mEventIsInternal = PR_TRUE;
mPrivateDataDuplicated = PR_TRUE;
return NS_OK; return NS_OK;
} }

Просмотреть файл

@ -184,6 +184,7 @@ protected:
nsCOMPtr<nsIDOMEventTarget> mTmpRealOriginalTarget; nsCOMPtr<nsIDOMEventTarget> mTmpRealOriginalTarget;
nsCOMPtr<nsIDOMEventTarget> mExplicitOriginalTarget; nsCOMPtr<nsIDOMEventTarget> mExplicitOriginalTarget;
PRPackedBool mEventIsInternal; PRPackedBool mEventIsInternal;
PRPackedBool mPrivateDataDuplicated;
}; };
#define NS_FORWARD_TO_NSDOMEVENT \ #define NS_FORWARD_TO_NSDOMEVENT \

Просмотреть файл

@ -215,7 +215,9 @@ nsDOMUIEvent::GetPagePoint()
nsPresContext::AppUnitsToIntCSSPixels(pt.y)); 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_bug379120.html \
test_bug391568.xhtml \ test_bug391568.xhtml \
test_bug402089.html \ test_bug402089.html \
test_bug405632.html \
$(NULL) $(NULL)
libs:: $(_TEST_FILES) 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>