mirror of
https://github.com/servo/servo.git
synced 2025-06-08 08:33:26 +00:00
* 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>
69 lines
1.8 KiB
Rust
69 lines
1.8 KiB
Rust
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
pub mod dom_manipulation;
|
|
pub mod file_reading;
|
|
pub mod gamepad;
|
|
pub mod history_traversal;
|
|
pub mod media_element;
|
|
pub mod networking;
|
|
pub mod performance_timeline;
|
|
pub mod port_message;
|
|
pub mod remote_event;
|
|
pub mod rendering;
|
|
pub mod timer;
|
|
pub mod user_interaction;
|
|
pub mod websocket;
|
|
|
|
use std::result::Result;
|
|
|
|
use enum_iterator::IntoEnumIterator;
|
|
|
|
use crate::dom::globalscope::GlobalScope;
|
|
use crate::task::{TaskCanceller, TaskOnce};
|
|
|
|
// The names of all task sources, used to differentiate TaskCancellers.
|
|
// Note: When adding a task source, update this enum.
|
|
// Note: The HistoryTraversalTaskSource is not part of this,
|
|
// because it doesn't implement TaskSource.
|
|
#[derive(Clone, Eq, Hash, IntoEnumIterator, JSTraceable, PartialEq)]
|
|
pub enum TaskSourceName {
|
|
DOMManipulation,
|
|
FileReading,
|
|
HistoryTraversal,
|
|
Networking,
|
|
PerformanceTimeline,
|
|
PortMessage,
|
|
UserInteraction,
|
|
RemoteEvent,
|
|
/// <https://html.spec.whatwg.org/multipage/#rendering-task-source>
|
|
Rendering,
|
|
MediaElement,
|
|
Websocket,
|
|
Timer,
|
|
/// <https://www.w3.org/TR/gamepad/#dfn-gamepad-task-source>
|
|
Gamepad,
|
|
}
|
|
|
|
impl TaskSourceName {
|
|
pub fn all() -> Vec<TaskSourceName> {
|
|
TaskSourceName::into_enum_iter().collect()
|
|
}
|
|
}
|
|
|
|
pub trait TaskSource {
|
|
const NAME: TaskSourceName;
|
|
|
|
fn queue_with_canceller<T>(&self, task: T, canceller: &TaskCanceller) -> Result<(), ()>
|
|
where
|
|
T: TaskOnce + 'static;
|
|
|
|
fn queue<T>(&self, task: T, global: &GlobalScope) -> Result<(), ()>
|
|
where
|
|
T: TaskOnce + 'static,
|
|
{
|
|
let canceller = global.task_canceller(Self::NAME);
|
|
self.queue_with_canceller(task, &canceller)
|
|
}
|
|
}
|