Bug 1688105 - Part 2: Get rid of dom.w3c_pointer_events.enabled; r=smaug

Depends on D102668

Differential Revision: https://phabricator.services.mozilla.com/D102669
This commit is contained in:
Edgar Chen 2021-01-25 16:22:44 +00:00
parent ca799a4ad8
commit 48c01f0a8b
67 changed files with 74 additions and 269 deletions

View File

@ -34,12 +34,6 @@ add_task(async function test_pointerevent() {
},
});
await extension.startup();
await new Promise(resolve => {
SpecialPowers.pushPrefEnv(
{ set: [["dom.w3c_pointer_events.enabled", true]] },
resolve
);
});
let url = await extension.awaitMessage("ready");
await BrowserTestUtils.withNewTab({ gBrowser, url }, async browser => {
await extension.awaitMessage("pageReady");

View File

@ -233,8 +233,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1363508
}
SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true],
["privacy.resistFingerprinting", true]]},
SpecialPowers.pushPrefEnv({"set": [["privacy.resistFingerprinting", true]]},
doTests);
});

View File

@ -52,10 +52,6 @@
{'type': 'popup', 'allow': DENY_ACTION,
'context': xorigin}
]);
await SpecialPowers.pushPrefEnv({
"set": [["dom.w3c_pointer_events.enabled", true]]
});
await new Promise(resolve => SimpleTest.waitForFocus(resolve));
});

View File

@ -1859,8 +1859,7 @@ void EventStateManager::MaybeFirePointerCancel(WidgetInputEvent* aEvent) {
RefPtr<PresShell> presShell = mPresContext->GetPresShell();
AutoWeakFrame targetFrame = mCurrentTarget;
if (!StaticPrefs::dom_w3c_pointer_events_enabled() || !presShell ||
!targetFrame) {
if (!presShell || !targetFrame) {
return;
}
@ -4528,9 +4527,6 @@ static LayoutDeviceIntPoint GetWindowClientRectCenter(nsIWidget* aWidget) {
void EventStateManager::GeneratePointerEnterExit(EventMessage aMessage,
WidgetMouseEvent* aEvent) {
if (!StaticPrefs::dom_w3c_pointer_events_enabled()) {
return;
}
WidgetPointerEvent pointerEvent(*aEvent);
pointerEvent.mMessage = aMessage;
GenerateMouseEnterExit(&pointerEvent);

View File

@ -63,14 +63,13 @@ void PointerEventHandler::ReleaseStatics() {
/* static */
bool PointerEventHandler::IsPointerEventImplicitCaptureForTouchEnabled() {
return StaticPrefs::dom_w3c_pointer_events_enabled() &&
StaticPrefs::dom_w3c_pointer_events_implicit_capture();
return StaticPrefs::dom_w3c_pointer_events_implicit_capture();
}
/* static */
void PointerEventHandler::UpdateActivePointerState(WidgetMouseEvent* aEvent,
nsIContent* aTargetContent) {
if (!StaticPrefs::dom_w3c_pointer_events_enabled() || !aEvent) {
if (!aEvent) {
return;
}
switch (aEvent->mMessage) {
@ -323,7 +322,6 @@ void PointerEventHandler::CheckPointerCaptureState(WidgetPointerEvent* aEvent) {
if (!aEvent) {
return;
}
MOZ_ASSERT(StaticPrefs::dom_w3c_pointer_events_enabled());
MOZ_ASSERT(aEvent->mClass == ePointerEventClass);
PointerCaptureInfo* captureInfo = GetPointerCaptureInfo(aEvent->pointerId);
@ -381,8 +379,7 @@ void PointerEventHandler::CheckPointerCaptureState(WidgetPointerEvent* aEvent) {
void PointerEventHandler::ImplicitlyCapturePointer(nsIFrame* aFrame,
WidgetEvent* aEvent) {
MOZ_ASSERT(aEvent->mMessage == ePointerDown);
if (!aFrame || !StaticPrefs::dom_w3c_pointer_events_enabled() ||
!IsPointerEventImplicitCaptureForTouchEnabled()) {
if (!aFrame || !IsPointerEventImplicitCaptureForTouchEnabled()) {
return;
}
WidgetPointerEvent* pointerEvent = aEvent->AsPointerEvent();
@ -426,8 +423,7 @@ Element* PointerEventHandler::GetPointerCapturingElement(uint32_t aPointerId) {
/* static */
Element* PointerEventHandler::GetPointerCapturingElement(
WidgetGUIEvent* aEvent) {
if (!StaticPrefs::dom_w3c_pointer_events_enabled() ||
(aEvent->mClass != ePointerEventClass &&
if ((aEvent->mClass != ePointerEventClass &&
aEvent->mClass != eMouseEventClass) ||
aEvent->mMessage == ePointerDown || aEvent->mMessage == eMouseDown) {
// Pointer capture should only be applied to all pointer events and mouse
@ -466,10 +462,10 @@ void PointerEventHandler::PreHandlePointerEventsPreventDefault(
!pointerInfo) {
// The PointerInfo for active pointer should be added for normal cases. But
// in some cases, we may receive mouse events before adding PointerInfo in
// sActivePointersIds. (e.g. receive mousemove before eMouseEnterIntoWidget
// or change preference 'dom.w3c_pointer_events.enabled' from off to on).
// In these cases, we could ignore them because they are not the events
// between a DefaultPrevented pointerdown and the corresponding pointerup.
// sActivePointersIds. (e.g. receive mousemove before
// eMouseEnterIntoWidget). In these cases, we could ignore them because they
// are not the events between a DefaultPrevented pointerdown and the
// corresponding pointerup.
return;
}
if (!pointerInfo->mPreventMouseEventByContent) {
@ -564,7 +560,6 @@ void PointerEventHandler::DispatchPointerFromMouseOrTouch(
PresShell* aShell, nsIFrame* aFrame, nsIContent* aContent,
WidgetGUIEvent* aEvent, bool aDontRetargetEvents, nsEventStatus* aStatus,
nsIContent** aTargetContent) {
MOZ_ASSERT(StaticPrefs::dom_w3c_pointer_events_enabled());
MOZ_ASSERT(aFrame || aContent);
MOZ_ASSERT(aEvent);

View File

@ -7,10 +7,7 @@ add_task(async function maxTouchPoints() {
await new Promise(resolve => {
SpecialPowers.pushPrefEnv(
{
set: [
["dom.w3c_pointer_events.enabled", true],
["dom.maxtouchpoints.testing.value", 5],
],
set: [["dom.maxtouchpoints.testing.value", 5]],
},
resolve
);

View File

@ -24,9 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1017086
function runTest() {
testelem = document.getElementById("test");
is(!!testelem, true, "Document should have element with id 'test'");
parent.turnOnOffPointerEvents( function() {
parent.part_of_checks(pointer_events, check, window, document, testelem);
});
parent.part_of_checks(pointer_events, check, window, document, testelem);
}
</script>
</head>

View File

@ -144,8 +144,6 @@ skip-if = debug #In order to be able to test touchmoves, the test needs to synth
support-files = test_bug1003432.js
[test_bug1013412.html]
skip-if = (verify && debug && (os == 'linux' || os == 'win'))
[test_bug1017086_disable.html]
support-files = bug1017086_inner.html
[test_bug1017086_enable.html]
support-files = bug1017086_inner.html
[test_bug1079236.html]

View File

@ -30,14 +30,10 @@ function setImplicitPointerCapture(capture, callback) {
}
function turnOnPointerEvents(callback) {
console.log("SET dom.w3c_pointer_events.enabled as TRUE");
console.log("SET layout.css.touch_action.enabled as TRUE");
SpecialPowers.pushPrefEnv(
{
set: [
["dom.w3c_pointer_events.enabled", true],
["layout.css.touch_action.enabled", true],
],
set: [["layout.css.touch_action.enabled", true]],
},
callback
);

View File

@ -44,9 +44,7 @@ function runTests() {
synthesizeMouseAtCenter(target1, { type: "mouseup" });
}
SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true]]}, runTests);
});
SimpleTest.waitForFocus(runTests);
</script>
</body>

View File

@ -127,7 +127,7 @@ function runTests() {
}
SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true], ["general.smoothScroll", false]]}, runTests);
SpecialPowers.pushPrefEnv({"set": [["general.smoothScroll", false]]}, runTests);
});
</script>

View File

@ -59,9 +59,7 @@ function runTests() {
iframe.contentWindow);
}
SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true]]}, runTests);
});
SimpleTest.waitForFocus(runTests);
</script>
</body>

View File

@ -84,9 +84,7 @@ function runTests() {
iframe.contentWindow);
}
SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true]]}, runTests);
});
SimpleTest.waitForFocus(runTests);
</script>
</body>

View File

@ -45,8 +45,7 @@ function withoutImplicitlyPointerCaptureForTouch() {
done.addEventListener("mouseup", () => {
ok(target0_events.length == 0, " should receive " + target0_events + " on target0");
ok(target1_events.length == 0, " should receive " + target1_events + " on target1");
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", true]]},
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.implicit_capture", true]]},
withImplicitlyPointerCaptureForTouch);
}, {once : true});
@ -82,8 +81,7 @@ function withImplicitlyPointerCaptureForTouch() {
}
SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", false]]},
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.implicit_capture", false]]},
withoutImplicitlyPointerCaptureForTouch);
});

View File

@ -93,8 +93,7 @@ function withoutImplicitlyPointerCaptureForTouch() {
}
SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", false]]},
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.implicit_capture", false]]},
withoutImplicitlyPointerCaptureForTouch);
});

View File

@ -110,8 +110,7 @@ function withoutImplicitlyPointerCaptureForTouch() {
}
SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", false]]},
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.implicit_capture", false]]},
withoutImplicitlyPointerCaptureForTouch);
});

View File

@ -103,8 +103,7 @@ function withoutImplicitlyPointerCaptureForTouch() {
}
SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", false]]},
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.implicit_capture", false]]},
withoutImplicitlyPointerCaptureForTouch);
});

View File

@ -83,8 +83,7 @@ function runTests() {
}
SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true],
["dom.event.coalesce_mouse_move", true]]}, runTests);
SpecialPowers.pushPrefEnv({"set": [["dom.event.coalesce_mouse_move", true]]}, runTests);
});
</script>

View File

@ -132,8 +132,7 @@ function WaitExpectedEvents(aListenEvents, aExpectedEvents, aEventGenerator) {
add_task(async function setup() {
await SimpleTest.promiseFocus();
await SpecialPowers.pushPrefEnv({
set: [["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", false]]
set: [["dom.w3c_pointer_events.implicit_capture", false]]
});
});

View File

@ -159,11 +159,7 @@ function startTest() {
SimpleTest.finish();
}
SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({
"set": [["dom.w3c_pointer_events.enabled", true]]
}, startTest);
});
SimpleTest.waitForFocus(startTest);
</script>
</body>

View File

@ -45,8 +45,7 @@ function startTest() {
SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({
"set": [
["full-screen-api.allow-trusted-requests-only", false],
["dom.w3c_pointer_events.enabled", true]
["full-screen-api.allow-trusted-requests-only", false]
]
}, startTest);
});

View File

@ -1,41 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1017086
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1017086</title>
<meta name="author" content="Maksim Lebedev" />
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="text/javascript">
/** Test for Bug 1017086 **/
var pointer_events_enabled = false;
function prepareTest() {
SimpleTest.waitForExplicitFinish();
turnOnOffPointerEvents(startTest);
}
function turnOnOffPointerEvents(callback) {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", pointer_events_enabled]
]
}, callback);
}
function startTest() {
var iframe = document.getElementById("testFrame");
iframe.src = "bug1017086_inner.html";
}
function part_of_checks(pointer_events, check, window, document, testelem) {
for(item in pointer_events) { check(false, pointer_events[item], window, "window"); }
for(item in pointer_events) { check(false, pointer_events[item], document, "document"); }
for(item in pointer_events) { check(false, pointer_events[item], testelem, "element"); }
SimpleTest.finish();
}
</script>
</head>
<body onload="prepareTest()">
<iframe id="testFrame" height="700" width="700"></iframe>
</body>
</html>

