зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 2ac9fe6d2333 (bug 1164981) for frequent test_bug301397.xul failures.
CLOSED TREE
This commit is contained in:
Родитель
826e665551
Коммит
32c71ac735
|
@ -148,7 +148,6 @@ DragEvent::Constructor(const GlobalObject& aGlobal,
|
|||
aParam.mCtrlKey, aParam.mAltKey, aParam.mShiftKey,
|
||||
aParam.mMetaKey, aParam.mButton, aParam.mRelatedTarget,
|
||||
aParam.mDataTransfer);
|
||||
e->InitializeExtraMouseEventDictionaryMembers(aParam);
|
||||
e->SetTrusted(trusted);
|
||||
return e.forget();
|
||||
}
|
||||
|
|
|
@ -138,15 +138,6 @@ MouseEvent::InitMouseEvent(const nsAString& aType,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
MouseEvent::InitializeExtraMouseEventDictionaryMembers(const MouseEventInit& aParam)
|
||||
{
|
||||
InitModifiers(aParam);
|
||||
mEvent->AsMouseEventBase()->buttons = aParam.mButtons;
|
||||
mMovementPoint.x = aParam.mMovementX;
|
||||
mMovementPoint.y = aParam.mMovementY;
|
||||
}
|
||||
|
||||
already_AddRefed<MouseEvent>
|
||||
MouseEvent::Constructor(const GlobalObject& aGlobal,
|
||||
const nsAString& aType,
|
||||
|
@ -162,8 +153,11 @@ MouseEvent::Constructor(const GlobalObject& aGlobal,
|
|||
aParam.mCtrlKey, aParam.mAltKey, aParam.mShiftKey,
|
||||
aParam.mMetaKey, aParam.mButton, aParam.mRelatedTarget,
|
||||
aRv);
|
||||
e->InitializeExtraMouseEventDictionaryMembers(aParam);
|
||||
e->InitModifiers(aParam);
|
||||
e->SetTrusted(trusted);
|
||||
MOZ_RELEASE_ASSERT(e->mEvent->AsMouseEventBase(),
|
||||
"mEvent of MouseEvent must inherit WidgetMouseEventBase");
|
||||
e->mEvent->AsMouseEventBase()->buttons = aParam.mButtons;
|
||||
|
||||
return e.forget();
|
||||
}
|
||||
|
@ -311,7 +305,7 @@ NS_IMETHODIMP
|
|||
MouseEvent::GetMozMovementX(int32_t* aMovementX)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aMovementX);
|
||||
*aMovementX = MovementX();
|
||||
*aMovementX = MozMovementX();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -320,7 +314,7 @@ NS_IMETHODIMP
|
|||
MouseEvent::GetMozMovementY(int32_t* aMovementY)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aMovementY);
|
||||
*aMovementY = MovementY();
|
||||
*aMovementY = MozMovementY();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -69,9 +69,6 @@ public:
|
|||
aShiftKey, aMetaKey, aButton,
|
||||
aRelatedTarget);
|
||||
}
|
||||
|
||||
void InitializeExtraMouseEventDictionaryMembers(const MouseEventInit& aParam);
|
||||
|
||||
bool GetModifierState(const nsAString& aKeyArg)
|
||||
{
|
||||
return GetModifierStateInternal(aKeyArg);
|
||||
|
@ -80,11 +77,11 @@ public:
|
|||
const nsAString& aType,
|
||||
const MouseEventInit& aParam,
|
||||
ErrorResult& aRv);
|
||||
int32_t MovementX()
|
||||
int32_t MozMovementX()
|
||||
{
|
||||
return GetMovementPoint().x;
|
||||
}
|
||||
int32_t MovementY()
|
||||
int32_t MozMovementY()
|
||||
{
|
||||
return GetMovementPoint().y;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ PointerEvent::Constructor(EventTarget* aOwner,
|
|||
aParam.mScreenY, aParam.mClientX, aParam.mClientY,
|
||||
false, false, false, false, aParam.mButton,
|
||||
aParam.mRelatedTarget);
|
||||
e->InitializeExtraMouseEventDictionaryMembers(aParam);
|
||||
e->InitModifiers(aParam);
|
||||
|
||||
WidgetPointerEvent* widgetEvent = e->mEvent->AsPointerEvent();
|
||||
widgetEvent->pointerId = aParam.mPointerId;
|
||||
|
|
|
@ -114,7 +114,7 @@ DevPixelsToCSSPixels(const LayoutDeviceIntPoint& aPoint,
|
|||
nsIntPoint
|
||||
UIEvent::GetMovementPoint()
|
||||
{
|
||||
if (mPrivateDataDuplicated || mEventIsInternal) {
|
||||
if (mPrivateDataDuplicated) {
|
||||
return mMovementPoint;
|
||||
}
|
||||
|
||||
|
|
|
@ -164,7 +164,8 @@ WheelEvent::Constructor(const GlobalObject& aGlobal,
|
|||
aParam.mButton, aParam.mRelatedTarget,
|
||||
EmptyString(), aParam.mDeltaX,
|
||||
aParam.mDeltaY, aParam.mDeltaZ, aParam.mDeltaMode);
|
||||
e->InitializeExtraMouseEventDictionaryMembers(aParam);
|
||||
e->InitModifiers(aParam);
|
||||
e->mEvent->AsWheelEvent()->buttons = aParam.mButtons;
|
||||
e->SetTrusted(trusted);
|
||||
return e.forget();
|
||||
}
|
||||
|
|
|
@ -107,10 +107,6 @@ function testInitializingUntrustedEvent()
|
|||
}
|
||||
is(e.isTrusted, false, description + "isTrusted returns wrong value");
|
||||
is(e.buttons, 0, description + "buttons returns wrong value");
|
||||
is(e.movementX, 0, description + "movementX returns wrong value");
|
||||
is(e.movementY, 0, description + "movementY returns wrong value");
|
||||
is(e.movementX, e.mozMovementX);
|
||||
is(e.movementY, e.mozMovementY);
|
||||
|
||||
// getModifierState() tests
|
||||
is(e.getModifierState("Shift"), kTest.shiftKey,
|
||||
|
|
|
@ -696,14 +696,11 @@ try {
|
|||
ok(ex, "MouseEvent: First parameter is required!");
|
||||
ex = false;
|
||||
|
||||
e = new MouseEvent("hello", { buttons: 1, movementX: 2, movementY: 3});
|
||||
e = new MouseEvent("hello");
|
||||
is(e.type, "hello", "MouseEvent: Wrong event type!");
|
||||
ok(!e.isTrusted, "MouseEvent: Event shouldn't be trusted!");
|
||||
ok(!e.bubbles, "MouseEvent: Event shouldn't bubble!");
|
||||
ok(!e.cancelable, "MouseEvent: Event shouldn't be cancelable!");
|
||||
is(e.buttons, 1);
|
||||
is(e.movementX, 2);
|
||||
is(e.movementY, 3);
|
||||
document.dispatchEvent(e);
|
||||
is(receivedEvent, e, "MouseEvent: Wrong event!");
|
||||
|
||||
|
@ -727,7 +724,7 @@ var mouseEventProps =
|
|||
{ modifierSymbolLock: false },
|
||||
{ button: 0 },
|
||||
{ buttons: 0 },
|
||||
{ relatedTarget: null },
|
||||
{ relatedTarget: null }
|
||||
];
|
||||
|
||||
var testProps =
|
||||
|
@ -814,11 +811,8 @@ try {
|
|||
ok(ex, "WheelEvent: First parameter is required!");
|
||||
ex = false;
|
||||
|
||||
e = new WheelEvent("hello", { buttons: 1, movementX: 2, movementY: 3});
|
||||
e = new WheelEvent("hello");
|
||||
is(e.type, "hello", "WheelEvent: Wrong event type!");
|
||||
is(e.buttons, 1);
|
||||
is(e.movementX, 2);
|
||||
is(e.movementY, 3);
|
||||
ok(!e.isTrusted, "WheelEvent: Event shouldn't be trusted!");
|
||||
ok(!e.bubbles, "WheelEvent: Event shouldn't bubble!");
|
||||
ok(!e.cancelable, "WheelEvent: Event shouldn't be cancelable!");
|
||||
|
@ -913,11 +907,8 @@ try {
|
|||
ok(ex, "DragEvent: First parameter is required!");
|
||||
ex = false;
|
||||
|
||||
e = new DragEvent("hello", { buttons: 1, movementX: 2, movementY: 3});
|
||||
e = new DragEvent("hello");
|
||||
is(e.type, "hello", "DragEvent: Wrong event type!");
|
||||
is(e.buttons, 1);
|
||||
is(e.movementX, 2);
|
||||
is(e.movementY, 3);
|
||||
document.dispatchEvent(e);
|
||||
is(receivedEvent, e, "DragEvent: Wrong event!");
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
* liability, trademark and document use rules apply.
|
||||
*/
|
||||
|
||||
[Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)]
|
||||
interface MouseEvent : UIEvent {
|
||||
readonly attribute long screenX;
|
||||
readonly attribute long screenY;
|
||||
|
@ -26,11 +25,6 @@ interface MouseEvent : UIEvent {
|
|||
readonly attribute unsigned short buttons;
|
||||
readonly attribute EventTarget? relatedTarget;
|
||||
readonly attribute DOMString? region;
|
||||
|
||||
// Pointer Lock
|
||||
readonly attribute long movementX;
|
||||
readonly attribute long movementY;
|
||||
|
||||
// Deprecated in DOM Level 3:
|
||||
[Throws]
|
||||
void initMouseEvent(DOMString typeArg,
|
||||
|
@ -52,6 +46,13 @@ interface MouseEvent : UIEvent {
|
|||
boolean getModifierState(DOMString keyArg);
|
||||
};
|
||||
|
||||
|
||||
// Event Constructor Syntax:
|
||||
[Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)]
|
||||
partial interface MouseEvent
|
||||
{
|
||||
};
|
||||
|
||||
// Suggested initMouseEvent replacement initializer:
|
||||
dictionary MouseEventInit : EventModifierInit {
|
||||
// Attributes for MouseEvent:
|
||||
|
@ -63,18 +64,12 @@ dictionary MouseEventInit : EventModifierInit {
|
|||
// Note: "buttons" was not previously initializable through initMouseEvent!
|
||||
unsigned short buttons = 0;
|
||||
EventTarget? relatedTarget = null;
|
||||
|
||||
// Pointer Lock
|
||||
long movementX = 0;
|
||||
long movementY = 0;
|
||||
};
|
||||
|
||||
// Mozilla extensions
|
||||
partial interface MouseEvent
|
||||
{
|
||||
[BinaryName="movementX"]
|
||||
readonly attribute long mozMovementX;
|
||||
[BinaryName="movementY"]
|
||||
readonly attribute long mozMovementY;
|
||||
|
||||
// Finger or touch pressure event value
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
[constructor.html]
|
||||
type: testharness
|
||||
[Default event values for mouse event interface and its pointer lock extensions.]
|
||||
expected: FAIL
|
||||
|
||||
[Default event values for pointerlockerror using a dictionary]
|
||||
expected: FAIL
|
||||
|
|
@ -42,3 +42,21 @@
|
|||
[Document interface: window.document must inherit property "exitPointerLock" with the proper type (3)]
|
||||
expected: FAIL
|
||||
|
||||
[MouseEvent interface: attribute movementX]
|
||||
expected: FAIL
|
||||
|
||||
[MouseEvent interface: attribute movementY]
|
||||
expected: FAIL
|
||||
|
||||
[MouseEvent interface: new MouseEvent('mousemove') must inherit property "movementX" with the proper type (0)]
|
||||
expected: FAIL
|
||||
|
||||
[MouseEvent interface: new MouseEvent('mousemove') must inherit property "movementY" with the proper type (1)]
|
||||
expected: FAIL
|
||||
|
||||
[MouseEvent interface: new MouseEvent('pointerlockchange') must inherit property "movementX" with the proper type (0)]
|
||||
expected: FAIL
|
||||
|
||||
[MouseEvent interface: new MouseEvent('pointerlockchange') must inherit property "movementY" with the proper type (1)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче