From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- .../file_allowPointerLockSandboxFlag.html | 96 ++++++++++ .../pointerlock/file_changeLockElement.html | 115 +++++++++++ .../mochitest/pointerlock/file_childIframe.html | 134 +++++++++++++ .../mochitest/pointerlock/file_doubleLock.html | 64 +++++++ .../mochitest/pointerlock/file_escapeKey.html | 77 ++++++++ .../pointerlock/file_infiniteMovement.html | 114 +++++++++++ .../mochitest/pointerlock/file_locksvgelement.html | 62 ++++++ .../mochitest/pointerlock/file_movementXY.html | 106 +++++++++++ .../pointerlock/file_nestedFullScreen.html | 76 ++++++++ .../pointerlock/file_pointerLockPref.html | 75 ++++++++ .../file_pointerlock-api-with-shadow.html | 110 +++++++++++ .../pointerlock/file_pointerlock-api.html | 104 ++++++++++ .../file_pointerlock_xorigin_iframe.html | 125 ++++++++++++ ...pointerlock_xorigin_iframe_no_user_gesture.html | 95 +++++++++ ...ile_pointerlock_xorigin_iframe_not_focused.html | 112 +++++++++++ .../pointerlock/file_pointerlockerror.html | 41 ++++ .../mochitest/pointerlock/file_removedFromDOM.html | 95 +++++++++ .../pointerlock/file_retargetMouseEvents.html | 212 +++++++++++++++++++++ .../pointerlock/file_screenClientXYConst.html | 143 ++++++++++++++ .../pointerlock/file_suppressSomeMouseEvents.html | 158 +++++++++++++++ .../pointerlock/file_targetOutOfFocus.html | 69 +++++++ .../mochitest/pointerlock/file_withoutDOM.html | 54 ++++++ .../mochitest/pointerlock/iframe_differentDOM.html | 7 + dom/tests/mochitest/pointerlock/mochitest.ini | 37 ++++ .../mochitest/pointerlock/pointerlock_utils.js | 129 +++++++++++++ .../test_closewindow-with-pointerlock.html | 51 +++++ .../pointerlock/test_pointerlock-api.html | 113 +++++++++++ .../pointerlock/test_pointerlock_focus.html | 111 +++++++++++ ..._pointerlock_target_not_in_active_document.html | 77 ++++++++ .../test_pointerlock_xorigin_iframe.html | 59 ++++++ 30 files changed, 2821 insertions(+) create mode 100644 dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html create mode 100644 dom/tests/mochitest/pointerlock/file_changeLockElement.html create mode 100644 dom/tests/mochitest/pointerlock/file_childIframe.html create mode 100644 dom/tests/mochitest/pointerlock/file_doubleLock.html create mode 100644 dom/tests/mochitest/pointerlock/file_escapeKey.html create mode 100644 dom/tests/mochitest/pointerlock/file_infiniteMovement.html create mode 100644 dom/tests/mochitest/pointerlock/file_locksvgelement.html create mode 100644 dom/tests/mochitest/pointerlock/file_movementXY.html create mode 100644 dom/tests/mochitest/pointerlock/file_nestedFullScreen.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerLockPref.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerlock-api-with-shadow.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerlock-api.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_no_user_gesture.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_not_focused.html create mode 100644 dom/tests/mochitest/pointerlock/file_pointerlockerror.html create mode 100644 dom/tests/mochitest/pointerlock/file_removedFromDOM.html create mode 100644 dom/tests/mochitest/pointerlock/file_retargetMouseEvents.html create mode 100644 dom/tests/mochitest/pointerlock/file_screenClientXYConst.html create mode 100644 dom/tests/mochitest/pointerlock/file_suppressSomeMouseEvents.html create mode 100644 dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html create mode 100644 dom/tests/mochitest/pointerlock/file_withoutDOM.html create mode 100644 dom/tests/mochitest/pointerlock/iframe_differentDOM.html create mode 100644 dom/tests/mochitest/pointerlock/mochitest.ini create mode 100644 dom/tests/mochitest/pointerlock/pointerlock_utils.js create mode 100644 dom/tests/mochitest/pointerlock/test_closewindow-with-pointerlock.html create mode 100644 dom/tests/mochitest/pointerlock/test_pointerlock-api.html create mode 100644 dom/tests/mochitest/pointerlock/test_pointerlock_focus.html create mode 100644 dom/tests/mochitest/pointerlock/test_pointerlock_target_not_in_active_document.html create mode 100644 dom/tests/mochitest/pointerlock/test_pointerlock_xorigin_iframe.html (limited to 'dom/tests/mochitest/pointerlock') diff --git a/dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html b/dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html new file mode 100644 index 0000000000..33f550f7d7 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html @@ -0,0 +1,96 @@ + + + + + Bug 784402 + + + + + + + + Mozilla Bug 784402 +