View File

@ -11,17 +11,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1017086
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="text/javascript">
/** Test for Bug 1017086 **/
var pointer_events_enabled = true;
function prepareTest() {
SimpleTest.waitForExplicitFinish();
turnOnOffPointerEvents(startTest);
}
function turnOnOffPointerEvents(callback) {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", pointer_events_enabled]
]
}, callback);
SimpleTest.executeSoon(startTest);
}
function startTest() {
var iframe = document.getElementById("testFrame");

View File

@ -15,8 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1447993
var win;
function start() {
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true],
["dom.w3c_touch_events.enabled", 1]]},
SpecialPowers.pushPrefEnv({"set": [["dom.w3c_touch_events.enabled", 1]]},
function() {
win = window.open("window_bug1447993.html", "testwindow",
"width=" + window.screen.width +

View File

@ -17,8 +17,7 @@
}
function init() {
SpecialPowers.pushPrefEnv(
{"set": [["dom.w3c_pointer_events.enabled", true],
["dom.maxtouchpoints.testing.value", 5]]}, runTest);
{"set": [["dom.maxtouchpoints.testing.value", 5]]}, runTest);
}
</script>
</head>

View File

@ -329,7 +329,7 @@ function runTests() {
}
window.onload = function() {
SpecialPowers.pushPrefEnv({"set":[["dom.w3c_pointer_events.enabled", true]]}, runTests);
SimpleTest.executeSoon(runTests);
}
SimpleTest.waitForExplicitFinish();

View File

@ -20,14 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=967796
/** Test for Bug 967796 **/
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(() => {
// Enable Pointer Events
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true]
]
}, runTests);
});
SimpleTest.waitForFocus(runTests);
var outer;
var middle;
var inner;

View File

