diff --git a/site/source/docs/api_reference/html5.h.rst b/site/source/docs/api_reference/html5.h.rst index 77d21994defff..39eb388c7194d 100644 --- a/site/source/docs/api_reference/html5.h.rst +++ b/site/source/docs/api_reference/html5.h.rst @@ -17,22 +17,26 @@ The C++ APIs in `html5.h `_. - - `Device Orientation Events for gyro and accelerometer `_. + - `UI Events: Keyboard, Mouse, Mouse Wheel, Resize, Scroll, Focus + `_. + - `Device Orientation Events for gyro and accelerometer + `_. - `Screen Orientation Events for portrait/landscape handling - `_. + `_. - `Fullscreen Events for browser canvas fullscreen modes transitioning - `_. - - `Pointer Lock Events for relative-mode mouse motion control `_. + `_. + - `Pointer Lock Events for relative-mode mouse motion control + `_. - `Vibration API for mobile device haptic vibration feedback control - `_. - - `Page Visibility Events for power management control `_. - - `Touch Events `_. - - `Gamepad API `_. + `_. + - `Page Visibility Events for power management control + `_. + - `Touch Events `_. + - `Gamepad API `_. - `Beforeunload event - `_. - - `WebGL context events `_. + `_. + - `WebGL context events + `_. - `Animation and timing `_. - `Console `_. - `Throw `_. @@ -120,9 +124,8 @@ The ``useCapture`` parameter maps to ``useCapture`` in `_. It indicates whether or not to initiate *capture*: if ``true`` the callback will be invoked only for the DOM capture and target phases; if ``false`` the callback -will be triggered during the target and bubbling phases. See `DOM Level 3 Events -`_ -for a more detailed explanation. +will be triggered during the target and bubbling phases. See `DOM Standard +`_ for a more detailed explanation. Most functions return the result using the type :c:data:`EMSCRIPTEN_RESULT`. Zero and positive values denote success. Negative values signal failure. None of @@ -356,14 +359,14 @@ Struct .. c:type:: EmscriptenKeyboardEvent The event structure passed in `keyboard events - `_: - ``keypress``, ``keydown`` and ``keyup``. - - Note that since the `DOM Level 3 Events spec - `_ - is very recent at the time of writing (2014-03), uniform support for the - different fields in the spec is still in flux. Be sure to check the results in - multiple browsers. See the `unmerged pull request #2222 + `_: ``keypress``, + ``keydown`` and ``keyup``. + + Note that since the `UI Events spec + `_ is very recent at the time + of writing (2014-03), uniform support for the different fields in the spec is + still in flux. Be sure to check the results in multiple browsers. See the + `unmerged pull request #2222 `_ for an example of how to interpret the legacy key events. @@ -516,7 +519,7 @@ Struct .. c:type:: EmscriptenMouseEvent - The event structure passed in `mouse events `_: `click `_, `mousedown `_, `mouseup `_, `dblclick `_, `mousemove `_, `mouseenter `_, `mouseleave `_ and `contextmenu `_. + The event structure passed in `mouse events `_: `click `_, `mousedown `_, `mouseup `_, `dblclick `_, `mousemove `_, `mouseenter `_, `mouseleave `_ and `contextmenu `_. .. c:member:: double timestamp @@ -660,18 +663,18 @@ Defines .. c:macro:: DOM_DELTA_PIXEL - The units of measurement for the delta must be pixels (from `spec `_). + The units of measurement for the delta must be pixels (from `spec `__). .. c:macro:: DOM_DELTA_LINE The units of measurement for the delta must be individual lines of text (from - `spec `_). + `spec `__). .. c:macro:: DOM_DELTA_PAGE The units of measurement for the delta must be pages, either defined as a single screen or as a demarcated page (from `spec - `_). + `__). Struct @@ -679,7 +682,7 @@ Struct .. c:type:: EmscriptenWheelEvent - The event structure passed in `mousewheel events `_. + The event structure passed in `wheel events `_. .. c:member:: EmscriptenMouseEvent mouse @@ -728,7 +731,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_set_wheel_callback(const char *target, void *userData, bool useCapture, em_wheel_callback_func callback) - Registers a callback function for receiving browser-generated `mousewheel events `_. + Registers a callback function for receiving browser-generated `mousewheel events `_. :param target: |target-parameter-doc| :type target: const char* @@ -757,7 +760,7 @@ Struct .. c:type:: EmscriptenUiEvent - The event structure passed in DOM element `UIEvent `_ events: `resize `_ and `scroll `_. + The event structure passed in DOM element `UIEvent `_ events: `resize `_ and `scroll `_. .. c:member:: int detail @@ -810,12 +813,12 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_set_resize_callback(const char *target, void *userData, bool useCapture, em_ui_callback_func callback) EMSCRIPTEN_RESULT emscripten_set_scroll_callback(const char *target, void *userData, bool useCapture, em_ui_callback_func callback) - Registers a callback function for receiving DOM element `resize `_ and `scroll `_ events. + Registers a callback function for receiving DOM element `resize `_ and `scroll `_ events. .. note:: - For the ``resize`` callback, pass in target = ``EMSCRIPTEN_EVENT_TARGET_WINDOW`` to get ``resize`` events from the ``Window`` object. - - The DOM3 Events specification only requires that the ``Window`` object sends resize events. It is valid to register a ``resize`` callback on other DOM elements, but the browser is not required to fire ``resize`` events for these. + - The UI Events specification only requires that the ``Window`` object sends resize events. It is valid to register a ``resize`` callback on other DOM elements, but the browser is not required to fire ``resize`` events for these. :param target: |target-parameter-doc| :type target: const char* @@ -847,7 +850,7 @@ Struct .. c:type:: EmscriptenFocusEvent - The event structure passed in DOM element `blur `_, `focus `_, `focusin `_ and `focusout `_ events. + The event structure passed in DOM element `blur `_, `focus `_, `focusin `_ and `focusout `_ events. .. c:member:: EM_UTF8 nodeName @@ -891,7 +894,7 @@ Functions EMSCRIPTEN_RESULT emscripten_set_focusin_callback(const char *target, void *userData, bool useCapture, em_focus_callback_func callback) EMSCRIPTEN_RESULT emscripten_set_focusout_callback(const char *target, void *userData, bool useCapture, em_focus_callback_func callback) - Registers a callback function for receiving DOM element `blur `_, `focus `_, `focusin `_ and `focusout `_ events. + Registers a callback function for receiving DOM element `blur `_, `focus `_, `focusin `_ and `focusout `_ events. :param target: |target-parameter-doc| :type target: const char* @@ -918,7 +921,7 @@ Struct .. c:type:: EmscriptenDeviceOrientationEvent - The event structure passed in the `deviceorientation `_ event. + The event structure passed in the `deviceorientation `_ event. .. c:member:: double alpha @@ -968,7 +971,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_set_deviceorientation_callback(void *userData, bool useCapture, em_deviceorientation_callback_func callback) - Registers a callback function for receiving the `deviceorientation `_ event. + Registers a callback function for receiving the `deviceorientation `_ event. :param void* userData: |userData-parameter-doc| :param bool useCapture: |useCapture-parameter-doc| @@ -998,7 +1001,7 @@ Defines .. c:macro:: EMSCRIPTEN_EVENT_DEVICEMOTION - Emscripten `devicemotion `_ event. + Emscripten `devicemotion `_ event. Struct @@ -1006,7 +1009,7 @@ Struct .. c:type:: EmscriptenDeviceMotionEvent - The event structure passed in the `devicemotion `_ event. + The event structure passed in the `devicemotion `_ event. .. c:member:: double accelerationX double accelerationY @@ -1060,7 +1063,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_set_devicemotion_callback(void *userData, bool useCapture, em_devicemotion_callback_func callback) - Registers a callback function for receiving the `devicemotion `_ event. + Registers a callback function for receiving the `devicemotion `_ event. :param void* userData: |userData-parameter-doc| :param bool useCapture: |useCapture-parameter-doc| @@ -1071,7 +1074,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_get_devicemotion_status(EmscriptenDeviceMotionEvent *motionState) - Returns the most recently received `devicemotion `_ event state. + Returns the most recently received `devicemotion `_ event state. Note that for this function call to succeed, :c:func:`emscripten_set_devicemotion_callback` must have first been called with a non-zero callback function pointer to enable the ``devicemotion`` state capture. @@ -1090,7 +1093,7 @@ Defines .. c:macro:: EMSCRIPTEN_EVENT_ORIENTATIONCHANGE - Emscripten `orientationchange `_ event. + Emscripten `orientationchange `_ event. .. c:macro:: EMSCRIPTEN_ORIENTATION_UNKNOWN @@ -1119,7 +1122,7 @@ Struct .. c:type:: EmscriptenOrientationChangeEvent - The event structure passed in the `orientationchange `_ event. + The event structure passed in the `orientationchange `_ event. .. c:member:: int orientationIndex @@ -1157,7 +1160,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_set_orientationchange_callback(void *userData, bool useCapture, em_orientationchange_callback_func callback) - Registers a callback function for receiving the `orientationchange `_ event. + Registers a callback function for receiving the `orientationchange `_ event. :param void* userData: |userData-parameter-doc| :param bool useCapture: |useCapture-parameter-doc| @@ -1202,7 +1205,7 @@ Defines .. c:macro:: EMSCRIPTEN_EVENT_FULLSCREENCHANGE - Emscripten `fullscreenchange `_ event. + Emscripten `fullscreenchange `_ event. .. c:macro:: EMSCRIPTEN_FULLSCREEN_SCALE @@ -1269,7 +1272,7 @@ Struct .. c:type:: EmscriptenFullscreenChangeEvent - The event structure passed in the `fullscreenchange `_ event. + The event structure passed in the `fullscreenchange `_ event. .. c:member:: bool isFullscreen @@ -1358,7 +1361,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_set_fullscreenchange_callback(const char *target, void *userData, bool useCapture, em_fullscreenchange_callback_func callback) - Registers a callback function for receiving the `fullscreenchange `_ event. + Registers a callback function for receiving the `fullscreenchange `_ event. :param target: |target-parameter-doc| :type target: const char* @@ -1371,7 +1374,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_get_fullscreen_status(EmscriptenFullscreenChangeEvent *fullscreenStatus) - Returns the current page `fullscreen `_ state. + Returns the current page `fullscreen `_ state. :param fullscreenStatus: The most recently received fullscreen state. :type fullscreenStatus: EmscriptenFullscreenChangeEvent* @@ -1430,18 +1433,18 @@ Defines .. c:macro:: EMSCRIPTEN_EVENT_POINTERLOCKCHANGE - Emscripten `pointerlockchange `_ event. + Emscripten `pointerlockchange `_ event. .. c:macro:: EMSCRIPTEN_EVENT_POINTERLOCKERROR - Emscripten `pointerlockerror `_ event. + Emscripten `pointerlockerror `_ event. Struct ------ .. c:type:: EmscriptenPointerlockChangeEvent - The event structure passed in the `pointerlockchange `_ event. + The event structure passed in the `pointerlockchange `_ event. .. c:member:: bool isActive @@ -1500,9 +1503,9 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_set_pointerlockchange_callback(const char *target, void *userData, bool useCapture, em_pointerlockchange_callback_func callback) - Registers a callback function for receiving the `pointerlockchange `_ event. + Registers a callback function for receiving the `pointerlockchange `_ event. - Pointer lock hides the mouse cursor and exclusively gives the target element relative mouse movement events via the `mousemove `_ event. + Pointer lock hides the mouse cursor and exclusively gives the target element relative mouse movement events via the `mousemove `_ event. :param target: |target-parameter-doc| :type target: const char* @@ -1516,7 +1519,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_set_pointerlockerror_callback(const char *target, void *userData, bool useCapture, em_pointerlockerror_callback_func callback) - Registers a callback function for receiving the `pointerlockerror `_ event. + Registers a callback function for receiving the `pointerlockerror `_ event. :param target: |target-parameter-doc| :type target: const char* @@ -1568,23 +1571,23 @@ Defines .. c:macro:: EMSCRIPTEN_EVENT_VISIBILITYCHANGE - Emscripten `visibilitychange `__ event. + Emscripten `visibilitychange `__ event. .. c:macro:: EMSCRIPTEN_VISIBILITY_HIDDEN - The document is `hidden `_ (not visible). + The document is `hidden `_ (not visible). .. c:macro:: EMSCRIPTEN_VISIBILITY_VISIBLE - The document is at least partially `visible `_. + The document is at least partially `visible `_. .. c:macro:: EMSCRIPTEN_VISIBILITY_PRERENDER - The document is loaded off screen and not visible (`prerender `_). + The document is loaded off screen and not visible (`prerender `_). .. c:macro:: EMSCRIPTEN_VISIBILITY_UNLOADED - The document is to be `unloaded `_. + The document is to be `unloaded `_. Struct @@ -1592,7 +1595,7 @@ Struct .. c:type:: EmscriptenVisibilityChangeEvent - The event structure passed in the `visibilitychange `__ event. + The event structure passed in the `visibilitychange `__ event. .. c:member:: bool hidden @@ -1628,7 +1631,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_set_visibilitychange_callback(void *userData, bool useCapture, em_visibilitychange_callback_func callback) - Registers a callback function for receiving the `visibilitychange `_ event. + Registers a callback function for receiving the `visibilitychange `_ event. :param void* userData: |userData-parameter-doc| :param bool useCapture: |useCapture-parameter-doc| @@ -1666,7 +1669,7 @@ Struct .. c:type:: EmscriptenTouchPoint - Specifies the status of a single `touch point `_ on the page. + Specifies the status of a single `touch point `_ on the page. .. c:member:: int identifier @@ -1709,7 +1712,7 @@ Struct .. c:type:: EmscriptenTouchEvent - Specifies the data of a single `touchevent `_. + Specifies the data of a single `touchevent `_. .. c:member:: double timestamp @@ -1762,7 +1765,7 @@ Functions EMSCRIPTEN_RESULT emscripten_set_touchmove_callback(const char *target, void *userData, bool useCapture, em_touch_callback_func callback) EMSCRIPTEN_RESULT emscripten_set_touchcancel_callback(const char *target, void *userData, bool useCapture, em_touch_callback_func callback) - Registers a callback function for receiving `touch events `__ : `touchstart `_, `touchend `_, `touchmove `_ and `touchcancel `_. + Registers a callback function for receiving `touch events `__ : `touchstart `_, `touchend `_, `touchmove `_ and `touchcancel `_. :param target: |target-parameter-doc| :type target: const char* @@ -1868,7 +1871,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_set_gamepadconnected_callback(void *userData, bool useCapture, em_gamepad_callback_func callback) EMSCRIPTEN_RESULT emscripten_set_gamepaddisconnected_callback(void *userData, bool useCapture, em_gamepad_callback_func callback) - Registers a callback function for receiving the gamepad_ events: `gamepadconnected `_ and `gamepaddisconnected `_. + Registers a callback function for receiving the gamepad_ events: `gamepadconnected `_ and `gamepaddisconnected `_. :param void* userData: |userData-parameter-doc| :param bool useCapture: |useCapture-parameter-doc| @@ -1936,7 +1939,7 @@ Defines .. c:macro:: EMSCRIPTEN_EVENT_BATTERYCHARGINGCHANGE EMSCRIPTEN_EVENT_BATTERYLEVELCHANGE - Emscripten `BatteryManager `_ events. + Emscripten `BatteryManager `_ events. Struct @@ -1944,7 +1947,7 @@ Struct .. c:type:: EmscriptenBatteryEvent - The event structure passed in the `BatteryManager `_ events: ``chargingchange`` and ``levelchange``. + The event structure passed in the `BatteryManager `_ events: ``chargingchange`` and ``levelchange``. .. c:member:: double chargingTime @@ -1990,7 +1993,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_set_batterychargingchange_callback(void *userData, em_battery_callback_func callback) EMSCRIPTEN_RESULT emscripten_set_batterylevelchange_callback(void *userData, em_battery_callback_func callback) - Registers a callback function for receiving the `BatteryManager `_ events: ``chargingchange`` and ``levelchange``. + Registers a callback function for receiving the `BatteryManager `_ events: ``chargingchange`` and ``levelchange``. :param void* userData: |userData-parameter-doc| :param em_battery_callback_func callback: |callback-function-parameter-doc| @@ -2018,7 +2021,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_vibrate(int msecs) - Produces a `vibration `_ for the specified time, in milliseconds. + Produces a `vibration `_ for the specified time, in milliseconds. :param int msecs: The amount of time for which the vibration is required (milliseconds). :returns: :c:data:`EMSCRIPTEN_RESULT_SUCCESS`, or one of the other result values. @@ -2043,7 +2046,7 @@ Defines .. c:macro:: EMSCRIPTEN_EVENT_BEFOREUNLOAD - Emscripten `beforeunload `_ event. + Emscripten `beforeunload `_ event. Callback functions @@ -2072,7 +2075,7 @@ Functions .. c:function:: EMSCRIPTEN_RESULT emscripten_set_beforeunload_callback(void *userData, em_beforeunload_callback callback) - Registers a callback function for receiving the page `beforeunload `_ event. + Registers a callback function for receiving the page `beforeunload `_ event. Hook into this event to perform actions immediately prior to page close (for example, to display a notification to ask if the user really wants to leave the page). @@ -2402,8 +2405,8 @@ Functions .. |callback-handler-return-value-doc| replace:: ``true`` (non zero) to indicate that the event was consumed by the :ref:`callback handler `. .. |callback-function-parameter-doc| replace:: A callback function. The function is called with the type of event, information about the event, and user data passed from this registration function. The callback should return ``true`` if the event is consumed. -.. _gamepad: http://www.w3.org/TR/gamepad/#gamepad-interface -.. _webgl_context: http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2 +.. _gamepad: https://www.w3.org/TR/gamepad/#gamepad-interface +.. _webgl_context: https://registry.khronos.org/webgl/specs/latest/1.0/#5.15.2 Animation and Timing ==================== diff --git a/site/source/docs/tools_reference/settings_reference.rst b/site/source/docs/tools_reference/settings_reference.rst index cca2746b2f0ab..8f2dbad9928a1 100644 --- a/site/source/docs/tools_reference/settings_reference.rst +++ b/site/source/docs/tools_reference/settings_reference.rst @@ -3310,7 +3310,7 @@ TRUSTED_TYPES Allow calls to Worker(...) and importScripts(...) to be Trusted Types compatible. Trusted Types is a Web Platform feature designed to mitigate DOM XSS by restricting the usage of DOM sink APIs. -See https://w3c.github.io/webappsec-trusted-types/. +See https://www.w3.org/TR/trusted-types/. Default value: false diff --git a/src/lib/libsdl.js b/src/lib/libsdl.js index f3502287a617c..bcba2e2964236 100644 --- a/src/lib/libsdl.js +++ b/src/lib/libsdl.js @@ -1285,7 +1285,7 @@ var LibrarySDL = { getJoystickButtonState(button) { if (typeof button == 'object') { // Current gamepad API editor's draft (Firefox Nightly) - // https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#idl-def-GamepadButton + // https://www.w3.org/TR/gamepad/#dom-gamepadbutton return button['pressed']; } // Current gamepad API working draft (Firefox / Chrome Stable) diff --git a/src/settings.js b/src/settings.js index 24c88a7be4749..257b091c5f5c2 100644 --- a/src/settings.js +++ b/src/settings.js @@ -2200,7 +2200,7 @@ var ALLOW_UNIMPLEMENTED_SYSCALLS = true; // Allow calls to Worker(...) and importScripts(...) to be Trusted Types // compatible. Trusted Types is a Web Platform feature designed to mitigate DOM // XSS by restricting the usage of DOM sink APIs. -// See https://w3c.github.io/webappsec-trusted-types/. +// See https://www.w3.org/TR/trusted-types/. // [link] var TRUSTED_TYPES = false; diff --git a/test/test_browser.py b/test/test_browser.py index f85029b566cac..dd0a3adfe5033 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -1083,7 +1083,7 @@ def test_sdl_joystick_1(self): def test_sdl_joystick_2(self): # Generates events corresponding to the Editor's Draft of the HTML5 Gamepad API. - # https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#idl-def-Gamepad + # https://www.w3.org/TR/gamepad/#dom-gamepad create_file('pre.js', ''' var gamepads = []; // Spoof this function. @@ -1120,7 +1120,7 @@ def test_sdl_joystick_2(self): @requires_graphics_hardware def test_glfw_joystick(self): # Generates events corresponding to the Editor's Draft of the HTML5 Gamepad API. - # https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#idl-def-Gamepad + # https://www.w3.org/TR/gamepad/#dom-gamepad create_file('pre.js', ''' var gamepads = []; // Spoof this function.