+ + + +
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/file_changeLockElement.html b/dom/tests/mochitest/pointerlock/file_changeLockElement.html new file mode 100644 index 0000000000..62c5b27956 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_changeLockElement.html @@ -0,0 +1,115 @@ + + + + + Bug 1284788 + + + + + + + +
+
+
+
+ +
+ + diff --git a/dom/tests/mochitest/pointerlock/file_childIframe.html b/dom/tests/mochitest/pointerlock/file_childIframe.html new file mode 100644 index 0000000000..9ee3153d2e --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_childIframe.html @@ -0,0 +1,134 @@ + + + + + Bug 633602 - file_childIframe.html + + + + + + + + + Mozilla Bug 633602 + + +
+ + + + + +
+ + +
+
+
+
+ +
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_doubleLock.html b/dom/tests/mochitest/pointerlock/file_doubleLock.html new file mode 100644 index 0000000000..93e156a0b0 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_doubleLock.html @@ -0,0 +1,64 @@ + + + + + Bug 633602 - file_doubleLockCallBack.html + + + + + + + + + Mozilla Bug 633602 +
+
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_escapeKey.html b/dom/tests/mochitest/pointerlock/file_escapeKey.html new file mode 100644 index 0000000000..987b880232 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_escapeKey.html @@ -0,0 +1,77 @@ + + + + + Bug 633602 + + + + + + + + Mozilla Bug 633602 + +
+
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_infiniteMovement.html b/dom/tests/mochitest/pointerlock/file_infiniteMovement.html new file mode 100644 index 0000000000..995d99843b --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_infiniteMovement.html @@ -0,0 +1,114 @@ + + + + + Bug 633602 - file_movementXY.html + + + + + + + + Mozilla Bug 633602 + +
+
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/file_locksvgelement.html b/dom/tests/mochitest/pointerlock/file_locksvgelement.html new file mode 100644 index 0000000000..edbfa45995 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_locksvgelement.html @@ -0,0 +1,62 @@ + + + + + Bug 633602 + + + + + + + + Mozilla Bug 633602 +

+ + + + + +
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/file_movementXY.html b/dom/tests/mochitest/pointerlock/file_movementXY.html new file mode 100644 index 0000000000..7ef47cfaa9 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_movementXY.html @@ -0,0 +1,106 @@ + + + + + Bug 633602 - file_movementXY.html + + + + + + + + Mozilla Bug 633602 + +
+
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/file_nestedFullScreen.html b/dom/tests/mochitest/pointerlock/file_nestedFullScreen.html new file mode 100644 index 0000000000..8d625b6704 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_nestedFullScreen.html @@ -0,0 +1,76 @@ + + + + + Bug 633602 - file_nestedFullScreen.html + + + + + + + + Mozilla Bug 633602 + + +
+
+
+ + + + diff --git a/dom/tests/mochitest/pointerlock/file_pointerLockPref.html b/dom/tests/mochitest/pointerlock/file_pointerLockPref.html new file mode 100644 index 0000000000..09c3b42052 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerLockPref.html @@ -0,0 +1,75 @@ + + + + + Bug 633602 + + + + + + + + Mozilla Bug 633602 +