@ -23,8 +23,7 @@ SpecialPowers.pushPrefEnv({"set": [
["device.sensors.orientation.enabled", false],
["device.sensors.motion.enabled", false],
["device.sensors.proximity.enabled", false],
["device.sensors.ambientLight.enabled", false],
["dom.w3c_pointer_events.enabled", false]
["device.sensors.ambientLight.enabled", false]
]}, () => {
is("DeviceProximityEvent" in window, false, "DeviceProximityEvent does not exist");
is("UserProximityEvent" in window, false, "UserProximityEvent does not exist");

View File

@ -37,8 +37,7 @@ void CoalescedMouseData::Coalesce(const WidgetMouseEvent& aEvent,
mCoalescedInputEvent->AssignPointerHelperData(aEvent);
}
if (aEvent.mMessage == eMouseMove &&
StaticPrefs::dom_w3c_pointer_events_enabled()) {
if (aEvent.mMessage == eMouseMove) {
// PointerEvent::getCoalescedEvents is only applied to pointermove events.
if (!mCoalescedInputEvent->mCoalescedWidgetEvents) {
mCoalescedInputEvent->mCoalescedWidgetEvents =

View File

@ -115,13 +115,10 @@ interface Element : Node {
boolean mozMatchesSelector(UTF8String selector);
// Pointer events methods.
[Throws, Pref="dom.w3c_pointer_events.enabled"]
[Throws]
void setPointerCapture(long pointerId);
[Throws, Pref="dom.w3c_pointer_events.enabled"]
[Throws]
void releasePointerCapture(long pointerId);
[Pref="dom.w3c_pointer_events.enabled"]
boolean hasPointerCapture(long pointerId);
// Proprietary extensions

View File

@ -99,25 +99,15 @@ interface mixin GlobalEventHandlers {
attribute EventHandler ontoggle;
// Pointer events handlers
[Pref="dom.w3c_pointer_events.enabled"]
attribute EventHandler onpointercancel;
[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;
[Pref="dom.w3c_pointer_events.enabled"]
attribute EventHandler ongotpointercapture;
[Pref="dom.w3c_pointer_events.enabled"]
attribute EventHandler onlostpointercapture;
// Mozilla-specific handlers. Unprefixed handlers live in

View File

@ -143,7 +143,7 @@ partial interface Navigator {
// http://www.w3.org/TR/pointerevents/#extensions-to-the-navigator-interface
partial interface Navigator {
[Pref="dom.w3c_pointer_events.enabled", NeedsCallerType]
[NeedsCallerType]
readonly attribute long maxTouchPoints;
};

View File

@ -9,8 +9,7 @@
interface WindowProxy;
[Pref="dom.w3c_pointer_events.enabled",
Exposed=Window]
[Exposed=Window]
interface PointerEvent : MouseEvent
{
constructor(DOMString type, optional PointerEventInit eventInitDict = {});

View File

@ -13,19 +13,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1285070
<script type="application/javascript">
let isWindows = navigator.platform.indexOf("Win") == 0;
let enablePE = ["dom.w3c_pointer_events.enabled", true];
var touch_action_prefs = getPrefs("TOUCH_ACTION");
var subtests = [
{"file": "helper_bug1285070.html", "prefs": [enablePE]},
{"file": "helper_bug1299195.html", "prefs": [enablePE]},
{"file": "helper_bug1414336.html", "prefs": [enablePE,
["apz.test.fails_with_native_injection", isWindows],
]},
{"file": "helper_bug1502010_unconsumed_pan.html", "prefs": [enablePE]},
{"file": "helper_bug1544966_zoom_on_touch_action_none.html", "prefs": [enablePE, ...touch_action_prefs]},
{"file": "helper_bug1648491_no_pointercancel_with_dtc.html", "prefs": [enablePE, ...touch_action_prefs]},
{"file": "helper_bug1663731_no_pointercancel_on_second_touchstart.html", "prefs": [enablePE, ...touch_action_prefs]},
{"file": "helper_bug1682170_pointercancel_on_touchaction_pinchzoom.html", "prefs": [enablePE, ...touch_action_prefs]},
{"file": "helper_bug1285070.html"},
{"file": "helper_bug1299195.html"},
{"file": "helper_bug1414336.html", "prefs": [["apz.test.fails_with_native_injection", isWindows]]},
{"file": "helper_bug1502010_unconsumed_pan.html"},
{"file": "helper_bug1544966_zoom_on_touch_action_none.html", "prefs": [...touch_action_prefs]},
{"file": "helper_bug1648491_no_pointercancel_with_dtc.html", "prefs": [...touch_action_prefs]},
{"file": "helper_bug1663731_no_pointercancel_on_second_touchstart.html", "prefs": [...touch_action_prefs]},
{"file": "helper_bug1682170_pointercancel_on_touchaction_pinchzoom.html", "prefs": [...touch_action_prefs]},
];
if (isApzEnabled()) {

View File

@ -392,13 +392,11 @@ void APZEventState::ProcessTouchEvent(
mFirstTouchCancelled = false;
}
APZES_LOG("Pointercancel if %d %d %d %d %d\n", sentContentResponse,
APZES_LOG("Pointercancel if %d %d %d %d\n", sentContentResponse,
!isTouchPrevented, aApzResponse == nsEventStatus_eConsumeDoDefault,
StaticPrefs::dom_w3c_pointer_events_enabled(),
MainThreadAgreesEventsAreConsumableByAPZ());
if (sentContentResponse && !isTouchPrevented &&
aApzResponse == nsEventStatus_eConsumeDoDefault &&
StaticPrefs::dom_w3c_pointer_events_enabled() &&
MainThreadAgreesEventsAreConsumableByAPZ()) {
WidgetTouchEvent cancelEvent(aEvent);
cancelEvent.mMessage = eTouchPointerCancel;

View File

@ -172,10 +172,6 @@ static bool HasPointerListener(nsIContent* aContent) {
return false;
}
if (!StaticPrefs::dom_w3c_pointer_events_enabled()) {
return false;
}
return elm->HasListenersFor(nsGkAtoms::onpointerdown) ||
elm->HasListenersFor(nsGkAtoms::onpointerup);
}

View File

@ -571,7 +571,6 @@ class MOZ_STACK_CLASS AutoPointerEventTargetUpdater final {
MOZ_ASSERT(!aFrame->GetContent() ||
aShell->GetDocument() == aFrame->GetContent()->OwnerDoc());
MOZ_ASSERT(StaticPrefs::dom_w3c_pointer_events_enabled());
mShell = aShell;
mWeakFrame = aFrame;
mTargetContent = aTargetContent;
@ -7243,10 +7242,6 @@ bool PresShell::EventHandler::DispatchPrecedingPointerEvent(
MOZ_ASSERT(aEventTargetData);
MOZ_ASSERT(aEventStatus);
if (!StaticPrefs::dom_w3c_pointer_events_enabled()) {
return true;
}
// Dispatch pointer events from the mouse or touch events. Regarding
// pointer events from mouse, we should dispatch those pointer events to
// the same target as the source mouse events. We pass the frame found

View File

@ -56,7 +56,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1078327
}
function prepareTest() {
parent.turnOnPointerEvents(executeTest);
SimpleTest.executeSoon(executeTest);
}
function executeTest()
{

View File

@ -47,7 +47,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1080360
}
function prepareTest() {
parent.turnOnPointerEvents(executeTest);
SimpleTest.executeSoon(executeTest);
}
function executeTest()
{

View File

@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1080361
<meta charset="utf-8">
<title>Test for Bug 1080361</title>
<meta name="author" content="Maksim Lebedev" />
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<style>
@ -71,7 +72,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1080361
}
function prepareTest() {
parent.turnOnPointerEvents(executeTest);
SimpleTest.executeSoon(executeTest);
}
function executeTest()
{
@ -89,7 +90,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1080361
finishTest();
}
function finishTest() {
setTimeout(function() {
SimpleTest.executeSoon(function() {
parent.is(test_target_down, true, "pointerdown event should be received by target");
parent.is(test_target_up, true, "pointerup event should be received by target");
parent.is(test_first_exc, true, "first exception should be thrown");
@ -99,7 +100,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1080361
parent.is(test_listener, true, "listener should receive gotpointercapture event");
logger("finishTest");
parent.finishTest();
}, 1000);
});
}
</script>
</head>

View File

@ -37,7 +37,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1153130
log.innerHTML = message + "<br>" + log.innerHTML;
}
function prepareTest() {
parent.turnOnPointerEvents(executeTest);
SimpleTest.executeSoon(executeTest);
}
function executeTest() {
logger("executeTest");

View File

@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1162990
<meta charset="utf-8">
<title>Test for Bug 1162990</title>
<meta name="author" content="Maksim Lebedev" />
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<style>
@ -76,7 +77,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1162990
}
function prepareTest() {
parent.turnOnPointerEvents(executeTest);
SimpleTest.executeSoon(executeTest);
}
function setEventHandlers() {

View File

@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1162990
<meta charset="utf-8">
<title>Test for Bug 1162990</title>
<meta name="author" content="Maksim Lebedev" />
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<style>
@ -76,7 +77,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1162990
}
function prepareTest() {
parent.turnOnPointerEvents(executeTest);
SimpleTest.executeSoon(executeTest);
}
function setEventHandlers() {

View File

@ -290,7 +290,6 @@ function finishTest() {
window.onload = function () {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", false]
]
}, runTests);

View File

@ -289,7 +289,6 @@ function finishTest() {
window.onload = function () {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", true]
]
}, runTests);

View File

@ -338,7 +338,6 @@ function finishTest() {
window.onload = function () {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", false]
]
}, runTests);

View File

@ -337,7 +337,6 @@ function finishTest() {
window.onload = function () {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", true]
]
}, runTests);

View File

@ -58,7 +58,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1098139
}
function prepareTest() {
parent.turnOnPointerEvents(executeTest);
SimpleTest.executeSoon(executeTest);
}
function executeTest()
{

View File

@ -39,7 +39,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=977003
}
function prepareTest() {
parent.turnOnPointerEvents(executeTest);
SimpleTest.executeSoon(executeTest);
}
function executeTest()
{

View File

@ -52,7 +52,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=977003
}
function prepareTest() {
parent.turnOnPointerEvents(executeTest);
SimpleTest.executeSoon(executeTest);
}
function executeTest()
{

View File

@ -55,7 +55,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=977003
}
function prepareTest() {
parent.turnOnPointerEvents(executeTest);
SimpleTest.executeSoon(executeTest);
}
function executeTest()
{

View File

@ -69,7 +69,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1098139
}
function prepareTest() {
parent.turnOnPointerEvents(executeTest);
SimpleTest.executeSoon(executeTest);
}
function executeTest()
{

View File

@ -58,7 +58,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1073563
}
function prepareTest() {
parent.turnOnPointerEvents(executeTest);
SimpleTest.executeSoon(executeTest);
}
function executeTest()
{

View File

@ -14,14 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1078327
function prepareTest() {
SimpleTest.waitForExplicitFinish();
iframe = document.getElementById("testFrame");
turnOnPointerEvents(startTest);
}
function turnOnPointerEvents(callback) {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true]
]
}, callback);
SimpleTest.executeSoon(startTest);
}
function startTest() {
iframe.src = "bug1078327_inner.html";

View File

@ -14,14 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1080360
function prepareTest() {
SimpleTest.waitForExplicitFinish();
iframe = document.getElementById("testFrame");
turnOnPointerEvents(startTest);
}
function turnOnPointerEvents(callback) {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true]
]
}, callback);
SimpleTest.executeSoon(startTest);
}
function startTest() {
iframe.src = "bug1080360_inner.html";

View File

@ -15,14 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1080361
SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("untriaged");
iframe = document.getElementById("testFrame");
turnOnPointerEvents(startTest);
}
function turnOnPointerEvents(callback) {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true]
]
}, callback);
SimpleTest.executeSoon(startTest);
}
function startTest() {
iframe.src = "bug1080361_inner.html";

View File

@ -14,14 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1153130
function prepareTest() {
SimpleTest.waitForExplicitFinish();
iframe = document.getElementById("testFrame");
turnOnPointerEvents(startTest);
}
function turnOnPointerEvents(callback) {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true]
]
}, callback);
SimpleTest.executeSoon(startTest);
}
function startTest() {
iframe.src = "bug1153130_inner.html";

View File

@ -15,14 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1162990
function prepareTest() {
SimpleTest.waitForExplicitFinish();
iframe = document.getElementById("testFrame");
turnOnPointerEvents(finishTest);
}
function turnOnPointerEvents(callback) {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true]
]
}, callback);
SimpleTest.executeSoon(finishTest);
}
function finishTest() {
// Try to run several tests named as bug1162990_inner_<number>.html

View File

@ -26,7 +26,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=968148
} else if (event.data == "run next") {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", true]
]
}, testWithImplicitPointerCapture);
@ -35,7 +34,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=968148
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", false]
]
}, testWithoutImplicitPointerCapture);

