Commit graph

27 commits

Author SHA1 Message Date
Gregory Terzian
1d66ea2b27
script: Start rework to better match the specification HTML event loop (#31505)
* Fix the HTML event-loop: add a update the rendering task

add rendering task source

sketch structure to update the rendering

resize steps

composition events

fix warnings in rendering task source

refactor handling of composition events: put window and doc for pipeline on top

set script as user interacting in update the rendering task

fmt

add todos for other steps, put all compositor handling logic in one place

update the rendering: evaluate media queries and report changes

update the rendering: update animations and send events

update the rendering: run animation frames

update the rendering: order docs

put rendering related info on documents map

tidy

update the rendering: add issue numbers to todos

update the rendering: reflow as last step

update the rendering: add todo for top layer removals

note rendering opportunity when ticking animations for testing

fix double borrow crash in css/basic-transition

fix faster reversing of transitions test

undo ordering of docs

bypass not fully-active pipeline task throttling for rendering tasks

ensure tasks are dequed from task queue

prioritize update the rendering task

remove servo media stuff from set activity

tidy

debug

update the rendering: perform microtask checkpoint after task

tidy-up

only run evaluate media queries if resized

re-add evaluation of media queries for each rendering task, re-prioritize rendering tasks, re-add microtask checkpoint for all sequential messages

re-structure resize steps, and their interaction with evaluating media queries and reacting to environment changes

update the rendering: remove reflow call at the end

update webmessaging expectations

update to FAIL /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html

update to FAIL load-pageshow-events-window-open.html

add issue number for ordering of docs

nits

move batching of mouse move event to document info

nits

add doc for mouse move event index

reset mouse move event index when taking pending compositor events

fix replacing mouse move event

nits

* move update the rendering related data to document

* move re-taking of tasks to try_recv

* address nits

* change task queue try_recv into take_tasks_and_recv, with nits

* refactor process_pending_compositor_events

* when updating the rendering, return early if script cannot continue running

* use an instant for the last render opportunity time

* nits

* remove handle_tick_all_animations

* use a vec for pending resize and compositor events

* fix spec links

* Fix a few other nits before landing

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-05-13 09:23:03 +00:00
Daniel Adams
c999d4546c
Implement non-XR Gamepad discovery and input (#31200)
* Create embedder event to send to constellation

* Handle gamepad message in constellation, send to script thread

* Handle GamepadEvent in script thread and dispatch event to document

* Add missing Clones, fix event

* Add gamepad task source

* Adjust GamepadIndex type, remove unused imports

* Add internal getter for gamepads list

* Update gamepad new methods

* Handle gamepad connect and disconnect events

* Proto will be none, no need for HandleObject

* Initialize buttons and axes to standard mapping

* Adjust update type index types

* Update GamepadButton update function

* Adjust Gamepad mapping comments to match spec, add update logic

* Amend comment

* Update button and axis inputs on Updated event

* Add GilRs as gamepad backend in servoshell

* Add spec links, queue gamepad updates on task source

* ./mach fmt

* Fix comment length

* Split out button init, update spec comments

* Move gamepad event handling from document to global

* Map and normalize axes/button values

* Use std::time for gamepad timestamp

* Adjust gamepad handling in event loop

* Move button press/touch check into map+normalize function

- Small change but is more in line with spec

* ./mach fmt

* Update comment spec links and warning messages

* Doc comments -> regular comments

* Add window event handlers for gamepad connect/disconnect

* Adjust gamepad disconnect behavior

* Add missing TODO's, adjust gamepad/gamepadbutton list methods and formatting

* Update button handling from gilrs, add comments

* Enable gamepad pref during WPT tests and update expectations

* Update WPT expectations in meta-legacy-layout
2024-02-17 18:42:31 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00:00
Gregory Terzian
50a7111eb6 impl timer-task-source, dedicated time-out mechanism for service-worker 2019-11-19 14:32:21 +08:00
Keith Yeung
c3b17c1201 begin messageport, transferable objects, impl
Accept transfer argument for StructuredCloneData::write

Allow structured clone reads to return a boolean

Add Transferable trait

Add basic skeletons to MessagePort

Implement transfer and transfer-receiving steps on MessagePort

Use transfer and transfer_receive in StructuredClone callbacks

Implement MessageChannel

Freeze the array object for the MessageEvent ports attribute

Implement transfer argument on window.postMessage

Use ReentrantMutex instead for MessagePortInternal

Accept origin as a parameter in dispatch_jsval

Fix BorrowMut crash with pending_port_message

Detach port on closure and check for detached during transfer

Enable webmessaging tests

fix webidl

fix
2019-10-19 14:12:22 +08:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Simon Sapin
76e59a46d3 Sort use statements 2018-11-06 15:26:02 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
chansuke
7b3cf27c69 Add task source for media element 2018-10-10 22:15:37 +09:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Agustin Chiappe Berrini
5dd6e21c2e Add Websocket task source
According to the doc: https://html.spec.whatwg.org/multipage/web-sockets.html#network

The task source for all tasks queued in the websocket section are the
websocket task source, so this commit also updates those references to
use the appropriate one.
2018-09-08 17:01:27 -04:00
Agustin Chiappe Berrini
e286fdcc53 Add the TaskSourceName to CommonScriptMsg::Task
Update QueuedTaskConversion and the TaskQueue to use it
2018-09-04 09:17:11 -04:00
Gregory Terzian
baef63becd use remote-event task source in EventSource 2018-07-13 13:56:46 +08:00
Gregory Terzian
671627e97e introduce "per task source" ignoring of tasks 2018-07-10 13:42:28 +08:00
Anthony Ramine
6c9fb5ae7a Introduce TaskOnce
Having both TaskBox and TaskOnce allows us to remove the superfluous inner boxing
from CancellableTask<T>.
2017-09-20 10:37:09 +02:00
Anthony Ramine
52527d6f9d Rename Task to TaskBox 2017-09-20 10:07:29 +02:00
Anthony Ramine
f088b708c9 Make Task require Send 2017-09-20 09:40:53 +02:00
Anthony Ramine
46628fba05 Move Task to its own module 2017-09-18 02:47:04 +02:00
Anthony Ramine
56117d3185 Rename Runnable to Task
The changes are:
 * `*Runnable` -> `*Task`;
 * `RunnableMsg` -> `Task`;
 * `RunnableWrapper` -> `TaskCanceller`;
 * `MainThreadRunnable` -> `MainThreadTask`;
 * `wrap_runnable` -> `wrap_task`;
 * `get_runnable_wrapper` -> `task_canceller`;
 * `handler` -> `run`;
 * `main_thread_handler` -> `run_with_script_thread`.
2017-09-16 15:43:26 +02:00
Fernando Jiménez Moreno
52348f1fcc Performance Timeline API 2017-08-17 11:48:34 +02:00
Anthony Ramine
44ca9f3d71 Make TaskSource::queue take a &GlobalScope 2016-10-06 21:35:52 +02:00
Anthony Ramine
514819f37a Introduce GlobalScope::get_runnable_wrapper 2016-10-06 21:35:51 +02:00
Josh Matthews
2aef518ce6 Make task queue API usable from non-main threads. 2016-07-14 13:27:41 -04:00
Connor Brewster
ad30275d04 Move boxing to runnable initialization 2016-07-13 11:10:23 -06:00
Connor Brewster
5f7324a9a5 Make all task source runnables cancellable
Implement all Runnable methods on CancellableRunnable to redirect to their inner runnable
2016-07-13 09:59:51 -06:00
Keith Yeung
cc049515dc Implement user interaction task source 2016-05-11 10:12:25 -04:00
Keith Yeung
3f2cbf0025 Add task_source directory
Use DOMManipulationTaskSource whenever possible
2016-03-10 01:05:53 -05:00