+
+
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/file_pointerlock-api-with-shadow.html b/dom/tests/mochitest/pointerlock/file_pointerlock-api-with-shadow.html new file mode 100644 index 0000000000..a9c2d525de --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerlock-api-with-shadow.html @@ -0,0 +1,110 @@ + + + + + Bug 633602 + + + + + + + + Mozilla Bug 633602 + +
+
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_pointerlock-api.html b/dom/tests/mochitest/pointerlock/file_pointerlock-api.html new file mode 100644 index 0000000000..6f5fb537be --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerlock-api.html @@ -0,0 +1,104 @@ + + + + + Bug 633602 + + + + + + + + Mozilla Bug 633602 + +
+
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe.html b/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe.html new file mode 100644 index 0000000000..f8e34ef64b --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe.html @@ -0,0 +1,125 @@ + + + + +Bug 1662587 + + + + + + + +Mozilla Bug 1662587 +
+ + +
+
+
+ + diff --git a/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_no_user_gesture.html b/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_no_user_gesture.html new file mode 100644 index 0000000000..68977ffada --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_no_user_gesture.html @@ -0,0 +1,95 @@ + + + + +Bug 1672330 + + + + + + + + + +Mozilla Bug 1672330 +
+ + +
+
+
+ + diff --git a/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_not_focused.html b/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_not_focused.html new file mode 100644 index 0000000000..a6c0058657 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerlock_xorigin_iframe_not_focused.html @@ -0,0 +1,112 @@ + + + + +Bug 1662587 + + + + + + + +Mozilla Bug 1698611 +
+ + +
+
+
+ + diff --git a/dom/tests/mochitest/pointerlock/file_pointerlockerror.html b/dom/tests/mochitest/pointerlock/file_pointerlockerror.html new file mode 100644 index 0000000000..0948a19452 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_pointerlockerror.html @@ -0,0 +1,41 @@ + + + + + Bug 633602 + + + + + + + + Mozilla Bug 633602 + + +
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_removedFromDOM.html b/dom/tests/mochitest/pointerlock/file_removedFromDOM.html new file mode 100644 index 0000000000..3e2f9ca866 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_removedFromDOM.html @@ -0,0 +1,95 @@ + + + + +Bug 633602 - file_DOMtree.html + + + + + + + + Mozilla Bug 633602 + +
+
+
+
+
+ + diff --git a/dom/tests/mochitest/pointerlock/file_retargetMouseEvents.html b/dom/tests/mochitest/pointerlock/file_retargetMouseEvents.html new file mode 100644 index 0000000000..2cd329bb33 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_retargetMouseEvents.html @@ -0,0 +1,212 @@ + + + + + Bug 633602 - file_retargetMouseEvents.html + + + + + + + + Mozilla Bug 633602 + + +
+
+
+
+ +
+    
+  
+ + diff --git a/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html b/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html new file mode 100644 index 0000000000..31bd232a57 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html @@ -0,0 +1,143 @@ + + + + + Bug 633602 - constantXY.html + + + + + + + + Mozilla Bug 633602 + +
+ + + diff --git a/dom/tests/mochitest/pointerlock/file_suppressSomeMouseEvents.html b/dom/tests/mochitest/pointerlock/file_suppressSomeMouseEvents.html new file mode 100644 index 0000000000..bc1e1e64a5 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_suppressSomeMouseEvents.html @@ -0,0 +1,158 @@ + + + + + Bug 633602 - file_cursorPosEvents.html + + + + + + + + + Mozilla Bug 633602 + +
+
+
+ + + + diff --git a/dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html b/dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html new file mode 100644 index 0000000000..4a6b9084bb --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html @@ -0,0 +1,69 @@ + + + + + Bug 633602 - file_targetOutOfFocus.html + + + + + + + + Mozilla Bug 633602 + +

