mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Auto merge of #20083 - yurket:19840_enable_css_pain_api_and_remove_forked_duplicates, r=jdm
enable css paint api and remove forked duplicates 1) Move paintWorklet from "Window" to "CSS" according to new specification; 2) Enable WPT css-paint-api tests from upstream and remove forked duplicates from mozilla folder - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #19840 - [X] These changes do not require tests because the change was made in tests it-selves <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20083) <!-- Reviewable:end -->
This commit is contained in:
commit
a0e340d68f
133 changed files with 86 additions and 4351 deletions
|
@ -6,8 +6,10 @@ use cssparser::{Parser, ParserInput, serialize_identifier};
|
|||
use dom::bindings::codegen::Bindings::WindowBinding::WindowBinding::WindowMethods;
|
||||
use dom::bindings::error::Fallible;
|
||||
use dom::bindings::reflector::Reflector;
|
||||
use dom::bindings::root::DomRoot;
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::window::Window;
|
||||
use dom::worklet::Worklet;
|
||||
use dom_struct::dom_struct;
|
||||
use style::context::QuirksMode;
|
||||
use style::parser::ParserContext;
|
||||
|
@ -63,4 +65,9 @@ impl CSS {
|
|||
false
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://drafts.css-houdini.org/css-paint-api-1/#paint-worklet>
|
||||
pub fn PaintWorklet(win: &Window) -> DomRoot<Worklet> {
|
||||
win.paint_worklet()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,3 +17,8 @@ partial interface CSS {
|
|||
static boolean supports(DOMString property, DOMString value);
|
||||
static boolean supports(DOMString conditionText);
|
||||
};
|
||||
|
||||
// https://drafts.css-houdini.org/css-paint-api-1/#paint-worklet
|
||||
partial interface CSS {
|
||||
[SameObject, Pref="dom.worklet.enabled"] static readonly attribute Worklet paintWorklet;
|
||||
};
|
||||
|
|
|
@ -196,8 +196,3 @@ partial interface Window {
|
|||
readonly attribute TestRunner testRunner;
|
||||
//readonly attribute EventSender eventSender;
|
||||
};
|
||||
|
||||
// https://drafts.css-houdini.org/css-paint-api-1/#paint-worklet
|
||||
partial interface Window {
|
||||
[SameObject, Pref="dom.worklet.enabled"] readonly attribute Worklet paintWorklet;
|
||||
};
|
||||
|
|
|
@ -1022,17 +1022,17 @@ impl WindowMethods for Window {
|
|||
fetch::Fetch(&self.upcast(), input, init)
|
||||
}
|
||||
|
||||
// https://drafts.css-houdini.org/css-paint-api-1/#paint-worklet
|
||||
fn PaintWorklet(&self) -> DomRoot<Worklet> {
|
||||
self.paint_worklet.or_init(|| self.new_paint_worklet())
|
||||
}
|
||||
|
||||
fn TestRunner(&self) -> DomRoot<TestRunner> {
|
||||
self.test_runner.or_init(|| TestRunner::new(self.upcast()))
|
||||
}
|
||||
}
|
||||
|
||||
impl Window {
|
||||
// https://drafts.css-houdini.org/css-paint-api-1/#paint-worklet
|
||||
pub fn paint_worklet(&self) -> DomRoot<Worklet> {
|
||||
self.paint_worklet.or_init(|| self.new_paint_worklet())
|
||||
}
|
||||
|
||||
pub fn task_canceller(&self) -> TaskCanceller {
|
||||
TaskCanceller {
|
||||
cancelled: Some(self.ignore_further_async_events.borrow().clone()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue