Backed out 3 changesets (bug 822898) for mochitest bustage on Windows on a CLOSED TREE

Backed out changeset 63c1f6716755 (bug 822898)
Backed out changeset 145150ef00a5 (bug 822898)
Backed out changeset a5e360e6d713 (bug 822898)
This commit is contained in:
Wes Kocher 2013-11-18 15:27:53 -08:00
parent 9330d8a3e2
commit 6f03d746be
27 changed files with 1 additions and 817 deletions

View File

@ -1757,18 +1757,6 @@ GK_ATOM(onMozEdgeUIStarted, "onMozEdgeUIStarted")
GK_ATOM(onMozEdgeUICanceled, "onMozEdgeUICanceled")
GK_ATOM(onMozEdgeUICompleted, "onMozEdgeUICompleted")
// Pointer events
GK_ATOM(onpointerdown, "onpointerdown")
GK_ATOM(onpointermove, "onpointermove")
GK_ATOM(onpointerup, "onpointerup")
GK_ATOM(onpointercancel, "onpointercancel")
GK_ATOM(onpointerover, "onpointerover")
GK_ATOM(onpointerout, "onpointerout")
GK_ATOM(onpointerenter, "onpointerenter")
GK_ATOM(onpointerleave, "onpointerleave")
GK_ATOM(ongotpointercapture, "ongotpointercapture")
GK_ATOM(onlostpointercapture, "onlostpointercapture")
// orientation support
GK_ATOM(ondevicemotion, "ondevicemotion")
GK_ATOM(ondeviceorientation, "ondeviceorientation")

View File

@ -293,48 +293,6 @@ EVENT(mozpointerlockerror,
NS_POINTERLOCKERROR,
EventNameType_HTML,
NS_EVENT)
EVENT(pointerdown,
NS_POINTER_DOWN,
EventNameType_All,
NS_POINTER_EVENT)
EVENT(pointermove,
NS_POINTER_MOVE,
EventNameType_All,
NS_POINTER_EVENT)
EVENT(pointerup,
NS_POINTER_UP,
EventNameType_All,
NS_POINTER_EVENT)
EVENT(pointercancel,
NS_POINTER_CANCEL,
EventNameType_All,
NS_POINTER_EVENT)
EVENT(pointerover,
NS_POINTER_OVER,
EventNameType_All,
NS_POINTER_EVENT)
EVENT(pointerout,
NS_POINTER_OUT,
EventNameType_All,
NS_POINTER_EVENT)
EVENT(pointerenter,
NS_POINTER_ENTER,
EventNameType_All,
NS_POINTER_EVENT)
EVENT(pointerleave,
NS_POINTER_LEAVE,
EventNameType_All,
NS_POINTER_EVENT)
EVENT(gotpointercapture,
NS_POINTER_GOT_CAPTURE,
EventNameType_All,
NS_POINTER_EVENT)
EVENT(lostpointercapture,
NS_POINTER_LOST_CAPTURE,
EventNameType_All,
NS_POINTER_EVENT)
// Not supported yet; probably never because "wheel" is a better idea.
// EVENT(mousewheel)
EVENT(pause,

View File

@ -1,150 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Portions Copyright 2013 Microsoft Open Technologies, Inc. */
#include "PointerEvent.h"
#include "mozilla/MouseEvents.h"
#include "prtime.h"
namespace mozilla {
namespace dom {
PointerEvent::PointerEvent(EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetPointerEvent* aEvent)
: nsDOMMouseEvent(aOwner, aPresContext, aEvent ? aEvent : new WidgetPointerEvent(false, 0, nullptr))
{
NS_ASSERTION(mEvent->eventStructType == NS_POINTER_EVENT, "event type mismatch NS_POINTER_EVENT");
WidgetMouseEvent* mouseEvent = mEvent->AsMouseEvent();
if (aEvent) {
mEventIsInternal = false;
} else {
mEventIsInternal = true;
mEvent->time = PR_Now();
mEvent->refPoint.x = mEvent->refPoint.y = 0;
mouseEvent->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
}
}
static uint16_t
ConvertStringToPointerType(const nsAString& aPointerTypeArg)
{
if (aPointerTypeArg.EqualsLiteral("mouse")) {
return nsIDOMMouseEvent::MOZ_SOURCE_MOUSE;
}
if (aPointerTypeArg.EqualsLiteral("pen")) {
return nsIDOMMouseEvent::MOZ_SOURCE_PEN;
}
if (aPointerTypeArg.EqualsLiteral("touch")) {
return nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
}
return nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
}
//static
already_AddRefed<PointerEvent>
PointerEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
const nsAString& aType,
const mozilla::dom::PointerEventInit& aParam,
mozilla::ErrorResult& aRv)
{
nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
nsRefPtr<PointerEvent> e = new PointerEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);
aRv = e->InitMouseEvent(aType, aParam.mBubbles, aParam.mCancelable,
aParam.mView, aParam.mDetail, aParam.mScreenX,
aParam.mScreenY, aParam.mClientX, aParam.mClientY,
aParam.mCtrlKey, aParam.mAltKey, aParam.mShiftKey,
aParam.mMetaKey, aParam.mButton, aParam.mRelatedTarget);
if (aRv.Failed()) {
return nullptr;
}
WidgetPointerEvent* widgetEvent = e->mEvent->AsPointerEvent();
widgetEvent->pointerId = aParam.mPointerId;
widgetEvent->width = aParam.mWidth;
widgetEvent->height = aParam.mHeight;
widgetEvent->pressure = aParam.mPressure;
widgetEvent->tiltX = aParam.mTiltX;
widgetEvent->tiltY = aParam.mTiltY;
widgetEvent->inputSource = ConvertStringToPointerType(aParam.mPointerType);
widgetEvent->isPrimary = aParam.mIsPrimary;
widgetEvent->buttons = aParam.mButtons;
e->SetTrusted(trusted);
return e.forget();
}
void
PointerEvent::GetPointerType(nsAString& aPointerType)
{
switch (mEvent->AsPointerEvent()->inputSource) {
case nsIDOMMouseEvent::MOZ_SOURCE_MOUSE:
aPointerType.AssignLiteral("mouse");
break;
case nsIDOMMouseEvent::MOZ_SOURCE_PEN:
aPointerType.AssignLiteral("pen");
break;
case nsIDOMMouseEvent::MOZ_SOURCE_TOUCH:
aPointerType.AssignLiteral("touch");
break;
case nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN:
aPointerType.AssignLiteral("");
break;
}
}
int32_t PointerEvent::PointerId()
{
return mEvent->AsPointerEvent()->pointerId;
}
int32_t PointerEvent::Width()
{
return mEvent->AsPointerEvent()->width;
}
int32_t PointerEvent::Height()
{
return mEvent->AsPointerEvent()->height;
}
int32_t PointerEvent::Pressure()
{
return mEvent->AsPointerEvent()->pressure;
}
int32_t PointerEvent::TiltX()
{
return mEvent->AsPointerEvent()->tiltX;
}
int32_t PointerEvent::TiltY()
{
return mEvent->AsPointerEvent()->tiltY;
}
bool PointerEvent::IsPrimary()
{
return mEvent->AsPointerEvent()->isPrimary;
}
} // namespace dom
} // namespace mozilla
using namespace mozilla;
nsresult NS_NewDOMPointerEvent(nsIDOMEvent** aInstancePtrResult,
dom::EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetPointerEvent *aEvent)
{
dom::PointerEvent *it = new dom::PointerEvent(aOwner, aPresContext, aEvent);
return CallQueryInterface(it, aInstancePtrResult);
}

View File

@ -1,50 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Portions Copyright 2013 Microsoft Open Technologies, Inc. */
#ifndef PointerEvent_h__
#define PointerEvent_h__
#include "nsDOMMouseEvent.h"
#include "mozilla/dom/PointerEventBinding.h"
class nsPresContext;
namespace mozilla {
namespace dom {
class PointerEvent : public nsDOMMouseEvent
{
public:
PointerEvent(EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetPointerEvent* aEvent);
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
{
return mozilla::dom::PointerEventBinding::Wrap(aCx, aScope, this);
}
static already_AddRefed<PointerEvent>
Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const PointerEventInit& aParam,
mozilla::ErrorResult& aRv);
int32_t PointerId();
int32_t Width();
int32_t Height();
int32_t Pressure();
int32_t TiltX();
int32_t TiltY();
bool IsPrimary();
void GetPointerType(nsAString& aPointerType);
};
} // namespace dom
} // namespace mozilla
#endif

View File

@ -16,7 +16,6 @@ EXPORTS += [
]
EXPORTS.mozilla.dom += [
'PointerEvent.h',
'Touch.h',
]
@ -61,7 +60,6 @@ SOURCES += [
'nsIMEStateManager.cpp',
'nsPaintRequest.cpp',
'nsPrivateTextRange.cpp',
'PointerEvent.cpp',
'TextComposition.cpp',
'Touch.cpp',
]

View File

@ -145,7 +145,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMEvent)
case NS_MOUSE_SCROLL_EVENT:
case NS_WHEEL_EVENT:
case NS_SIMPLE_GESTURE_EVENT:
case NS_POINTER_EVENT:
tmp->mEvent->AsMouseEventBase()->relatedTarget = nullptr;
break;
case NS_DRAG_EVENT: {
@ -183,7 +182,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMEvent)
case NS_MOUSE_SCROLL_EVENT:
case NS_WHEEL_EVENT:
case NS_SIMPLE_GESTURE_EVENT:
case NS_POINTER_EVENT:
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->relatedTarget");
cb.NoteXPCOMChild(tmp->mEvent->AsMouseEventBase()->relatedTarget);
break;
@ -740,21 +738,6 @@ nsDOMEvent::DuplicatePrivateData()
newEvent = touchEvent;
break;
}
case NS_POINTER_EVENT:
{
WidgetPointerEvent* oldPointerEvent = mEvent->AsPointerEvent();
WidgetPointerEvent* pointerEvent =
new WidgetPointerEvent(false, msg, nullptr,
oldPointerEvent->pointerId,
oldPointerEvent->width,
oldPointerEvent->height,
oldPointerEvent->tiltX,
oldPointerEvent->tiltY,
oldPointerEvent->isPrimary);
pointerEvent->buttons = oldPointerEvent->buttons;
newEvent = pointerEvent;
break;
}
default:
{
NS_WARNING("Unknown event type!!!");
@ -1039,7 +1022,6 @@ nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext,
(aEvent->eventStructType != NS_MOUSE_EVENT &&
aEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
aEvent->eventStructType != NS_WHEEL_EVENT &&
aEvent->eventStructType != NS_POINTER_EVENT &&
aEvent->eventStructType != NS_TOUCH_EVENT &&
aEvent->eventStructType != NS_DRAG_EVENT &&
aEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT)) {
@ -1099,7 +1081,6 @@ nsDOMEvent::GetClientCoords(nsPresContext* aPresContext,
aEvent->eventStructType != NS_WHEEL_EVENT &&
aEvent->eventStructType != NS_TOUCH_EVENT &&
aEvent->eventStructType != NS_DRAG_EVENT &&
aEvent->eventStructType != NS_POINTER_EVENT &&
aEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT) ||
!aPresContext ||
!aEvent->AsGUIEvent()->widget) {

View File

@ -62,7 +62,6 @@ nsDOMMouseEvent::InitMouseEvent(const nsAString & aType, bool aCanBubble, bool a
case NS_MOUSE_SCROLL_EVENT:
case NS_WHEEL_EVENT:
case NS_DRAG_EVENT:
case NS_POINTER_EVENT:
case NS_SIMPLE_GESTURE_EVENT: {
WidgetMouseEventBase* mouseEventBase = mEvent->AsMouseEventBase();
mouseEventBase->relatedTarget = aRelatedTarget;
@ -116,7 +115,6 @@ nsDOMMouseEvent::InitMouseEvent(const nsAString& aType,
case NS_MOUSE_SCROLL_EVENT:
case NS_WHEEL_EVENT:
case NS_DRAG_EVENT:
case NS_POINTER_EVENT:
case NS_SIMPLE_GESTURE_EVENT:
mEvent->AsInputEvent()->modifiers = modifiers;
return NS_OK;
@ -147,7 +145,6 @@ nsDOMMouseEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
case NS_MOUSE_SCROLL_EVENT:
case NS_WHEEL_EVENT:
case NS_DRAG_EVENT:
case NS_POINTER_EVENT:
case NS_SIMPLE_GESTURE_EVENT:
e->mEvent->AsMouseEventBase()->buttons = aParam.mButtons;
break;
@ -195,7 +192,6 @@ nsDOMMouseEvent::Button()
case NS_MOUSE_SCROLL_EVENT:
case NS_WHEEL_EVENT:
case NS_DRAG_EVENT:
case NS_POINTER_EVENT:
case NS_SIMPLE_GESTURE_EVENT:
return mEvent->AsMouseEventBase()->button;
default:
@ -221,7 +217,6 @@ nsDOMMouseEvent::Buttons()
case NS_MOUSE_SCROLL_EVENT:
case NS_WHEEL_EVENT:
case NS_DRAG_EVENT:
case NS_POINTER_EVENT:
case NS_SIMPLE_GESTURE_EVENT:
return mEvent->AsMouseEventBase()->buttons;
default:
@ -247,7 +242,6 @@ nsDOMMouseEvent::GetRelatedTarget()
case NS_MOUSE_SCROLL_EVENT:
case NS_WHEEL_EVENT:
case NS_DRAG_EVENT:
case NS_POINTER_EVENT:
case NS_SIMPLE_GESTURE_EVENT:
relatedTarget =
do_QueryInterface(mEvent->AsMouseEventBase()->relatedTarget);

View File

@ -119,7 +119,6 @@ nsDOMUIEvent::GetMovementPoint()
mEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
mEvent->eventStructType != NS_WHEEL_EVENT &&
mEvent->eventStructType != NS_DRAG_EVENT &&
mEvent->eventStructType != NS_POINTER_EVENT &&
mEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT) ||
!mEvent->AsGUIEvent()->widget) {
return nsIntPoint(0, 0);
@ -301,7 +300,6 @@ nsDOMUIEvent::GetLayerPoint() const
(mEvent->eventStructType != NS_MOUSE_EVENT &&
mEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
mEvent->eventStructType != NS_WHEEL_EVENT &&
mEvent->eventStructType != NS_POINTER_EVENT &&
mEvent->eventStructType != NS_TOUCH_EVENT &&
mEvent->eventStructType != NS_DRAG_EVENT &&
mEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT) ||

View File

@ -46,7 +46,6 @@ public:
aEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
aEvent->eventStructType != NS_WHEEL_EVENT &&
aEvent->eventStructType != NS_DRAG_EVENT &&
aEvent->eventStructType != NS_POINTER_EVENT &&
aEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT)) {
return nsIntPoint(0, 0);
}
@ -72,7 +71,6 @@ public:
aEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
aEvent->eventStructType != NS_WHEEL_EVENT &&
aEvent->eventStructType != NS_DRAG_EVENT &&
aEvent->eventStructType != NS_POINTER_EVENT &&
aEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT) ||
!aPresContext ||
!aEvent->AsGUIEvent()->widget) {

View File

@ -739,9 +739,6 @@ nsEventDispatcher::CreateEvent(mozilla::dom::EventTarget* aOwner,
case NS_SIMPLE_GESTURE_EVENT:
return NS_NewDOMSimpleGestureEvent(aDOMEvent, aOwner, aPresContext,
aEvent->AsSimpleGestureEvent());
case NS_POINTER_EVENT:
return NS_NewDOMPointerEvent(aDOMEvent, aOwner, aPresContext,
aEvent->AsPointerEvent());
case NS_TOUCH_EVENT:
return NS_NewDOMTouchEvent(aDOMEvent, aOwner, aPresContext,
aEvent->AsTouchEvent());

View File

@ -45,7 +45,6 @@ support-files =
[test_bug493251.html]
[test_bug502818.html]
[test_bug508479.html]
[test_bug822898.html]
[test_bug517851.html]
[test_bug534833.html]
[test_bug545268.html]

View File

@ -294,10 +294,6 @@ const kEventConstructors = {
return new PageTransitionEvent(aName, aProps);
},
},
PointerEvent: { create: function (aName, aProps) {
return new PointerEvent(aName, aProps);
},
},
PopStateEvent: { create: function (aName, aProps) {
return new PopStateEvent(aName, aProps);
},

View File

@ -1,265 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=822898
-->
<head>
<title>Test for Bug 822898</title>
<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=822898">Mozilla Bug 822898</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="application/javascript;version=1.8">
/** Test for Bug 822898 - Pointer* Events **/
let tests = [], testTarget, parent;
function nextTest() {
if (tests.length)
SimpleTest.executeSoon(tests.shift());
}
function random() {
return Math.floor(Math.random() * 100);
}
function createTestEventValue(name) {
let detail = random();
let screenX = random();
let screenY = random();
let clientX = random();
let clientY = random();
let ctrlKey = random() % 2 ? true : false;
let altKey = random() % 2 ? true : false;
let shiftKey = random() % 2 ? true : false;
let metaKey = random() % 2 ? true : false;
let button = random();
let pointerId = random();
return function() {
let event = new PointerEvent("pointerdown", {
bubbles: true, cancelable: true, view: window,
detail: detail, screenX: screenX, screenY: screenY, clientX: clientX, clientY: clientY,
ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey, metaKey: metaKey,
button: button, relatedTarget: null, pointerId: pointerId
});
function check(ev) {
is(ev.detail, detail, "Correct detail");
is(ev.screenX, screenX, "Correct screenX");
is(ev.screenY, screenY, "Correct screenY");
is(ev.clientX, clientX, "Correct clientX");
is(ev.clientY, clientY, "Correct clientY");
is(ev.ctrlKey, ctrlKey, "Correct ctrlKey");
is(ev.altKey, altKey, "Correct altKey");
is(ev.shiftKey, shiftKey, "Correct shiftKey");
is(ev.metaKey, metaKey, "Correct metaKey");
is(ev.button, button, "Correct buttonArg");
is(ev.pointerId, pointerId, "Correct pointerId");
}
for each (let target in [document, window, testTarget, parent])
target.addEventListener(name, check, false);
testTarget.dispatchEvent(event);
for each (let target in [document, window, testTarget, parent])
target.removeEventListener(name, check, false);
nextTest();
}
}
function getDefaultArgEvent(eventname) {
return new PointerEvent(eventname, {
bubbles: true, cancelable: true, view: window,
detail: 0, screenX: 0, screenY: 0, clientX: 0, clientY: 0,
ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,
button: 0, relatedTarget: null, pointerId: 0
});
}
function testDefaultArg() {
let event = getDefaultArgEvent("pointerdown");
testTarget.addEventListener("pointerdown", function(ev) {
testTarget.removeEventListener("pointerdown", arguments.callee, false);
is(ev.pointerId, 0, "Correct default pointerId");
}, false);
testTarget.dispatchEvent(event);
nextTest();
}
function testStopPropagation() {
let event = getDefaultArgEvent("pointerdown");
let unreachableListener = function () {
ok(false, "Event should have been stopped");
}
// Capturing phase
let captured = false;
parent.addEventListener("pointerdown", function() {
parent.removeEventListener("pointerdown", arguments.callee, true);
captured = true;
}, true); // Capturing phase
// Bubbling phase
parent.addEventListener("pointerdown", unreachableListener, false);
testTarget.addEventListener("pointerdown", function(ev) {
testTarget.removeEventListener("pointerdown", arguments.callee, false);
is(captured, true, "Event should have been captured");
ev.stopPropagation();
}, false);
testTarget.dispatchEvent(event);
parent.removeEventListener("pointerdown", unreachableListener, false);
nextTest();
}
function testPreventDefault() {
let event = getDefaultArgEvent("pointerdown");
parent.addEventListener("pointerdown", function(ev) {
parent.removeEventListener("pointerdown", arguments.callee, false);
is(ev.defaultPrevented, true, "preventDefault can be called");
nextTest();
}, false);
testTarget.addEventListener("pointerdown", function(ev) {
testTarget.removeEventListener("pointerdown", arguments.callee, false);
ev.preventDefault();
}, false);
testTarget.dispatchEvent(event);
}
function testBlockPreventDefault() {
let event = new PointerEvent("pointerdown", {
bubbles: true, cancelable: false, view: window,
detail: 0, screenX: 0, screenY: 0, clientX: 0, clientY: 0,
ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,
button: 0, relatedTarget: null, pointerId: 0, pointerType: "pen"
});
parent.addEventListener("pointerdown", function(ev) {
parent.removeEventListener("pointerdown", arguments.callee, false);
is(ev.defaultPrevented, false, "aCancelableArg works");
nextTest();
}, false);
testTarget.addEventListener("pointerdown", function(ev) {
testTarget.removeEventListener("pointerdown", arguments.callee, false);
ev.preventDefault();
}, false);
testTarget.dispatchEvent(event);
}
function testBlockBubbling() {
let unreachableListener = function () {
ok(false, "aCanBubble doesn't work");
}
let event = new PointerEvent("pointerdown", {
bubbles: false, cancelable: true, view: window,
detail: 0, screenX: 0, screenY: 0, clientX: 0, clientY: 0,
ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,
button: 0, relatedTarget: null, pointerId: 0
});
parent.addEventListener("pointerdown", unreachableListener, false);
testTarget.dispatchEvent(event);
parent.removeEventListener("pointerdown", unreachableListener, false);
nextTest();
}
var gOnPointerPropHandled = new Array;
function testOnPointerProperty()
{
testTarget.onpointerdown = function (e) { gOnPointerPropHandled["pointerdown"] = true; }
testTarget.onpointerup = function (e) { gOnPointerPropHandled["pointerup"] = true; }
testTarget.onpointermove = function (e) { gOnPointerPropHandled["pointermove"] = true; }
testTarget.onpointerout = function (e) { gOnPointerPropHandled["pointerout"] = true; }
testTarget.onpointerover = function (e) { gOnPointerPropHandled["pointerover"] = true; }
testTarget.onpointerenter = function (e) { gOnPointerPropHandled["pointerenter"] = true; }
testTarget.onpointerleave = function (e) { gOnPointerPropHandled["pointerleave"] = true; }
testTarget.dispatchEvent(getDefaultArgEvent("pointerdown"));
ok(gOnPointerPropHandled['pointerdown'], "pointerdown property isn't performed");
testTarget.dispatchEvent(getDefaultArgEvent("pointerup"));
ok(gOnPointerPropHandled['pointerup'], "pointerup property isn't performed");
testTarget.dispatchEvent(getDefaultArgEvent("pointermove"));
ok(gOnPointerPropHandled['pointermove'], "pointermove property isn't performed");
testTarget.dispatchEvent(getDefaultArgEvent("pointerout"));
ok(gOnPointerPropHandled['pointerout'], "pointerout property isn't performed");
testTarget.dispatchEvent(getDefaultArgEvent("pointerover"));
ok(gOnPointerPropHandled['pointerover'], "pointerover property isn't performed");
testTarget.dispatchEvent(getDefaultArgEvent("pointerenter"));
ok(gOnPointerPropHandled['pointerenter'], "pointerenter property isn't performed");
testTarget.dispatchEvent(getDefaultArgEvent("pointerleave"));
ok(gOnPointerPropHandled['pointerleave'], "pointerleave property isn't performed");
nextTest();
}
function doTest() {
SpecialPowers.setBoolPref("dom.w3c_pointer_events.enabled", true); // Enable Pointer Events
testTarget = document.getElementById("testTarget");
parent = testTarget.parentNode;
tests.push(createTestEventValue("pointerdown"));
tests.push(createTestEventValue("pointermove"));
tests.push(createTestEventValue("pointerup"));
tests.push(testDefaultArg);
tests.push(testStopPropagation);
tests.push(testPreventDefault);
tests.push(testBlockPreventDefault);
tests.push(testBlockBubbling);
tests.push(testOnPointerProperty());
tests.push(function() {
SpecialPowers.clearUserPref("dom.w3c_pointer_events.enabled"); // Disable Pointer Events
SimpleTest.finish();
});
nextTest();
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(doTest);
</script>
</pre>
<div id="parent">
<span id="testTarget" style="border: 1px solid black;">testTarget</span>
</div>
</body>
</html>

View File

@ -724,82 +724,6 @@ while (testWheelProps.length) {
}
}
// PointerEvent
SpecialPowers.setBoolPref("dom.w3c_pointer_events.enabled", true); // Enable Pointer Events
try {
e = new PointerEvent();
} catch(exp) {
ex = true;
}
ok(ex, "PointerEvent: First parameter is required!");
ex = false;
e = new PointerEvent("hello");
ok(e.type, "hello", "PointerEvent: Wrong event type!");
ok(!e.isTrusted, "PointerEvent: Event shouldn't be trusted!");
ok(!e.bubbles, "PointerEvent: Event shouldn't bubble!");
ok(!e.cancelable, "PointerEvent: Event shouldn't be cancelable!");
document.dispatchEvent(e);
is(receivedEvent, e, "PointerEvent: Wrong event!");
var PointerEventProps =
[ { screenX: 0 },
{ screenY: 0 },
{ clientX: 0 },
{ clientY: 0 },
{ ctrlKey: false },
{ shiftKey: false },
{ altKey: false },
{ metaKey: false },
{ button: 0 },
{ buttons: 0 },
{ relatedTarget: null },
{ pointerId: 0 },
{ pointerType: "" }
];
var testPointerProps =
[
{ screenX: 1 },
{ screenY: 2 },
{ clientX: 3 },
{ clientY: 4 },
{ ctrlKey: true },
{ shiftKey: true },
{ altKey: true },
{ metaKey: true },
{ button: 5 },
{ buttons: 6 },
{ relatedTarget: window },
{ pointerId: 5 },
{ pointerType: "mouse" }
];
var defaultPointerEventValues = {};
for (var i = 0; i < PointerEventProps.length; ++i) {
for (prop in PointerEventProps[i]) {
ok(prop in e, "PointerEvent: PointerEvent doesn't have property " + prop + "!");
defaultPointerEventValues[prop] = PointerEventProps[i][prop];
}
}
while (testPointerProps.length) {
var p = testPointerProps.shift();
e = new PointerEvent("foo", p);
for (var def in defaultPointerEventValues) {
if (!(def in p)) {
is(e[def], defaultPointerEventValues[def],
"PointerEvent: Wrong default value for " + def + "!");
} else {
is(e[def], p[def], "PointerEvent: Wrong event init value for " + def + "!");
}
}
}
SpecialPowers.clearUserPref("dom.w3c_pointer_events.enabled"); // Disable Pointer Events
</script>
</pre>
</body>

View File

@ -7,7 +7,7 @@
#include "jspubtd.h"
%}
[scriptable, uuid(6c1fcf3d-119b-4cf4-9437-b9357508976a)]
[scriptable, uuid(22df6ed6-d094-4e45-97fc-a8eca11c390c)]
interface nsIInlineEventHandlers : nsISupports
{
[implicit_jscontext] attribute jsval onabort;
@ -71,17 +71,6 @@ interface nsIInlineEventHandlers : nsISupports
[implicit_jscontext] attribute jsval onwaiting;
[implicit_jscontext] attribute jsval onwheel;
[implicit_jscontext] attribute jsval onpointerdown;
[implicit_jscontext] attribute jsval onpointermove;
[implicit_jscontext] attribute jsval onpointerout;
[implicit_jscontext] attribute jsval onpointerover;
[implicit_jscontext] attribute jsval onpointerup;
[implicit_jscontext] attribute jsval onpointerenter;
[implicit_jscontext] attribute jsval onpointerleave;
[implicit_jscontext] attribute jsval ongotpointercapture;
[implicit_jscontext] attribute jsval onlostpointercapture;
[implicit_jscontext] attribute jsval onpointercancel;
/**
* Non-HTML5 event attributes
*/

View File

@ -372,11 +372,6 @@ NS_NewDOMAnimationEvent(nsIDOMEvent** aInstancePtrResult,
nsPresContext* aPresContext,
mozilla::InternalAnimationEvent* aEvent);
nsresult
NS_NewDOMPointerEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
mozilla::WidgetPointerEvent* aEvent);
nsresult
NS_NewDOMTouchEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,

View File

@ -403,7 +403,6 @@ var interfaceNamesInGlobalScope =
"PhoneNumberService",
"Plugin",
"PluginArray",
{name: "PointerEvent", pref: "dom.w3c_pointer_events.enabled"},
"PopStateEvent",
"PopupBlockedEvent",
"ProcessingInstruction",

View File

@ -88,22 +88,6 @@ interface GlobalEventHandlers {
attribute EventHandler onvolumechange;
attribute EventHandler onwaiting;
// Pointer events handlers
[Pref="dom.w3c_pointer_events.enabled"]
attribute EventHandler onpointerdown;
[Pref="dom.w3c_pointer_events.enabled"]
attribute EventHandler onpointerup;
[Pref="dom.w3c_pointer_events.enabled"]
attribute EventHandler onpointermove;
[Pref="dom.w3c_pointer_events.enabled"]
attribute EventHandler onpointerout;
[Pref="dom.w3c_pointer_events.enabled"]
attribute EventHandler onpointerover;
[Pref="dom.w3c_pointer_events.enabled"]
attribute EventHandler onpointerenter;
[Pref="dom.w3c_pointer_events.enabled"]
attribute EventHandler onpointerleave;
// Mozilla-specific handlers
attribute EventHandler onmozfullscreenchange;
attribute EventHandler onmozfullscreenerror;

View File

@ -1,37 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* For more information see nsIPointerEvent.idl.
*
* Portions Copyright 2013 Microsoft Open Technologies, Inc. */
interface WindowProxy;
[Pref="dom.w3c_pointer_events.enabled",
Constructor(DOMString type, optional PointerEventInit eventInitDict)]
interface PointerEvent : MouseEvent
{
readonly attribute long pointerId;
readonly attribute long width;
readonly attribute long height;
readonly attribute float pressure;
readonly attribute long tiltX;
readonly attribute long tiltY;
readonly attribute DOMString pointerType;
readonly attribute boolean isPrimary;
};
dictionary PointerEventInit : MouseEventInit
{
long pointerId = 0;
long width = 0;
long height = 0;
float pressure = 0;
long tiltX = 0;
long tiltY = 0;
DOMString pointerType = "";
boolean isPrimary = false;
};

View File

@ -256,7 +256,6 @@ WEBIDL_FILES = [
'PhoneNumberService.webidl',
'Plugin.webidl',
'PluginArray.webidl',
'PointerEvent.webidl',
'Position.webidl',
'PositionError.webidl',
'ProcessingInstruction.webidl',

View File

@ -1479,7 +1479,6 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(const WidgetEvent* aEvent,
aEvent->eventStructType != NS_WHEEL_EVENT &&
aEvent->eventStructType != NS_DRAG_EVENT &&
aEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT &&
aEvent->eventStructType != NS_POINTER_EVENT &&
aEvent->eventStructType != NS_GESTURENOTIFY_EVENT &&
aEvent->eventStructType != NS_TOUCH_EVENT &&
aEvent->eventStructType != NS_QUERY_CONTENT_EVENT))

View File

@ -4374,9 +4374,6 @@ pref("dom.mozPermissionSettings.enabled", false);
pref("dom.w3c_touch_events.enabled", 2);
#endif
// W3C draft pointer events
pref("dom.w3c_pointer_events.enabled", false);
// enable JS dump() function.
pref("browser.dom.window.dump.enabled", false);

View File

@ -41,7 +41,6 @@ enum nsEventStructType
NS_DRAG_EVENT, // WidgetDragEvent
NS_MOUSE_SCROLL_EVENT, // WidgetMouseScrollEvent
NS_WHEEL_EVENT, // WidgetWheelEvent
NS_POINTER_EVENT, // PointerEvent
// TouchEvents.h
NS_GESTURENOTIFY_EVENT, // WidgetGestureNotifyEvent
@ -136,19 +135,6 @@ enum nsEventStructType
#define NS_MOUSEENTER (NS_MOUSE_MESSAGE_START + 34)
#define NS_MOUSELEAVE (NS_MOUSE_MESSAGE_START + 35)
// Pointer spec events
#define NS_POINTER_EVENT_START 4400
#define NS_POINTER_MOVE (NS_POINTER_EVENT_START)
#define NS_POINTER_UP (NS_POINTER_EVENT_START + 1)
#define NS_POINTER_DOWN (NS_POINTER_EVENT_START + 2)
#define NS_POINTER_OVER (NS_POINTER_EVENT_START + 22)
#define NS_POINTER_OUT (NS_POINTER_EVENT_START + 23)
#define NS_POINTER_ENTER (NS_POINTER_EVENT_START + 24)
#define NS_POINTER_LEAVE (NS_POINTER_EVENT_START + 25)
#define NS_POINTER_CANCEL (NS_POINTER_EVENT_START + 26)
#define NS_POINTER_GOT_CAPTURE (NS_POINTER_EVENT_START + 27)
#define NS_POINTER_LOST_CAPTURE (NS_POINTER_EVENT_START + 28)
#define NS_CONTEXTMENU_MESSAGE_START 500
#define NS_CONTEXTMENU (NS_CONTEXTMENU_MESSAGE_START)

View File

@ -33,7 +33,6 @@ NS_EVENT_CLASS(Widget, MouseEvent)
NS_EVENT_CLASS(Widget, DragEvent)
NS_EVENT_CLASS(Widget, MouseScrollEvent)
NS_EVENT_CLASS(Widget, WheelEvent)
NS_EVENT_CLASS(Widget, PointerEvent)
// TouchEvents.h
NS_EVENT_CLASS(Widget, GestureNotifyEvent)

View File

@ -456,67 +456,6 @@ public:
}
};
/******************************************************************************
* mozilla::WidgetPointerEvent
******************************************************************************/
class WidgetPointerEvent : public WidgetMouseEvent
{
friend class mozilla::dom::PBrowserParent;
friend class mozilla::dom::PBrowserChild;
WidgetPointerEvent()
{
}
public:
virtual WidgetPointerEvent* AsPointerEvent() MOZ_OVERRIDE { return this; }
WidgetPointerEvent(bool aIsTrusted, uint32_t aMsg, nsIWidget* w)
: WidgetMouseEvent(aIsTrusted, aMsg, w, NS_POINTER_EVENT, eReal)
, pointerId(0)
, width(0)
, height(0)
, tiltX(0)
, tiltY(0)
, isPrimary(true)
{
}
WidgetPointerEvent(const WidgetMouseEvent& aEvent)
: WidgetMouseEvent(aEvent)
, pointerId(0)
, width(0)
, height(0)
, tiltX(0)
, tiltY(0)
, isPrimary(true)
{
eventStructType = NS_POINTER_EVENT;
}
WidgetPointerEvent(bool aIsTrusted, uint32_t aMsg, nsIWidget* w,
uint32_t aPointerId,
uint32_t aWidth, uint32_t aHeight,
uint32_t aTiltX, uint32_t aTiltY, bool aIsPrimary)
: WidgetMouseEvent(aIsTrusted, aMsg, w, NS_POINTER_EVENT, eReal)
, pointerId(aPointerId)
, width(aWidth)
, height(aHeight)
, tiltX(aTiltX)
, tiltY(aTiltY)
, isPrimary(aIsPrimary)
{
}
uint32_t pointerId;
uint32_t width;
uint32_t height;
uint32_t tiltX;
uint32_t tiltY;
bool isPrimary;
};
} // namespace mozilla
#endif // mozilla_MouseEvents_h__