+
+
+
+ +
+
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/file_withoutDOM.html b/dom/tests/mochitest/pointerlock/file_withoutDOM.html new file mode 100644 index 0000000000..c63a72cf9a --- /dev/null +++ b/dom/tests/mochitest/pointerlock/file_withoutDOM.html @@ -0,0 +1,54 @@ + + + + + Bug 633602 - file_DOMtree.html + + + + + + + + + Mozilla Bug 633602 + +
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/iframe_differentDOM.html b/dom/tests/mochitest/pointerlock/iframe_differentDOM.html new file mode 100644 index 0000000000..0e3eac19b9 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/iframe_differentDOM.html @@ -0,0 +1,7 @@ + + + + +
+ + diff --git a/dom/tests/mochitest/pointerlock/mochitest.ini b/dom/tests/mochitest/pointerlock/mochitest.ini new file mode 100644 index 0000000000..54106104b2 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/mochitest.ini @@ -0,0 +1,37 @@ +[DEFAULT] +support-files = + pointerlock_utils.js + iframe_differentDOM.html + !/gfx/layers/apz/test/mochitest/apz_test_utils.js + +[test_closewindow-with-pointerlock.html] +[test_pointerlock_target_not_in_active_document.html] +[test_pointerlock-api.html] +tags = fullscreen +skip-if = (os == 'android') # Bug 1612553 +support-files = + file_pointerlock-api.html + file_pointerlock-api-with-shadow.html + file_pointerlockerror.html + file_escapeKey.html + file_withoutDOM.html + file_removedFromDOM.html + file_pointerLockPref.html + file_nestedFullScreen.html + file_doubleLock.html + file_childIframe.html + file_movementXY.html + file_infiniteMovement.html + file_retargetMouseEvents.html + file_targetOutOfFocus.html + file_screenClientXYConst.html + file_suppressSomeMouseEvents.html + file_locksvgelement.html + file_allowPointerLockSandboxFlag.html + file_changeLockElement.html +[test_pointerlock_focus.html] +[test_pointerlock_xorigin_iframe.html] +support-files = + file_pointerlock_xorigin_iframe.html + file_pointerlock_xorigin_iframe_no_user_gesture.html + file_pointerlock_xorigin_iframe_not_focused.html diff --git a/dom/tests/mochitest/pointerlock/pointerlock_utils.js b/dom/tests/mochitest/pointerlock/pointerlock_utils.js new file mode 100644 index 0000000000..4af5c05e0a --- /dev/null +++ b/dom/tests/mochitest/pointerlock/pointerlock_utils.js @@ -0,0 +1,129 @@ +// Get test filename for page being run in popup so errors are more useful +var testName = location.pathname.split("/").pop(); + +// Wrap test functions and pass to parent window +window.ok = function(a, msg) { + opener.ok(a, testName + ": " + msg); +}; + +window.is = function(a, b, msg) { + opener.is(a, b, testName + ": " + msg); +}; + +window.isnot = function(a, b, msg) { + opener.isnot(a, b, testName + ": " + msg); +}; + +window.todo = function(a, msg) { + opener.todo(a, testName + ": " + msg); +}; + +window.todo_is = function(a, b, msg) { + opener.todo_is(a, b, testName + ": " + msg); +}; + +window.todo_isnot = function(a, b, msg) { + opener.todo_isnot(a, b, testName + ": " + msg); +}; + +window.info = function(msg) { + opener.info(testName + ": " + msg); +}; + +// Override bits of SimpleTest so test files work stand-alone +var SimpleTest = SimpleTest || {}; + +SimpleTest.waitForExplicitFinish = function() { + dump("[POINTERLOCK] Starting " + testName + "\n"); +}; + +SimpleTest.finish = function() { + dump("[POINTERLOCK] Finishing " + testName + "\n"); + opener.nextTest(); +}; + +addLoadEvent(function() { + if (typeof start !== "undefined") { + // Try to stabilize the initial state of the page so that topWin.normalSize + // ends up storing the correct values when entering fullscreen the first time. + SimpleTest.requestFlakyTimeout( + "Initial window opening animation takes some time." + ); + SimpleTest.waitForFocus(() => + setTimeout(() => requestAnimationFrame(() => setTimeout(start)), 100) + ); + } +}); + +// Returns true if the window occupies the entire screen. +// Note this only returns true once the transition from normal to +// fullscreen mode is complete. +function inFullscreenMode(win) { + return ( + win.innerWidth == win.screen.width && win.innerHeight == win.screen.height + ); +} + +// Returns true if the window is in normal mode, i.e. non fullscreen mode. +// Note this only returns true once the transition from fullscreen back to +// normal mode is complete. +function inNormalMode(win) { + return ( + win.innerWidth == win.normalSize.w && win.innerHeight == win.normalSize.h + ); +} + +// Adds a listener that will be called once a fullscreen transition +// is complete. When type==='enter', callback is called when we've +// received a fullscreenchange event, and the fullscreen transition is +// complete. When type==='exit', callback is called when we've +// received a fullscreenchange event and the window dimensions match +// the window dimensions when the window opened (so don't resize the +// window while running your test!). inDoc is the document which +// the listeners are added on, if absent, the listeners are added to +// the current document. +function addFullscreenChangeContinuation(type, callback, inDoc) { + var doc = inDoc || document; + var topWin = doc.defaultView.top; + // Remember the window size in non-fullscreen mode. + if (!topWin.normalSize) { + topWin.normalSize = { + w: window.innerWidth, + h: window.innerHeight, + }; + } + function checkCondition() { + if (type == "enter") { + return inFullscreenMode(topWin); + } else if (type == "exit") { + // If we just revert the state to a previous fullscreen state, + // the window won't back to the normal mode. Hence we check + // fullscreenElement first here. Note that we need to check + // the fullscreen element of the outmost document here instead + // of the current one. + return topWin.document.fullscreenElement || inNormalMode(topWin); + } else { + throw "'type' must be either 'enter', or 'exit'."; + } + } + function invokeCallback(event) { + // Use async call after a paint to workaround unfinished fullscreen + // change even when the window size has changed on Linux. + requestAnimationFrame(() => setTimeout(() => callback(event), 0), 0); + } + function onFullscreenChange(event) { + doc.removeEventListener("fullscreenchange", onFullscreenChange); + if (checkCondition()) { + invokeCallback(event); + return; + } + function onResize() { + if (checkCondition()) { + topWin.removeEventListener("resize", onResize); + invokeCallback(event); + } + } + topWin.addEventListener("resize", onResize); + } + doc.addEventListener("fullscreenchange", onFullscreenChange); +} diff --git a/dom/tests/mochitest/pointerlock/test_closewindow-with-pointerlock.html b/dom/tests/mochitest/pointerlock/test_closewindow-with-pointerlock.html new file mode 100644 index 0000000000..797228c3e0 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/test_closewindow-with-pointerlock.html @@ -0,0 +1,51 @@ + + + + + Bug 1323983 - Auto-close window after holding pointerlock + + + + + + + + diff --git a/dom/tests/mochitest/pointerlock/test_pointerlock-api.html b/dom/tests/mochitest/pointerlock/test_pointerlock-api.html new file mode 100644 index 0000000000..201fdbcb9c --- /dev/null +++ b/dom/tests/mochitest/pointerlock/test_pointerlock-api.html @@ -0,0 +1,113 @@ + + + + + Test for Bug 633602 + + + + + + + Mozilla Bug 633602 + +
+
+
+      
+    
+ + diff --git a/dom/tests/mochitest/pointerlock/test_pointerlock_focus.html b/dom/tests/mochitest/pointerlock/test_pointerlock_focus.html new file mode 100644 index 0000000000..4b414d3ba6 --- /dev/null +++ b/dom/tests/mochitest/pointerlock/test_pointerlock_focus.html @@ -0,0 +1,111 @@ + + + + + Bug 1646493 - test_pointerlock_focus.html + + + + + + +Mozilla Bug 1646493
+
+
+ + + + diff --git a/dom/tests/mochitest/pointerlock/test_pointerlock_target_not_in_active_document.html b/dom/tests/mochitest/pointerlock/test_pointerlock_target_not_in_active_document.html new file mode 100644 index 0000000000..8629230b6b --- /dev/null +++ b/dom/tests/mochitest/pointerlock/test_pointerlock_target_not_in_active_document.html @@ -0,0 +1,77 @@ + + + + + Bug 1646493 - test_pointerlock_target_not_in_active_document.html + + + + + +Mozilla Bug 1646493
+ + + + diff --git a/dom/tests/mochitest/pointerlock/test_pointerlock_xorigin_iframe.html b/dom/tests/mochitest/pointerlock/test_pointerlock_xorigin_iframe.html new file mode 100644 index 0000000000..fb4f84470e --- /dev/null +++ b/dom/tests/mochitest/pointerlock/test_pointerlock_xorigin_iframe.html @@ -0,0 +1,59 @@ + + + + +Test for Bug 1662587 + + + + + +Mozilla Bug 1662587 +
+
+
+
+ + -- cgit v1.2.3