Bug 1934246 - Get rid of dom.popup.experimental; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D242688
This commit is contained in:
@@ -116,10 +116,8 @@ void nsCoreUtils::DispatchClickEvent(XULTreeElement* aTree, int32_t aRowIndex,
|
|||||||
int32_t cnvdY = presContext->CSSPixelsToDevPixels(tcY + int32_t(rect.y) + 1) +
|
int32_t cnvdY = presContext->CSSPixelsToDevPixels(tcY + int32_t(rect.y) + 1) +
|
||||||
presContext->AppUnitsToDevPixels(offset.y);
|
presContext->AppUnitsToDevPixels(offset.y);
|
||||||
|
|
||||||
if (StaticPrefs::dom_popup_experimental()) {
|
// This isn't needed once bug 1924790 is fixed.
|
||||||
// This isn't needed once bug 1924790 is fixed.
|
tcElm->OwnerDoc()->NotifyUserGestureActivation();
|
||||||
tcElm->OwnerDoc()->NotifyUserGestureActivation();
|
|
||||||
}
|
|
||||||
|
|
||||||
// XUL is just desktop, so there is no real reason for senfing touch events.
|
// XUL is just desktop, so there is no real reason for senfing touch events.
|
||||||
DispatchMouseEvent(eMouseDown, cnvdX, cnvdY, tcElm, tcFrame, presShell,
|
DispatchMouseEvent(eMouseDown, cnvdX, cnvdY, tcElm, tcFrame, presShell,
|
||||||
|
|||||||
@@ -2573,10 +2573,9 @@ void LocalAccessible::DispatchClickEvent(uint32_t aActionIndex) const {
|
|||||||
nsCoreUtils::DispatchTouchEvent(eTouchStart, x, y, mContent, frame, presShell,
|
nsCoreUtils::DispatchTouchEvent(eTouchStart, x, y, mContent, frame, presShell,
|
||||||
widget);
|
widget);
|
||||||
|
|
||||||
if (StaticPrefs::dom_popup_experimental()) {
|
// This isn't needed once bug 1924790 is fixed.
|
||||||
// This isn't needed once bug 1924790 is fixed.
|
mContent->OwnerDoc()->NotifyUserGestureActivation();
|
||||||
mContent->OwnerDoc()->NotifyUserGestureActivation();
|
|
||||||
}
|
|
||||||
nsCoreUtils::DispatchMouseEvent(eMouseDown, x, y, mContent, frame, presShell,
|
nsCoreUtils::DispatchMouseEvent(eMouseDown, x, y, mContent, frame, presShell,
|
||||||
widget);
|
widget);
|
||||||
nsCoreUtils::DispatchTouchEvent(eTouchEnd, x, y, mContent, frame, presShell,
|
nsCoreUtils::DispatchTouchEvent(eTouchEnd, x, y, mContent, frame, presShell,
|
||||||
|
|||||||
@@ -2284,8 +2284,8 @@ PopupBlocker::PopupControlState BrowsingContext::RevisePopupAbuseLevel(
|
|||||||
case PopupBlocker::openAllowed:
|
case PopupBlocker::openAllowed:
|
||||||
break;
|
break;
|
||||||
case PopupBlocker::openBlocked:
|
case PopupBlocker::openBlocked:
|
||||||
if (IsPopupAllowed() || (StaticPrefs::dom_popup_experimental() && doc &&
|
if (IsPopupAllowed() ||
|
||||||
doc->HasValidTransientUserGestureActivation())) {
|
(doc && doc->HasValidTransientUserGestureActivation())) {
|
||||||
// Go down one state enum step:
|
// Go down one state enum step:
|
||||||
// openBlocked (2) -> openControlled (1)
|
// openBlocked (2) -> openControlled (1)
|
||||||
abuse = PopupBlocker::openControlled;
|
abuse = PopupBlocker::openControlled;
|
||||||
|
|||||||
@@ -11,8 +11,6 @@
|
|||||||
<div id="target" style="width: 50px; height: 50px; background: green"></div>
|
<div id="target" style="width: 50px; height: 50px; background: green"></div>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
var experimental = false;
|
|
||||||
|
|
||||||
function sendMouseEvent(element, eventName, button, listenEventName, handler) {
|
function sendMouseEvent(element, eventName, button, listenEventName, handler) {
|
||||||
let needToCheckHandler = false;
|
let needToCheckHandler = false;
|
||||||
let handlerIsCalled = false;
|
let handlerIsCalled = false;
|
||||||
@@ -61,31 +59,7 @@ const MIDDLE_BUTTON = 1;
|
|||||||
const RIGHT_BUTTON = 2;
|
const RIGHT_BUTTON = 2;
|
||||||
let target = document.getElementById("target");
|
let target = document.getElementById("target");
|
||||||
|
|
||||||
async function beginTest() {
|
|
||||||
if (!experimental) {
|
|
||||||
info("NOT EXPERIMENTAL");
|
|
||||||
await SpecialPowers.pushPrefEnv({
|
|
||||||
set: [
|
|
||||||
["dom.popup.experimental", false]
|
|
||||||
],
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
info("EXPERIMENTAL");
|
|
||||||
await SpecialPowers.pushPrefEnv({
|
|
||||||
set: [
|
|
||||||
["dom.popup.experimental", true],
|
|
||||||
],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function endTest() {
|
|
||||||
await SpecialPowers.popPrefEnv();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function testMouseDownUpMove() {
|
async function testMouseDownUpMove() {
|
||||||
await beginTest();
|
|
||||||
|
|
||||||
// Left button
|
// Left button
|
||||||
sendMouseEvent(target, "mousedown", LEFT_BUTTON, "mousedown", checkAllowOpenPopup);
|
sendMouseEvent(target, "mousedown", LEFT_BUTTON, "mousedown", checkAllowOpenPopup);
|
||||||
sendMouseEvent(target, "mousemove", LEFT_BUTTON, "mousemove", checkBlockOpenPopup);
|
sendMouseEvent(target, "mousemove", LEFT_BUTTON, "mousemove", checkBlockOpenPopup);
|
||||||
@@ -97,28 +71,18 @@ async function testMouseDownUpMove() {
|
|||||||
sendMouseEvent(target, "mouseup", MIDDLE_BUTTON, "mouseup", checkBlockOpenPopup);
|
sendMouseEvent(target, "mouseup", MIDDLE_BUTTON, "mouseup", checkBlockOpenPopup);
|
||||||
|
|
||||||
// Right button
|
// Right button
|
||||||
sendMouseEvent(target, "mousedown", RIGHT_BUTTON, "mousedown", experimental ?
|
sendMouseEvent(target, "mousedown", RIGHT_BUTTON, "mousedown", checkAllowOpenPopup);
|
||||||
checkAllowOpenPopup :
|
|
||||||
checkBlockOpenPopup);
|
|
||||||
sendMouseEvent(target, "mousemove", RIGHT_BUTTON, "mousemove", checkBlockOpenPopup);
|
sendMouseEvent(target, "mousemove", RIGHT_BUTTON, "mousemove", checkBlockOpenPopup);
|
||||||
sendMouseEvent(target, "mouseup", RIGHT_BUTTON, "mouseup", checkBlockOpenPopup);
|
sendMouseEvent(target, "mouseup", RIGHT_BUTTON, "mouseup", checkBlockOpenPopup);
|
||||||
|
|
||||||
await endTest();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function testMouseClick() {
|
async function testMouseClick() {
|
||||||
await beginTest();
|
|
||||||
|
|
||||||
// Left button
|
// Left button
|
||||||
sendMouseEvent(target, "mousedown", LEFT_BUTTON);
|
sendMouseEvent(target, "mousedown", LEFT_BUTTON);
|
||||||
sendMouseEvent(target, "mouseup", LEFT_BUTTON, "click", checkAllowOpenPopup);
|
sendMouseEvent(target, "mouseup", LEFT_BUTTON, "click", checkAllowOpenPopup);
|
||||||
|
|
||||||
await endTest();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function testMouseAuxclick() {
|
async function testMouseAuxclick() {
|
||||||
await beginTest();
|
|
||||||
|
|
||||||
// Middle button
|
// Middle button
|
||||||
sendMouseEvent(target, "mousedown", MIDDLE_BUTTON);
|
sendMouseEvent(target, "mousedown", MIDDLE_BUTTON);
|
||||||
sendMouseEvent(target, "mouseup", MIDDLE_BUTTON, "auxclick", checkAllowOpenPopup);
|
sendMouseEvent(target, "mouseup", MIDDLE_BUTTON, "auxclick", checkAllowOpenPopup);
|
||||||
@@ -126,20 +90,12 @@ async function testMouseAuxclick() {
|
|||||||
// Right button
|
// Right button
|
||||||
sendMouseEvent(target, "mousedown", RIGHT_BUTTON);
|
sendMouseEvent(target, "mousedown", RIGHT_BUTTON);
|
||||||
sendMouseEvent(target, "mouseup", RIGHT_BUTTON, "auxclick", checkAllowOpenPopup);
|
sendMouseEvent(target, "mouseup", RIGHT_BUTTON, "auxclick", checkAllowOpenPopup);
|
||||||
|
|
||||||
await endTest();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
add_task(testMouseDownUpMove);
|
add_task(testMouseDownUpMove);
|
||||||
add_task(testMouseClick);
|
add_task(testMouseClick);
|
||||||
add_task(testMouseAuxclick);
|
add_task(testMouseAuxclick);
|
||||||
|
|
||||||
add_task(() => experimental = true);
|
|
||||||
|
|
||||||
add_task(testMouseDownUpMove);
|
|
||||||
add_task(testMouseClick);
|
|
||||||
add_task(testMouseAuxclick);
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -11,8 +11,6 @@
|
|||||||
<div id="target" style="width: 50px; height: 50px; background: green"></div>
|
<div id="target" style="width: 50px; height: 50px; background: green"></div>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
let experimental = false;
|
|
||||||
|
|
||||||
function sendMouseEvent(element, eventName, button, listenEventName, handler) {
|
function sendMouseEvent(element, eventName, button, listenEventName, handler) {
|
||||||
let needToCheckHandler = false;
|
let needToCheckHandler = false;
|
||||||
let handlerIsCalled = false;
|
let handlerIsCalled = false;
|
||||||
@@ -62,132 +60,69 @@
|
|||||||
const RIGHT_BUTTON = 2;
|
const RIGHT_BUTTON = 2;
|
||||||
let target = document.getElementById("target");
|
let target = document.getElementById("target");
|
||||||
|
|
||||||
async function beginTest() {
|
|
||||||
if (!experimental) {
|
|
||||||
info("NOT EXPERIMENTAL");
|
|
||||||
await SpecialPowers.pushPrefEnv({
|
|
||||||
set: [
|
|
||||||
["dom.popup.experimental", false]
|
|
||||||
],
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
info("EXPERIMENTAL");
|
|
||||||
// This is a rather fragile test when experimental pref isn't enabled.
|
|
||||||
// Use default prefs in experimental case.
|
|
||||||
SpecialPowers.wrap(document).clearUserGestureActivation();
|
|
||||||
await SpecialPowers.pushPrefEnv({
|
|
||||||
set: [
|
|
||||||
["dom.popup.experimental", true],
|
|
||||||
// Enable popup blocker
|
|
||||||
["dom.disable_open_during_load", true],
|
|
||||||
],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function endTest() {
|
|
||||||
await SpecialPowers.popPrefEnv();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function testPointerEventDefault() {
|
async function testPointerEventDefault() {
|
||||||
await beginTest();
|
|
||||||
|
|
||||||
// By default, only allow opening popup in the pointerup listener.
|
// By default, only allow opening popup in the pointerup listener.
|
||||||
// Left button
|
// Left button
|
||||||
sendMouseEvent(target, "mousedown", LEFT_BUTTON, "pointerdown", checkAllowOpenPopup);
|
sendMouseEvent(target, "mousedown", LEFT_BUTTON, "pointerdown", checkAllowOpenPopup);
|
||||||
sendMouseEvent(target, "mousemove", LEFT_BUTTON, "pointermove", checkBlockOpenPopup);
|
sendMouseEvent(target, "mousemove", LEFT_BUTTON, "pointermove", checkBlockOpenPopup);
|
||||||
sendMouseEvent(target, "mouseup", LEFT_BUTTON, "pointerup", experimental ?
|
sendMouseEvent(target, "mouseup", LEFT_BUTTON, "pointerup", checkBlockOpenPopup);
|
||||||
checkBlockOpenPopup :
|
|
||||||
checkAllowOpenPopup);
|
|
||||||
|
|
||||||
// Middle button
|
// Middle button
|
||||||
sendMouseEvent(target, "mousedown", MIDDLE_BUTTON, "pointerdown", checkAllowOpenPopup);
|
sendMouseEvent(target, "mousedown", MIDDLE_BUTTON, "pointerdown", checkAllowOpenPopup);
|
||||||
sendMouseEvent(target, "mousemove", MIDDLE_BUTTON, "pointermove", checkBlockOpenPopup);
|
sendMouseEvent(target, "mousemove", MIDDLE_BUTTON, "pointermove", checkBlockOpenPopup);
|
||||||
sendMouseEvent(target, "mouseup", MIDDLE_BUTTON, "pointerup", experimental ?
|
sendMouseEvent(target, "mouseup", MIDDLE_BUTTON, "pointerup", checkBlockOpenPopup);
|
||||||
checkBlockOpenPopup :
|
|
||||||
checkAllowOpenPopup);
|
|
||||||
|
|
||||||
// Right button
|
// Right button
|
||||||
sendMouseEvent(target, "mousedown", RIGHT_BUTTON, "pointerdown", experimental ?
|
sendMouseEvent(target, "mousedown", RIGHT_BUTTON, "pointerdown", checkAllowOpenPopup);
|
||||||
checkAllowOpenPopup :
|
|
||||||
checkBlockOpenPopup);
|
|
||||||
sendMouseEvent(target, "mousemove", RIGHT_BUTTON, "pointermove", checkBlockOpenPopup);
|
sendMouseEvent(target, "mousemove", RIGHT_BUTTON, "pointermove", checkBlockOpenPopup);
|
||||||
sendMouseEvent(target, "mouseup", RIGHT_BUTTON, "pointerup", checkBlockOpenPopup);
|
sendMouseEvent(target, "mouseup", RIGHT_BUTTON, "pointerup", checkBlockOpenPopup);
|
||||||
|
|
||||||
await endTest();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
async function testPointerEventAddPointerDownToPref() {
|
async function testPointerEventAddPointerDownToPref() {
|
||||||
await beginTest();
|
|
||||||
|
|
||||||
// Adding pointerdown to preference
|
// Adding pointerdown to preference
|
||||||
await SpecialPowers.pushPrefEnv({"set": [["dom.popup_allowed_events",
|
await SpecialPowers.pushPrefEnv({"set": [["dom.popup_allowed_events",
|
||||||
"pointerdown pointerup"]]});
|
"pointerdown pointerup"]]});
|
||||||
// Left button
|
// Left button
|
||||||
sendMouseEvent(target, "mousedown", LEFT_BUTTON, "pointerdown", checkAllowOpenPopup);
|
sendMouseEvent(target, "mousedown", LEFT_BUTTON, "pointerdown", checkAllowOpenPopup);
|
||||||
sendMouseEvent(target, "mousemove", LEFT_BUTTON, "pointermove", checkBlockOpenPopup);
|
sendMouseEvent(target, "mousemove", LEFT_BUTTON, "pointermove", checkBlockOpenPopup);
|
||||||
sendMouseEvent(target, "mouseup", LEFT_BUTTON, "pointerup", experimental ?
|
sendMouseEvent(target, "mouseup", LEFT_BUTTON, "pointerup", checkBlockOpenPopup);
|
||||||
checkBlockOpenPopup :
|
|
||||||
checkAllowOpenPopup);
|
|
||||||
|
|
||||||
// Middle button
|
// Middle button
|
||||||
sendMouseEvent(target, "mousedown", MIDDLE_BUTTON, "pointerdown", checkAllowOpenPopup);
|
sendMouseEvent(target, "mousedown", MIDDLE_BUTTON, "pointerdown", checkAllowOpenPopup);
|
||||||
sendMouseEvent(target, "mousemove", MIDDLE_BUTTON, "pointermove", checkBlockOpenPopup);
|
sendMouseEvent(target, "mousemove", MIDDLE_BUTTON, "pointermove", checkBlockOpenPopup);
|
||||||
sendMouseEvent(target, "mouseup", MIDDLE_BUTTON, "pointerup", experimental ?
|
sendMouseEvent(target, "mouseup", MIDDLE_BUTTON, "pointerup", checkBlockOpenPopup);
|
||||||
checkBlockOpenPopup :
|
|
||||||
checkAllowOpenPopup);
|
|
||||||
|
|
||||||
// Right button
|
// Right button
|
||||||
sendMouseEvent(target, "mousedown", RIGHT_BUTTON, "pointerdown", experimental ?
|
sendMouseEvent(target, "mousedown", RIGHT_BUTTON, "pointerdown", checkAllowOpenPopup);
|
||||||
checkAllowOpenPopup :
|
|
||||||
checkBlockOpenPopup);
|
|
||||||
sendMouseEvent(target, "mousemove", RIGHT_BUTTON, "pointermove", checkBlockOpenPopup);
|
sendMouseEvent(target, "mousemove", RIGHT_BUTTON, "pointermove", checkBlockOpenPopup);
|
||||||
sendMouseEvent(target, "mouseup", RIGHT_BUTTON, "pointerup", checkBlockOpenPopup);
|
sendMouseEvent(target, "mouseup", RIGHT_BUTTON, "pointerup", checkBlockOpenPopup);
|
||||||
await SpecialPowers.popPrefEnv();
|
await SpecialPowers.popPrefEnv();
|
||||||
|
|
||||||
await endTest();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function testPointerEventAddPointerMoveToPref() {
|
async function testPointerEventAddPointerMoveToPref() {
|
||||||
await beginTest();
|
|
||||||
|
|
||||||
// Adding pointermove to preference should have no effect.
|
// Adding pointermove to preference should have no effect.
|
||||||
await SpecialPowers.pushPrefEnv({"set": [["dom.popup_allowed_events",
|
await SpecialPowers.pushPrefEnv({"set": [["dom.popup_allowed_events",
|
||||||
"pointerdown pointerup pointermove"]]});
|
"pointerdown pointerup pointermove"]]});
|
||||||
// Left button
|
// Left button
|
||||||
sendMouseEvent(target, "mousedown", LEFT_BUTTON, "pointerdown", checkAllowOpenPopup);
|
sendMouseEvent(target, "mousedown", LEFT_BUTTON, "pointerdown", checkAllowOpenPopup);
|
||||||
sendMouseEvent(target, "mousemove", LEFT_BUTTON, "pointermove", checkBlockOpenPopup);
|
sendMouseEvent(target, "mousemove", LEFT_BUTTON, "pointermove", checkBlockOpenPopup);
|
||||||
sendMouseEvent(target, "mouseup", LEFT_BUTTON, "pointerup", experimental ?
|
sendMouseEvent(target, "mouseup", LEFT_BUTTON, "pointerup", checkBlockOpenPopup);
|
||||||
checkBlockOpenPopup :
|
|
||||||
checkAllowOpenPopup);
|
|
||||||
|
|
||||||
// Middle button
|
// Middle button
|
||||||
sendMouseEvent(target, "mousedown", MIDDLE_BUTTON, "pointerdown", checkAllowOpenPopup);
|
sendMouseEvent(target, "mousedown", MIDDLE_BUTTON, "pointerdown", checkAllowOpenPopup);
|
||||||
sendMouseEvent(target, "mousemove", MIDDLE_BUTTON, "pointermove", checkBlockOpenPopup);
|
sendMouseEvent(target, "mousemove", MIDDLE_BUTTON, "pointermove", checkBlockOpenPopup);
|
||||||
sendMouseEvent(target, "mouseup", MIDDLE_BUTTON, "pointerup", experimental ?
|
sendMouseEvent(target, "mouseup", MIDDLE_BUTTON, "pointerup", checkBlockOpenPopup);
|
||||||
checkBlockOpenPopup :
|
|
||||||
checkAllowOpenPopup);
|
|
||||||
|
|
||||||
// Right button
|
// Right button
|
||||||
sendMouseEvent(target, "mousedown", RIGHT_BUTTON, "pointerdown", experimental ?
|
sendMouseEvent(target, "mousedown", RIGHT_BUTTON, "pointerdown", checkAllowOpenPopup);
|
||||||
checkAllowOpenPopup :
|
|
||||||
checkBlockOpenPopup);
|
|
||||||
sendMouseEvent(target, "mousemove", RIGHT_BUTTON, "pointermove", checkBlockOpenPopup);
|
sendMouseEvent(target, "mousemove", RIGHT_BUTTON, "pointermove", checkBlockOpenPopup);
|
||||||
sendMouseEvent(target, "mouseup", RIGHT_BUTTON, "pointerup", checkBlockOpenPopup);
|
sendMouseEvent(target, "mouseup", RIGHT_BUTTON, "pointerup", checkBlockOpenPopup);
|
||||||
await SpecialPowers.popPrefEnv();
|
await SpecialPowers.popPrefEnv();
|
||||||
|
|
||||||
await endTest();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
add_task(testPointerEventDefault);
|
add_task(testPointerEventDefault);
|
||||||
add_task(testPointerEventAddPointerDownToPref);
|
add_task(testPointerEventAddPointerDownToPref);
|
||||||
add_task(testPointerEventAddPointerMoveToPref);
|
add_task(testPointerEventAddPointerMoveToPref);
|
||||||
|
|
||||||
add_task(() => experimental = true);
|
|
||||||
|
|
||||||
add_task(testPointerEventDefault);
|
|
||||||
add_task(testPointerEventAddPointerDownToPref);
|
|
||||||
add_task(testPointerEventAddPointerMoveToPref);
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -26,9 +26,6 @@ add_setup(async function() {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
await new Promise(resolve => SimpleTest.waitForFocus(resolve));
|
await new Promise(resolve => SimpleTest.waitForFocus(resolve));
|
||||||
|
|
||||||
// Set popup preferences.
|
|
||||||
await SpecialPowers.pushPrefEnv({ set: [["dom.popup.experimental", true]] });
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const LEFT_BUTTON = 0;
|
const LEFT_BUTTON = 0;
|
||||||
|
|||||||
@@ -1052,9 +1052,6 @@ nsresult EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
|||||||
SetClickCount(mouseEvent, aStatus);
|
SetClickCount(mouseEvent, aStatus);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!StaticPrefs::dom_popup_experimental()) {
|
|
||||||
NotifyTargetUserActivation(aEvent, aTargetContent);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eMouseUp: {
|
case eMouseUp: {
|
||||||
@@ -1137,14 +1134,8 @@ nsresult EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
|||||||
PointerEventHandler::UpdateActivePointerState(mouseEvent,
|
PointerEventHandler::UpdateActivePointerState(mouseEvent,
|
||||||
aTargetContent);
|
aTargetContent);
|
||||||
PointerEventHandler::ImplicitlyCapturePointer(aTargetFrame, aEvent);
|
PointerEventHandler::ImplicitlyCapturePointer(aTargetFrame, aEvent);
|
||||||
if (StaticPrefs::dom_popup_experimental()) {
|
// https://html.spec.whatwg.org/multipage/interaction.html#activation-triggering-input-event
|
||||||
// https://html.spec.whatwg.org/multipage/interaction.html#activation-triggering-input-event
|
if (mouseEvent->mInputSource == MouseEvent_Binding::MOZ_SOURCE_MOUSE) {
|
||||||
if (mouseEvent->mInputSource ==
|
|
||||||
MouseEvent_Binding::MOZ_SOURCE_MOUSE) {
|
|
||||||
NotifyTargetUserActivation(aEvent, aTargetContent);
|
|
||||||
}
|
|
||||||
} else if (mouseEvent->mInputSource !=
|
|
||||||
MouseEvent_Binding::MOZ_SOURCE_TOUCH) {
|
|
||||||
NotifyTargetUserActivation(aEvent, aTargetContent);
|
NotifyTargetUserActivation(aEvent, aTargetContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1179,8 +1170,7 @@ nsresult EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
|||||||
case ePointerUp:
|
case ePointerUp:
|
||||||
LightDismissOpenPopovers(aEvent, aTargetContent);
|
LightDismissOpenPopovers(aEvent, aTargetContent);
|
||||||
GenerateMouseEnterExit(mouseEvent);
|
GenerateMouseEnterExit(mouseEvent);
|
||||||
if (StaticPrefs::dom_popup_experimental() &&
|
if (mouseEvent->mInputSource != MouseEvent_Binding::MOZ_SOURCE_MOUSE) {
|
||||||
mouseEvent->mInputSource != MouseEvent_Binding::MOZ_SOURCE_MOUSE) {
|
|
||||||
NotifyTargetUserActivation(aEvent, aTargetContent);
|
NotifyTargetUserActivation(aEvent, aTargetContent);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1367,11 +1357,6 @@ nsresult EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
|||||||
case eTouchStart:
|
case eTouchStart:
|
||||||
SetGestureDownPoint(aEvent->AsTouchEvent());
|
SetGestureDownPoint(aEvent->AsTouchEvent());
|
||||||
break;
|
break;
|
||||||
case eTouchEnd:
|
|
||||||
if (!StaticPrefs::dom_popup_experimental()) {
|
|
||||||
NotifyTargetUserActivation(aEvent, aTargetContent);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1385,15 +1370,8 @@ nsresult EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
|||||||
// The modifiers associated with the user activation is used for controlling
|
// The modifiers associated with the user activation is used for controlling
|
||||||
// where the `window.open` is opened into.
|
// where the `window.open` is opened into.
|
||||||
static bool CanReflectModifiersToUserActivation(WidgetInputEvent* aEvent) {
|
static bool CanReflectModifiersToUserActivation(WidgetInputEvent* aEvent) {
|
||||||
if (StaticPrefs::dom_popup_experimental()) {
|
MOZ_ASSERT(aEvent->mMessage == eKeyDown || aEvent->mMessage == ePointerDown ||
|
||||||
MOZ_ASSERT(aEvent->mMessage == eKeyDown ||
|
aEvent->mMessage == ePointerUp);
|
||||||
aEvent->mMessage == ePointerDown ||
|
|
||||||
aEvent->mMessage == ePointerUp);
|
|
||||||
} else {
|
|
||||||
MOZ_ASSERT(aEvent->mMessage == eKeyDown || aEvent->mMessage == eMouseDown ||
|
|
||||||
aEvent->mMessage == ePointerDown ||
|
|
||||||
aEvent->mMessage == eTouchEnd);
|
|
||||||
}
|
|
||||||
|
|
||||||
WidgetKeyboardEvent* keyEvent = aEvent->AsKeyboardEvent();
|
WidgetKeyboardEvent* keyEvent = aEvent->AsKeyboardEvent();
|
||||||
if (keyEvent) {
|
if (keyEvent) {
|
||||||
@@ -1446,11 +1424,7 @@ void EventStateManager::NotifyTargetUserActivation(WidgetEvent* aEvent,
|
|||||||
// Do not treat the click on scrollbar as a user interaction with the web
|
// Do not treat the click on scrollbar as a user interaction with the web
|
||||||
// content.
|
// content.
|
||||||
if (StaticPrefs::dom_user_activation_ignore_scrollbars() &&
|
if (StaticPrefs::dom_user_activation_ignore_scrollbars() &&
|
||||||
((StaticPrefs::dom_popup_experimental() &&
|
(aEvent->mMessage == ePointerDown || aEvent->mMessage == ePointerUp) &&
|
||||||
(aEvent->mMessage == ePointerDown || aEvent->mMessage == ePointerUp)) ||
|
|
||||||
(!StaticPrefs::dom_popup_experimental() &&
|
|
||||||
(aEvent->mMessage == eMouseDown ||
|
|
||||||
aEvent->mMessage == ePointerDown))) &&
|
|
||||||
aTargetContent->IsInNativeAnonymousSubtree()) {
|
aTargetContent->IsInNativeAnonymousSubtree()) {
|
||||||
nsIContent* current = aTargetContent;
|
nsIContent* current = aTargetContent;
|
||||||
do {
|
do {
|
||||||
@@ -1465,17 +1439,8 @@ void EventStateManager::NotifyTargetUserActivation(WidgetEvent* aEvent,
|
|||||||
} while (current);
|
} while (current);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
MOZ_ASSERT(aEvent->mMessage == eKeyDown || aEvent->mMessage == ePointerDown ||
|
||||||
if (StaticPrefs::dom_popup_experimental()) {
|
aEvent->mMessage == ePointerUp);
|
||||||
MOZ_ASSERT(aEvent->mMessage == eKeyDown ||
|
|
||||||
aEvent->mMessage == ePointerDown ||
|
|
||||||
aEvent->mMessage == ePointerUp);
|
|
||||||
} else {
|
|
||||||
MOZ_ASSERT(aEvent->mMessage == eKeyDown || aEvent->mMessage == eMouseDown ||
|
|
||||||
aEvent->mMessage == ePointerDown ||
|
|
||||||
aEvent->mMessage == eTouchEnd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UserActivation::Modifiers modifiers;
|
UserActivation::Modifiers modifiers;
|
||||||
if (WidgetInputEvent* inputEvent = aEvent->AsInputEvent()) {
|
if (WidgetInputEvent* inputEvent = aEvent->AsInputEvent()) {
|
||||||
|
|||||||
@@ -2469,13 +2469,7 @@
|
|||||||
value: -1
|
value: -1
|
||||||
mirror: always
|
mirror: always
|
||||||
|
|
||||||
# Enable experimental popup blocker changes.
|
# Enable CacheAPI in private browsing mode with encryption
|
||||||
- name: dom.popup.experimental
|
|
||||||
type: bool
|
|
||||||
value: true
|
|
||||||
mirror: always
|
|
||||||
|
|
||||||
# Enable CacheAPI in private browsing mode with encryption
|
|
||||||
- name: dom.cache.privateBrowsing.enabled
|
- name: dom.cache.privateBrowsing.enabled
|
||||||
type: RelaxedAtomicBool
|
type: RelaxedAtomicBool
|
||||||
value: true
|
value: true
|
||||||
|
|||||||
Reference in New Issue
Block a user