View File

@ -26,7 +26,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=970964
} else if (event.data == "run next") {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", true]
]
}, testWithImplicitPointerCapture);
@ -35,7 +34,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=970964
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true],
["dom.w3c_pointer_events.implicit_capture", false]
]
}, testWithoutImplicitPointerCapture);

View File

@ -15,14 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=977003
function prepareTest() {
SimpleTest.waitForExplicitFinish();
iframe = document.getElementById("testFrame");
turnOnPointerEvents(finishTest);
}
function turnOnPointerEvents(callback) {
SpecialPowers.pushPrefEnv({
"set": [
["dom.w3c_pointer_events.enabled", true]
]
}, callback);
SimpleTest.executeSoon(finishTest);
}
function finishTest() {
// Try to run several tests named as bug977003_inner_<number>.html

View File

@ -497,8 +497,6 @@ function createBrowser() {
browser.setAttribute("primary", "true");
browser.setAttribute("flex", "1");
browser.setAttribute("maychangeremoteness", "true");
Services.prefs.setBoolPref("dom.w3c_pointer_events.enabled", true);
browser.setAttribute("remote", "true");
browser.setAttribute("remoteType", E10SUtils.DEFAULT_REMOTE_TYPE);

View File

@ -3289,12 +3289,6 @@
value: false
mirror: always
# W3C draft pointer events
- name: dom.w3c_pointer_events.enabled
type: RelaxedAtomicBool
value: @IS_NOT_ANDROID@
mirror: always
#ifdef XP_WIN
# Control firing WidgetMouseEvent by handling Windows pointer messages or
# mouse messages.

View File

@ -899,8 +899,7 @@ void nsBaseWidget::ConfigureAPZCTreeManager() {
// When APZ is enabled, we can actually enable raw touch events because we
// have code that can deal with them properly. If APZ is not enabled, this
// function doesn't get called.
if (StaticPrefs::dom_w3c_touch_events_enabled() ||
StaticPrefs::dom_w3c_pointer_events_enabled()) {
if (StaticPrefs::dom_w3c_touch_events_enabled()) {
RegisterTouchWindow();
}
}

View File

@ -736,7 +736,6 @@ function init() {
SpecialPowers.pushPrefEnv({"set": [["middlemouse.contentLoadURL", false],
["middlemouse.paste", false],
["general.autoScroll", false],
["dom.w3c_pointer_events.enabled", true],
["mousewheel.default.action", 0],
["mousewheel.default.action.override_x", -1],
["mousewheel.with_shift.action", 0],

View File

@ -61,7 +61,7 @@ bool WinPointerEvents::ShouldHandleWinPointerMessages(UINT aMsg,
WPARAM aWParam) {
MOZ_ASSERT(aMsg == WM_POINTERDOWN || aMsg == WM_POINTERUP ||
aMsg == WM_POINTERUPDATE || aMsg == WM_POINTERLEAVE);
if (!sLibraryHandle || !StaticPrefs::dom_w3c_pointer_events_enabled()) {
if (!sLibraryHandle) {
return false;
}
@ -123,13 +123,13 @@ bool WinPointerEvents::ShouldRollupOnPointerEvent(UINT aMsg, WPARAM aWParam) {
}
bool WinPointerEvents::ShouldFirePointerEventByWinPointerMessages() {
MOZ_ASSERT(sLibraryHandle && StaticPrefs::dom_w3c_pointer_events_enabled());
MOZ_ASSERT(sLibraryHandle);
return StaticPrefs::dom_w3c_pointer_events_dispatch_by_pointer_messages();
}
WinPointerInfo* WinPointerEvents::GetCachedPointerInfo(UINT aMsg,
WPARAM aWParam) {
if (!sLibraryHandle || !StaticPrefs::dom_w3c_pointer_events_enabled() ||
if (!sLibraryHandle ||
MOUSE_INPUT_SOURCE() != dom::MouseEvent_Binding::MOZ_SOURCE_PEN ||
ShouldFirePointerEventByWinPointerMessages()) {
return nullptr;

View File

@ -4528,8 +4528,7 @@ bool nsWindow::DispatchMouseEvent(EventMessage aEventMessage, WPARAM wParam,
// Messages should be only at topLevel window.
&& nsWindowType::eWindowType_toplevel == mWindowType
// Currently this scheme is used only when pointer events is enabled.
&& StaticPrefs::dom_w3c_pointer_events_enabled() &&
InkCollector::sInkCollector) {
&& InkCollector::sInkCollector) {
InkCollector::sInkCollector->SetTarget(mWnd);
InkCollector::sInkCollector->SetPointerId(pointerId);
}