View File

@ -206,36 +206,6 @@ struct ParamTraits<mozilla::WidgetMouseEvent>
}
};
template<>
struct ParamTraits<mozilla::WidgetPointerEvent>
{
typedef mozilla::WidgetPointerEvent paramType;
static void Write(Message* aMsg, const paramType& aParam)
{
WriteParam(aMsg, static_cast<mozilla::WidgetMouseEvent>(aParam));
WriteParam(aMsg, aParam.pointerId);
WriteParam(aMsg, aParam.width);
WriteParam(aMsg, aParam.height);
WriteParam(aMsg, aParam.tiltX);
WriteParam(aMsg, aParam.tiltY);
WriteParam(aMsg, aParam.isPrimary);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
{
bool rv =
ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEvent*>(aResult)) &&
ReadParam(aMsg, aIter, &aResult->pointerId) &&
ReadParam(aMsg, aIter, &aResult->width) &&
ReadParam(aMsg, aIter, &aResult->height) &&
ReadParam(aMsg, aIter, &aResult->tiltX) &&
ReadParam(aMsg, aIter, &aResult->tiltY) &&
ReadParam(aMsg, aIter, &aResult->isPrimary);
return rv;
}
};
template<>
struct ParamTraits<mozilla::WidgetTouchEvent>
{

View File

@ -216,7 +216,6 @@ WidgetEvent::IsAllowedToDispatchDOMEvent() const
{
switch (eventStructType) {
case NS_MOUSE_EVENT:
case NS_POINTER_EVENT:
// We want synthesized mouse moves to cause mouseover and mouseout
// DOM events (nsEventStateManager::PreHandleEvent), but not mousemove
// DOM events.