mirror of
https://github.com/servo/servo.git
synced 2025-07-25 08:10:21 +01:00
cargo fix --edition-idioms
This commit is contained in:
parent
b1fd6237d1
commit
2012be4a8b
203 changed files with 665 additions and 1281 deletions
|
@ -2,12 +2,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
extern crate cmake;
|
||||
extern crate phf_codegen;
|
||||
extern crate phf_shared;
|
||||
extern crate serde_json;
|
||||
|
||||
use serde_json::Value;
|
||||
use cmake;
|
||||
use phf_codegen;
|
||||
use phf_shared;
|
||||
use serde_json::{self, Value};
|
||||
use std::env;
|
||||
use std::fmt;
|
||||
use std::fs::File;
|
||||
|
|
|
@ -32,7 +32,7 @@ impl ScriptChan for SendableWorkerScriptChan {
|
|||
self.sender.send(msg).map_err(|_| ())
|
||||
}
|
||||
|
||||
fn clone(&self) -> Box<ScriptChan + Send> {
|
||||
fn clone(&self) -> Box<dyn ScriptChan + Send> {
|
||||
Box::new(SendableWorkerScriptChan {
|
||||
sender: self.sender.clone(),
|
||||
worker: self.worker.clone(),
|
||||
|
@ -58,7 +58,7 @@ impl ScriptChan for WorkerThreadWorkerChan {
|
|||
self.sender.send(msg).map_err(|_| ())
|
||||
}
|
||||
|
||||
fn clone(&self) -> Box<ScriptChan + Send> {
|
||||
fn clone(&self) -> Box<dyn ScriptChan + Send> {
|
||||
Box::new(WorkerThreadWorkerChan {
|
||||
sender: self.sender.clone(),
|
||||
worker: self.worker.clone(),
|
||||
|
|
|
@ -78,14 +78,14 @@ where
|
|||
pub unsafe trait StableTraceObject {
|
||||
/// Returns a stable trace object which address won't change for the whole
|
||||
/// lifetime of the value.
|
||||
fn stable_trace_object(&self) -> *const JSTraceable;
|
||||
fn stable_trace_object(&self) -> *const dyn JSTraceable;
|
||||
}
|
||||
|
||||
unsafe impl<T> StableTraceObject for Dom<T>
|
||||
where
|
||||
T: DomObject,
|
||||
{
|
||||
fn stable_trace_object<'a>(&'a self) -> *const JSTraceable {
|
||||
fn stable_trace_object<'a>(&'a self) -> *const dyn JSTraceable {
|
||||
// The JSTraceable impl for Reflector doesn't actually do anything,
|
||||
// so we need this shenanigan to actually trace the reflector of the
|
||||
// T pointer in Dom<T>.
|
||||
|
@ -198,7 +198,7 @@ where
|
|||
/// See also [*Exact Stack Rooting - Storing a GCPointer on the CStack*]
|
||||
/// (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/GC/Exact_Stack_Rooting).
|
||||
pub struct RootCollection {
|
||||
roots: UnsafeCell<Vec<*const JSTraceable>>,
|
||||
roots: UnsafeCell<Vec<*const dyn JSTraceable>>,
|
||||
}
|
||||
|
||||
thread_local!(static STACK_ROOTS: Cell<Option<*const RootCollection>> = Cell::new(None));
|
||||
|
@ -228,13 +228,13 @@ impl RootCollection {
|
|||
}
|
||||
|
||||
/// Starts tracking a trace object.
|
||||
unsafe fn root(&self, object: *const JSTraceable) {
|
||||
unsafe fn root(&self, object: *const dyn JSTraceable) {
|
||||
debug_assert!(thread_state::get().is_script());
|
||||
(*self.roots.get()).push(object);
|
||||
}
|
||||
|
||||
/// Stops tracking a trace object, asserting if it isn't found.
|
||||
unsafe fn unroot(&self, object: *const JSTraceable) {
|
||||
unsafe fn unroot(&self, object: *const dyn JSTraceable) {
|
||||
debug_assert!(thread_state::get().is_script());
|
||||
let roots = &mut *self.roots.get();
|
||||
match roots.iter().rposition(|r| *r == object) {
|
||||
|
|
|
@ -375,7 +375,7 @@ unsafe_no_jsmanaged_fields!(usize, u8, u16, u32, u64);
|
|||
unsafe_no_jsmanaged_fields!(isize, i8, i16, i32, i64);
|
||||
unsafe_no_jsmanaged_fields!(Error);
|
||||
unsafe_no_jsmanaged_fields!(ServoUrl, ImmutableOrigin, MutableOrigin);
|
||||
unsafe_no_jsmanaged_fields!(Image, ImageMetadata, ImageCache, PendingImageId);
|
||||
unsafe_no_jsmanaged_fields!(Image, ImageMetadata, dyn ImageCache, PendingImageId);
|
||||
unsafe_no_jsmanaged_fields!(Metadata);
|
||||
unsafe_no_jsmanaged_fields!(NetworkError);
|
||||
unsafe_no_jsmanaged_fields!(Atom, Prefix, LocalName, Namespace, QualName);
|
||||
|
@ -461,7 +461,7 @@ unsafe_no_jsmanaged_fields!(AudioBuffer);
|
|||
unsafe_no_jsmanaged_fields!(AudioContext<Backend>);
|
||||
unsafe_no_jsmanaged_fields!(NodeId);
|
||||
unsafe_no_jsmanaged_fields!(AnalysisEngine, DistanceModel, PanningModel, ParamType);
|
||||
unsafe_no_jsmanaged_fields!(Player<Error = ServoMediaError>);
|
||||
unsafe_no_jsmanaged_fields!(dyn Player<Error = ServoMediaError>);
|
||||
unsafe_no_jsmanaged_fields!(Mutex<MediaFrameRenderer>);
|
||||
unsafe_no_jsmanaged_fields!(RenderApiSender);
|
||||
|
||||
|
@ -497,7 +497,7 @@ where
|
|||
}
|
||||
|
||||
// Safe thanks to the Send bound.
|
||||
unsafe impl JSTraceable for Box<LayoutRPC + Send + 'static> {
|
||||
unsafe impl JSTraceable for Box<dyn LayoutRPC + Send + 'static> {
|
||||
#[inline]
|
||||
unsafe fn trace(&self, _: *mut JSTracer) {
|
||||
// Do nothing
|
||||
|
@ -733,7 +733,7 @@ where
|
|||
|
||||
/// Holds a set of JSTraceables that need to be rooted
|
||||
struct RootedTraceableSet {
|
||||
set: Vec<*const JSTraceable>,
|
||||
set: Vec<*const dyn JSTraceable>,
|
||||
}
|
||||
|
||||
thread_local!(/// TLV Holds a set of JSTraceables that need to be rooted
|
||||
|
@ -744,7 +744,7 @@ impl RootedTraceableSet {
|
|||
RootedTraceableSet { set: vec![] }
|
||||
}
|
||||
|
||||
unsafe fn remove(traceable: *const JSTraceable) {
|
||||
unsafe fn remove(traceable: *const dyn JSTraceable) {
|
||||
ROOTED_TRACEABLES.with(|ref traceables| {
|
||||
let mut traceables = traceables.borrow_mut();
|
||||
let idx = match traceables.set.iter().rposition(|x| *x == traceable) {
|
||||
|
@ -755,7 +755,7 @@ impl RootedTraceableSet {
|
|||
});
|
||||
}
|
||||
|
||||
unsafe fn add(traceable: *const JSTraceable) {
|
||||
unsafe fn add(traceable: *const dyn JSTraceable) {
|
||||
ROOTED_TRACEABLES.with(|ref traceables| {
|
||||
traceables.borrow_mut().set.push(traceable);
|
||||
})
|
||||
|
|
|
@ -269,7 +269,7 @@ impl<T: WeakReferenceable> DerefMut for WeakRefVec<T> {
|
|||
/// An entry of a vector of weak references. Passed to the closure
|
||||
/// given to `WeakRefVec::update`.
|
||||
#[allow_unrooted_interior]
|
||||
pub struct WeakRefEntry<'a, T: WeakReferenceable + 'a> {
|
||||
pub struct WeakRefEntry<'a, T: WeakReferenceable> {
|
||||
vec: &'a mut WeakRefVec<T>,
|
||||
index: &'a mut usize,
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ impl CanvasRenderingContext2D {
|
|||
pub fn new_inherited(
|
||||
global: &GlobalScope,
|
||||
canvas: Option<&HTMLCanvasElement>,
|
||||
image_cache: Arc<ImageCache>,
|
||||
image_cache: Arc<dyn ImageCache>,
|
||||
base_url: ServoUrl,
|
||||
size: Size2D<u32>,
|
||||
) -> CanvasRenderingContext2D {
|
||||
|
|
|
@ -44,25 +44,25 @@ impl CSSRule {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn as_specific(&self) -> &SpecificCSSRule {
|
||||
pub fn as_specific(&self) -> &dyn SpecificCSSRule {
|
||||
if let Some(rule) = self.downcast::<CSSStyleRule>() {
|
||||
rule as &SpecificCSSRule
|
||||
rule as &dyn SpecificCSSRule
|
||||
} else if let Some(rule) = self.downcast::<CSSFontFaceRule>() {
|
||||
rule as &SpecificCSSRule
|
||||
rule as &dyn SpecificCSSRule
|
||||
} else if let Some(rule) = self.downcast::<CSSKeyframesRule>() {
|
||||
rule as &SpecificCSSRule
|
||||
rule as &dyn SpecificCSSRule
|
||||
} else if let Some(rule) = self.downcast::<CSSMediaRule>() {
|
||||
rule as &SpecificCSSRule
|
||||
rule as &dyn SpecificCSSRule
|
||||
} else if let Some(rule) = self.downcast::<CSSNamespaceRule>() {
|
||||
rule as &SpecificCSSRule
|
||||
rule as &dyn SpecificCSSRule
|
||||
} else if let Some(rule) = self.downcast::<CSSViewportRule>() {
|
||||
rule as &SpecificCSSRule
|
||||
rule as &dyn SpecificCSSRule
|
||||
} else if let Some(rule) = self.downcast::<CSSKeyframeRule>() {
|
||||
rule as &SpecificCSSRule
|
||||
rule as &dyn SpecificCSSRule
|
||||
} else if let Some(rule) = self.downcast::<CSSImportRule>() {
|
||||
rule as &SpecificCSSRule
|
||||
rule as &dyn SpecificCSSRule
|
||||
} else if let Some(rule) = self.downcast::<CSSSupportsRule>() {
|
||||
rule as &SpecificCSSRule
|
||||
rule as &dyn SpecificCSSRule
|
||||
} else {
|
||||
unreachable!()
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
worker_url: ServoUrl,
|
||||
from_devtools_receiver: Receiver<DevtoolScriptControlMsg>,
|
||||
runtime: Runtime,
|
||||
parent_sender: Box<ScriptChan + Send>,
|
||||
parent_sender: Box<dyn ScriptChan + Send>,
|
||||
own_sender: Sender<DedicatedWorkerScriptMsg>,
|
||||
receiver: Receiver<DedicatedWorkerScriptMsg>,
|
||||
timer_event_chan: IpcSender<TimerEvent>,
|
||||
|
@ -233,7 +233,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
worker_url: ServoUrl,
|
||||
from_devtools_receiver: Receiver<DevtoolScriptControlMsg>,
|
||||
runtime: Runtime,
|
||||
parent_sender: Box<ScriptChan + Send>,
|
||||
parent_sender: Box<dyn ScriptChan + Send>,
|
||||
own_sender: Sender<DedicatedWorkerScriptMsg>,
|
||||
receiver: Receiver<DedicatedWorkerScriptMsg>,
|
||||
timer_event_chan: IpcSender<TimerEvent>,
|
||||
|
@ -263,7 +263,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
worker_url: ServoUrl,
|
||||
from_devtools_receiver: IpcReceiver<DevtoolScriptControlMsg>,
|
||||
worker: TrustedWorkerAddress,
|
||||
parent_sender: Box<ScriptChan + Send>,
|
||||
parent_sender: Box<dyn ScriptChan + Send>,
|
||||
own_sender: Sender<DedicatedWorkerScriptMsg>,
|
||||
receiver: Receiver<DedicatedWorkerScriptMsg>,
|
||||
worker_load_origin: WorkerScriptLoadOrigin,
|
||||
|
@ -396,14 +396,14 @@ impl DedicatedWorkerGlobalScope {
|
|||
.expect("Thread spawning failed");
|
||||
}
|
||||
|
||||
pub fn script_chan(&self) -> Box<ScriptChan + Send> {
|
||||
pub fn script_chan(&self) -> Box<dyn ScriptChan + Send> {
|
||||
Box::new(WorkerThreadWorkerChan {
|
||||
sender: self.own_sender.clone(),
|
||||
worker: self.worker.borrow().as_ref().unwrap().clone(),
|
||||
})
|
||||
}
|
||||
|
||||
pub fn new_script_pair(&self) -> (Box<ScriptChan + Send>, Box<ScriptPort + Send>) {
|
||||
pub fn new_script_pair(&self) -> (Box<dyn ScriptChan + Send>, Box<dyn ScriptPort + Send>) {
|
||||
let (tx, rx) = channel();
|
||||
let chan = Box::new(SendableWorkerScriptChan {
|
||||
sender: tx,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::cookie_rs;
|
||||
use cookie::Cookie;
|
||||
use crate::document_loader::{DocumentLoader, LoadType};
|
||||
use crate::dom::activation::{synthetic_click_activation, ActivationSource};
|
||||
use crate::dom::attr::Attr;
|
||||
|
@ -3965,12 +3965,11 @@ impl DocumentMethods for Document {
|
|||
return Err(Error::Security);
|
||||
}
|
||||
|
||||
let cookies =
|
||||
if let Some(cookie) = cookie_rs::Cookie::parse(cookie.to_string()).ok().map(Serde) {
|
||||
vec![cookie]
|
||||
} else {
|
||||
vec![]
|
||||
};
|
||||
let cookies = if let Some(cookie) = Cookie::parse(cookie.to_string()).ok().map(Serde) {
|
||||
vec![cookie]
|
||||
} else {
|
||||
vec![]
|
||||
};
|
||||
|
||||
let _ = self
|
||||
.window
|
||||
|
|
|
@ -2579,8 +2579,8 @@ impl ElementMethods for Element {
|
|||
}
|
||||
|
||||
impl VirtualMethods for Element {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<Node>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<Node>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool {
|
||||
|
@ -2941,31 +2941,31 @@ impl<'a> SelectorsElement for DomRoot<Element> {
|
|||
}
|
||||
|
||||
impl Element {
|
||||
pub fn as_maybe_activatable(&self) -> Option<&Activatable> {
|
||||
pub fn as_maybe_activatable(&self) -> Option<&dyn Activatable> {
|
||||
let element = match self.upcast::<Node>().type_id() {
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLInputElement,
|
||||
)) => {
|
||||
let element = self.downcast::<HTMLInputElement>().unwrap();
|
||||
Some(element as &Activatable)
|
||||
Some(element as &dyn Activatable)
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLButtonElement,
|
||||
)) => {
|
||||
let element = self.downcast::<HTMLButtonElement>().unwrap();
|
||||
Some(element as &Activatable)
|
||||
Some(element as &dyn Activatable)
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLAnchorElement,
|
||||
)) => {
|
||||
let element = self.downcast::<HTMLAnchorElement>().unwrap();
|
||||
Some(element as &Activatable)
|
||||
Some(element as &dyn Activatable)
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLLabelElement,
|
||||
)) => {
|
||||
let element = self.downcast::<HTMLLabelElement>().unwrap();
|
||||
Some(element as &Activatable)
|
||||
Some(element as &dyn Activatable)
|
||||
},
|
||||
_ => None,
|
||||
};
|
||||
|
@ -2978,50 +2978,50 @@ impl Element {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn as_stylesheet_owner(&self) -> Option<&StylesheetOwner> {
|
||||
pub fn as_stylesheet_owner(&self) -> Option<&dyn StylesheetOwner> {
|
||||
if let Some(s) = self.downcast::<HTMLStyleElement>() {
|
||||
return Some(s as &StylesheetOwner);
|
||||
return Some(s as &dyn StylesheetOwner);
|
||||
}
|
||||
|
||||
if let Some(l) = self.downcast::<HTMLLinkElement>() {
|
||||
return Some(l as &StylesheetOwner);
|
||||
return Some(l as &dyn StylesheetOwner);
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#category-submit
|
||||
pub fn as_maybe_validatable(&self) -> Option<&Validatable> {
|
||||
pub fn as_maybe_validatable(&self) -> Option<&dyn Validatable> {
|
||||
let element = match self.upcast::<Node>().type_id() {
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLInputElement,
|
||||
)) => {
|
||||
let element = self.downcast::<HTMLInputElement>().unwrap();
|
||||
Some(element as &Validatable)
|
||||
Some(element as &dyn Validatable)
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLButtonElement,
|
||||
)) => {
|
||||
let element = self.downcast::<HTMLButtonElement>().unwrap();
|
||||
Some(element as &Validatable)
|
||||
Some(element as &dyn Validatable)
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLObjectElement,
|
||||
)) => {
|
||||
let element = self.downcast::<HTMLObjectElement>().unwrap();
|
||||
Some(element as &Validatable)
|
||||
Some(element as &dyn Validatable)
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLSelectElement,
|
||||
)) => {
|
||||
let element = self.downcast::<HTMLSelectElement>().unwrap();
|
||||
Some(element as &Validatable)
|
||||
Some(element as &dyn Validatable)
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLTextAreaElement,
|
||||
)) => {
|
||||
let element = self.downcast::<HTMLTextAreaElement>().unwrap();
|
||||
Some(element as &Validatable)
|
||||
Some(element as &dyn Validatable)
|
||||
},
|
||||
_ => None,
|
||||
};
|
||||
|
|
|
@ -733,7 +733,7 @@ impl EventTargetMethods for EventTarget {
|
|||
}
|
||||
|
||||
impl VirtualMethods for EventTarget {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
|
@ -463,7 +463,7 @@ impl GlobalScope {
|
|||
}
|
||||
|
||||
/// `ScriptChan` to send messages to the event loop of this global scope.
|
||||
pub fn script_chan(&self) -> Box<ScriptChan + Send> {
|
||||
pub fn script_chan(&self) -> Box<dyn ScriptChan + Send> {
|
||||
if let Some(window) = self.downcast::<Window>() {
|
||||
return MainThreadScriptChan(window.main_thread_script_chan().clone()).clone();
|
||||
}
|
||||
|
@ -663,7 +663,7 @@ impl GlobalScope {
|
|||
/// Create a new sender/receiver pair that can be used to implement an on-demand
|
||||
/// event loop. Used for implementing web APIs that require blocking semantics
|
||||
/// without resorting to nested event loops.
|
||||
pub fn new_script_pair(&self) -> (Box<ScriptChan + Send>, Box<ScriptPort + Send>) {
|
||||
pub fn new_script_pair(&self) -> (Box<dyn ScriptChan + Send>, Box<dyn ScriptPort + Send>) {
|
||||
if let Some(window) = self.downcast::<Window>() {
|
||||
return window.new_script_pair();
|
||||
}
|
||||
|
|
|
@ -98,8 +98,8 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLAnchorElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
|
||||
|
|
|
@ -285,8 +285,8 @@ impl HTMLAreaElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLAreaElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
|
||||
|
|
|
@ -108,8 +108,8 @@ impl HTMLBaseElementMethods for HTMLBaseElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLBaseElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -135,8 +135,8 @@ impl HTMLBodyElementLayoutHelpers for LayoutDom<HTMLBodyElement> {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLBodyElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool {
|
||||
|
|
|
@ -189,8 +189,8 @@ impl HTMLButtonElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLButtonElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -407,8 +407,8 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLCanvasElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -69,7 +69,10 @@ pub struct HTMLCollection {
|
|||
|
||||
impl HTMLCollection {
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new_inherited(root: &Node, filter: Box<CollectionFilter + 'static>) -> HTMLCollection {
|
||||
pub fn new_inherited(
|
||||
root: &Node,
|
||||
filter: Box<dyn CollectionFilter + 'static>,
|
||||
) -> HTMLCollection {
|
||||
HTMLCollection {
|
||||
reflector_: Reflector::new(),
|
||||
root: Dom::from_ref(root),
|
||||
|
@ -99,7 +102,7 @@ impl HTMLCollection {
|
|||
pub fn new(
|
||||
window: &Window,
|
||||
root: &Node,
|
||||
filter: Box<CollectionFilter + 'static>,
|
||||
filter: Box<dyn CollectionFilter + 'static>,
|
||||
) -> DomRoot<HTMLCollection> {
|
||||
reflect_dom_object(
|
||||
Box::new(HTMLCollection::new_inherited(root, filter)),
|
||||
|
@ -111,7 +114,7 @@ impl HTMLCollection {
|
|||
pub fn create(
|
||||
window: &Window,
|
||||
root: &Node,
|
||||
filter: Box<CollectionFilter + 'static>,
|
||||
filter: Box<dyn CollectionFilter + 'static>,
|
||||
) -> DomRoot<HTMLCollection> {
|
||||
HTMLCollection::new(window, root, filter)
|
||||
}
|
||||
|
|
|
@ -62,8 +62,8 @@ impl HTMLDetailsElementMethods for HTMLDetailsElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLDetailsElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -718,8 +718,8 @@ impl HTMLElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<Element>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<Element>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -95,8 +95,8 @@ impl HTMLFieldSetElementMethods for HTMLFieldSetElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLFieldSetElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -74,8 +74,8 @@ impl HTMLFontElementMethods for HTMLFontElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLFontElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool {
|
||||
|
|
|
@ -25,7 +25,7 @@ pub struct HTMLFormControlsCollection {
|
|||
impl HTMLFormControlsCollection {
|
||||
fn new_inherited(
|
||||
root: &Node,
|
||||
filter: Box<CollectionFilter + 'static>,
|
||||
filter: Box<dyn CollectionFilter + 'static>,
|
||||
) -> HTMLFormControlsCollection {
|
||||
HTMLFormControlsCollection {
|
||||
collection: HTMLCollection::new_inherited(root, filter),
|
||||
|
@ -35,7 +35,7 @@ impl HTMLFormControlsCollection {
|
|||
pub fn new(
|
||||
window: &Window,
|
||||
root: &Node,
|
||||
filter: Box<CollectionFilter + 'static>,
|
||||
filter: Box<dyn CollectionFilter + 'static>,
|
||||
) -> DomRoot<HTMLFormControlsCollection> {
|
||||
reflect_dom_object(
|
||||
Box::new(HTMLFormControlsCollection::new_inherited(root, filter)),
|
||||
|
|
|
@ -1137,8 +1137,8 @@ pub trait FormControl: DomObject {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLFormElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
|
||||
|
@ -1175,44 +1175,44 @@ impl VirtualMethods for HTMLFormElement {
|
|||
}
|
||||
|
||||
pub trait FormControlElementHelpers {
|
||||
fn as_maybe_form_control<'a>(&'a self) -> Option<&'a FormControl>;
|
||||
fn as_maybe_form_control<'a>(&'a self) -> Option<&'a dyn FormControl>;
|
||||
}
|
||||
|
||||
impl FormControlElementHelpers for Element {
|
||||
fn as_maybe_form_control<'a>(&'a self) -> Option<&'a FormControl> {
|
||||
fn as_maybe_form_control<'a>(&'a self) -> Option<&'a dyn FormControl> {
|
||||
let node = self.upcast::<Node>();
|
||||
|
||||
match node.type_id() {
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLButtonElement,
|
||||
)) => Some(self.downcast::<HTMLButtonElement>().unwrap() as &FormControl),
|
||||
)) => Some(self.downcast::<HTMLButtonElement>().unwrap() as &dyn FormControl),
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLFieldSetElement,
|
||||
)) => Some(self.downcast::<HTMLFieldSetElement>().unwrap() as &FormControl),
|
||||
)) => Some(self.downcast::<HTMLFieldSetElement>().unwrap() as &dyn FormControl),
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLImageElement,
|
||||
)) => Some(self.downcast::<HTMLImageElement>().unwrap() as &FormControl),
|
||||
)) => Some(self.downcast::<HTMLImageElement>().unwrap() as &dyn FormControl),
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLInputElement,
|
||||
)) => Some(self.downcast::<HTMLInputElement>().unwrap() as &FormControl),
|
||||
)) => Some(self.downcast::<HTMLInputElement>().unwrap() as &dyn FormControl),
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLLabelElement,
|
||||
)) => Some(self.downcast::<HTMLLabelElement>().unwrap() as &FormControl),
|
||||
)) => Some(self.downcast::<HTMLLabelElement>().unwrap() as &dyn FormControl),
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLLegendElement,
|
||||
)) => Some(self.downcast::<HTMLLegendElement>().unwrap() as &FormControl),
|
||||
)) => Some(self.downcast::<HTMLLegendElement>().unwrap() as &dyn FormControl),
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLObjectElement,
|
||||
)) => Some(self.downcast::<HTMLObjectElement>().unwrap() as &FormControl),
|
||||
)) => Some(self.downcast::<HTMLObjectElement>().unwrap() as &dyn FormControl),
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLOutputElement,
|
||||
)) => Some(self.downcast::<HTMLOutputElement>().unwrap() as &FormControl),
|
||||
)) => Some(self.downcast::<HTMLOutputElement>().unwrap() as &dyn FormControl),
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLSelectElement,
|
||||
)) => Some(self.downcast::<HTMLSelectElement>().unwrap() as &FormControl),
|
||||
)) => Some(self.downcast::<HTMLSelectElement>().unwrap() as &dyn FormControl),
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLTextAreaElement,
|
||||
)) => Some(self.downcast::<HTMLTextAreaElement>().unwrap() as &FormControl),
|
||||
)) => Some(self.downcast::<HTMLTextAreaElement>().unwrap() as &dyn FormControl),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,8 +78,8 @@ impl HTMLHeadElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLHeadElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
fn bind_to_tree(&self, tree_in_doc: bool) {
|
||||
if let Some(ref s) = self.super_type() {
|
||||
|
|
|
@ -95,8 +95,8 @@ impl HTMLHRLayoutHelpers for LayoutDom<HTMLHRElement> {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLHRElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
|
||||
|
|
|
@ -547,8 +547,8 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLIFrameElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -157,7 +157,7 @@ impl HTMLImageElement {
|
|||
/// The context required for asynchronously loading an external image.
|
||||
struct ImageContext {
|
||||
/// Reference to the script thread image cache.
|
||||
image_cache: Arc<ImageCache>,
|
||||
image_cache: Arc<dyn ImageCache>,
|
||||
/// Indicates whether the request failed, and why
|
||||
status: Result<(), NetworkError>,
|
||||
/// The cache ID for this request.
|
||||
|
@ -229,7 +229,7 @@ impl HTMLImageElement {
|
|||
/// Update the current image with a valid URL.
|
||||
fn fetch_image(&self, img_url: &ServoUrl) {
|
||||
fn add_cache_listener_for_element(
|
||||
image_cache: Arc<ImageCache>,
|
||||
image_cache: Arc<dyn ImageCache>,
|
||||
id: PendingImageId,
|
||||
elem: &HTMLImageElement,
|
||||
) {
|
||||
|
@ -979,7 +979,7 @@ impl HTMLImageElement {
|
|||
fn react_to_environment_changes_sync_steps(&self, generation: u32) {
|
||||
// TODO reduce duplicacy of this code
|
||||
fn add_cache_listener_for_element(
|
||||
image_cache: Arc<ImageCache>,
|
||||
image_cache: Arc<dyn ImageCache>,
|
||||
id: PendingImageId,
|
||||
elem: &HTMLImageElement,
|
||||
selected_source: String,
|
||||
|
@ -1576,8 +1576,8 @@ impl HTMLImageElementMethods for HTMLImageElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLImageElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn adopting_steps(&self, old_doc: &Document) {
|
||||
|
|
|
@ -1206,8 +1206,8 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLInputElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -134,8 +134,8 @@ impl HTMLLabelElementMethods for HTMLLabelElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLLabelElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
|
||||
|
|
|
@ -52,8 +52,8 @@ impl HTMLLegendElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLLegendElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn bind_to_tree(&self, tree_in_doc: bool) {
|
||||
|
|
|
@ -54,8 +54,8 @@ impl HTMLLIElementMethods for HTMLLIElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLLIElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
|
||||
|
|
|
@ -177,8 +177,8 @@ fn is_favicon(value: &Option<String>) -> bool {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLLinkElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -1351,8 +1351,8 @@ impl HTMLMediaElementMethods for HTMLMediaElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLMediaElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -171,8 +171,8 @@ impl HTMLMetaElementMethods for HTMLMetaElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLMetaElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn bind_to_tree(&self, tree_in_doc: bool) {
|
||||
|
|
|
@ -114,8 +114,8 @@ impl Validatable for HTMLObjectElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLObjectElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -63,8 +63,8 @@ impl HTMLOptGroupElementMethods for HTMLOptGroupElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLOptGroupElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -194,8 +194,8 @@ impl HTMLOptionElementMethods for HTMLOptionElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLOptionElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -32,7 +32,7 @@ pub struct HTMLOptionsCollection {
|
|||
impl HTMLOptionsCollection {
|
||||
fn new_inherited(
|
||||
select: &HTMLSelectElement,
|
||||
filter: Box<CollectionFilter + 'static>,
|
||||
filter: Box<dyn CollectionFilter + 'static>,
|
||||
) -> HTMLOptionsCollection {
|
||||
HTMLOptionsCollection {
|
||||
collection: HTMLCollection::new_inherited(select.upcast(), filter),
|
||||
|
@ -42,7 +42,7 @@ impl HTMLOptionsCollection {
|
|||
pub fn new(
|
||||
window: &Window,
|
||||
select: &HTMLSelectElement,
|
||||
filter: Box<CollectionFilter + 'static>,
|
||||
filter: Box<dyn CollectionFilter + 'static>,
|
||||
) -> DomRoot<HTMLOptionsCollection> {
|
||||
reflect_dom_object(
|
||||
Box::new(HTMLOptionsCollection::new_inherited(select, filter)),
|
||||
|
|
|
@ -71,8 +71,8 @@ impl HTMLOutputElementMethods for HTMLOutputElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLOutputElement {
|
||||
fn super_type<'b>(&'b self) -> Option<&'b VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type<'b>(&'b self) -> Option<&'b dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -708,8 +708,8 @@ impl HTMLScriptElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLScriptElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -354,8 +354,8 @@ impl HTMLSelectElementMethods for HTMLSelectElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLSelectElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -63,8 +63,8 @@ impl HTMLSourceElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLSourceElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -169,8 +169,8 @@ impl HTMLStyleElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLStyleElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn children_changed(&self, mutation: &ChildrenMutation) {
|
||||
|
|
|
@ -145,8 +145,8 @@ impl HTMLTableCellElementLayoutHelpers for LayoutDom<HTMLTableCellElement> {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLTableCellElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn parse_plain_attribute(&self, local_name: &LocalName, value: DOMString) -> AttrValue {
|
||||
|
|
|
@ -447,8 +447,8 @@ impl HTMLTableElementLayoutHelpers for LayoutDom<HTMLTableElement> {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLTableElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -165,8 +165,8 @@ impl HTMLTableRowElementLayoutHelpers for LayoutDom<HTMLTableRowElement> {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLTableRowElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn parse_plain_attribute(&self, local_name: &LocalName, value: DOMString) -> AttrValue {
|
||||
|
|
|
@ -102,8 +102,8 @@ impl HTMLTableSectionElementLayoutHelpers for LayoutDom<HTMLTableSectionElement>
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLTableSectionElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn parse_plain_attribute(&self, local_name: &LocalName, value: DOMString) -> AttrValue {
|
||||
|
|
|
@ -64,8 +64,8 @@ impl HTMLTemplateElementMethods for HTMLTemplateElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLTemplateElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#template-adopting-steps>
|
||||
|
|
|
@ -386,8 +386,8 @@ impl HTMLTextAreaElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLTextAreaElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -60,8 +60,8 @@ impl HTMLTitleElementMethods for HTMLTitleElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for HTMLTitleElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn children_changed(&self, mutation: &ChildrenMutation) {
|
||||
|
|
|
@ -2616,8 +2616,8 @@ pub fn window_from_node<T: DerivedFrom<Node> + DomObject>(derived: &T) -> DomRoo
|
|||
}
|
||||
|
||||
impl VirtualMethods for Node {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<EventTarget>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<EventTarget>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn children_changed(&self, mutation: &ChildrenMutation) {
|
||||
|
|
|
@ -131,7 +131,7 @@ impl PaintWorkletGlobalScope {
|
|||
unsafe { PaintWorkletGlobalScopeBinding::Wrap(runtime.cx(), global) }
|
||||
}
|
||||
|
||||
pub fn image_cache(&self) -> Arc<ImageCache> {
|
||||
pub fn image_cache(&self) -> Arc<dyn ImageCache> {
|
||||
self.image_cache.clone()
|
||||
}
|
||||
|
||||
|
@ -396,7 +396,7 @@ impl PaintWorkletGlobalScope {
|
|||
}
|
||||
}
|
||||
|
||||
fn painter(&self, name: Atom) -> Box<Painter> {
|
||||
fn painter(&self, name: Atom) -> Box<dyn Painter> {
|
||||
// Rather annoyingly we have to use a mutex here to make the painter Sync.
|
||||
struct WorkletPainter {
|
||||
name: Atom,
|
||||
|
|
|
@ -26,8 +26,8 @@ pub struct PromiseNativeHandler {
|
|||
impl PromiseNativeHandler {
|
||||
pub fn new(
|
||||
global: &GlobalScope,
|
||||
resolve: Option<Box<Callback>>,
|
||||
reject: Option<Box<Callback>>,
|
||||
resolve: Option<Box<dyn Callback>>,
|
||||
reject: Option<Box<dyn Callback>>,
|
||||
) -> DomRoot<PromiseNativeHandler> {
|
||||
reflect_dom_object(
|
||||
Box::new(PromiseNativeHandler {
|
||||
|
@ -40,7 +40,7 @@ impl PromiseNativeHandler {
|
|||
)
|
||||
}
|
||||
|
||||
fn callback(callback: &Option<Box<Callback>>, cx: *mut JSContext, v: HandleValue) {
|
||||
fn callback(callback: &Option<Box<dyn Callback>>, cx: *mut JSContext, v: HandleValue) {
|
||||
if let Some(ref callback) = *callback {
|
||||
callback.callback(cx, v)
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ impl ScriptChan for ServiceWorkerChan {
|
|||
.map_err(|_| ())
|
||||
}
|
||||
|
||||
fn clone(&self) -> Box<ScriptChan + Send> {
|
||||
fn clone(&self) -> Box<dyn ScriptChan + Send> {
|
||||
Box::new(ServiceWorkerChan {
|
||||
sender: self.sender.clone(),
|
||||
})
|
||||
|
@ -412,7 +412,7 @@ impl ServiceWorkerGlobalScope {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn script_chan(&self) -> Box<ScriptChan + Send> {
|
||||
pub fn script_chan(&self) -> Box<dyn ScriptChan + Send> {
|
||||
Box::new(ServiceWorkerChan {
|
||||
sender: self.own_sender.clone(),
|
||||
})
|
||||
|
|
|
@ -29,7 +29,7 @@ impl SVGElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for SVGElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<Element>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<Element>() as &dyn VirtualMethods)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ impl SVGGraphicsElement {
|
|||
}
|
||||
|
||||
impl VirtualMethods for SVGGraphicsElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<SVGElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<SVGElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,8 +75,8 @@ impl LayoutSVGSVGElementHelpers for LayoutDom<SVGSVGElement> {
|
|||
}
|
||||
|
||||
impl VirtualMethods for SVGSVGElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<SVGGraphicsElement>() as &VirtualMethods)
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<SVGGraphicsElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
|
||||
|
|
|
@ -1028,7 +1028,7 @@ impl TestBindingMethods for TestBinding {
|
|||
handler: Rc<SimpleCallback>,
|
||||
}
|
||||
impl SimpleHandler {
|
||||
fn new(callback: Rc<SimpleCallback>) -> Box<Callback> {
|
||||
fn new(callback: Rc<SimpleCallback>) -> Box<dyn Callback> {
|
||||
Box::new(SimpleHandler { handler: callback })
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ use style::attr::AttrValue;
|
|||
pub trait VirtualMethods {
|
||||
/// Returns self as the superclass of the implementation for this trait,
|
||||
/// if any.
|
||||
fn super_type(&self) -> Option<&VirtualMethods>;
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods>;
|
||||
|
||||
/// Called when attributes of a node are mutated.
|
||||
/// <https://dom.spec.whatwg.org/#attribute-is-set>
|
||||
|
@ -152,120 +152,120 @@ pub trait VirtualMethods {
|
|||
/// method call on the trait object will invoke the corresponding method on the
|
||||
/// concrete type, propagating up the parent hierarchy unless otherwise
|
||||
/// interrupted.
|
||||
pub fn vtable_for(node: &Node) -> &VirtualMethods {
|
||||
pub fn vtable_for(node: &Node) -> &dyn VirtualMethods {
|
||||
match node.type_id() {
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAnchorElement)) => {
|
||||
node.downcast::<HTMLAnchorElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLAnchorElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAreaElement)) => {
|
||||
node.downcast::<HTMLAreaElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLAreaElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLBaseElement)) => {
|
||||
node.downcast::<HTMLBaseElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLBaseElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLBodyElement)) => {
|
||||
node.downcast::<HTMLBodyElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLBodyElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLButtonElement)) => {
|
||||
node.downcast::<HTMLButtonElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLButtonElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLCanvasElement)) => {
|
||||
node.downcast::<HTMLCanvasElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLCanvasElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLDetailsElement)) => {
|
||||
node.downcast::<HTMLDetailsElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLDetailsElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLFieldSetElement)) => {
|
||||
node.downcast::<HTMLFieldSetElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLFieldSetElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLFontElement)) => {
|
||||
node.downcast::<HTMLFontElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLFontElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLFormElement)) => {
|
||||
node.downcast::<HTMLFormElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLFormElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLHeadElement)) => {
|
||||
node.downcast::<HTMLHeadElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLHeadElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLHRElement)) => {
|
||||
node.downcast::<HTMLHRElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLHRElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLImageElement)) => {
|
||||
node.downcast::<HTMLImageElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLImageElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLIFrameElement)) => {
|
||||
node.downcast::<HTMLIFrameElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLIFrameElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLInputElement)) => {
|
||||
node.downcast::<HTMLInputElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLInputElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLLabelElement)) => {
|
||||
node.downcast::<HTMLLabelElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLLabelElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLLIElement)) => {
|
||||
node.downcast::<HTMLLIElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLLIElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLLinkElement)) => {
|
||||
node.downcast::<HTMLLinkElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLLinkElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLMediaElement(_))) => {
|
||||
node.downcast::<HTMLMediaElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLMediaElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLMetaElement)) => {
|
||||
node.downcast::<HTMLMetaElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLMetaElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLObjectElement)) => {
|
||||
node.downcast::<HTMLObjectElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLObjectElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLOptGroupElement)) => {
|
||||
node.downcast::<HTMLOptGroupElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLOptGroupElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLOptionElement)) => {
|
||||
node.downcast::<HTMLOptionElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLOptionElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLOutputElement)) => {
|
||||
node.downcast::<HTMLOutputElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLOutputElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLScriptElement)) => {
|
||||
node.downcast::<HTMLScriptElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLScriptElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLSelectElement)) => {
|
||||
node.downcast::<HTMLSelectElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLSelectElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLSourceElement)) => {
|
||||
node.downcast::<HTMLSourceElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLSourceElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLStyleElement)) => {
|
||||
node.downcast::<HTMLStyleElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLStyleElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTableElement)) => {
|
||||
node.downcast::<HTMLTableElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLTableElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLTableCellElement,
|
||||
)) => node.downcast::<HTMLTableCellElement>().unwrap() as &VirtualMethods,
|
||||
)) => node.downcast::<HTMLTableCellElement>().unwrap() as &dyn VirtualMethods,
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTableRowElement)) => {
|
||||
node.downcast::<HTMLTableRowElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLTableRowElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLTableSectionElement,
|
||||
)) => node.downcast::<HTMLTableSectionElement>().unwrap() as &VirtualMethods,
|
||||
)) => node.downcast::<HTMLTableSectionElement>().unwrap() as &dyn VirtualMethods,
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTemplateElement)) => {
|
||||
node.downcast::<HTMLTemplateElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLTemplateElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTextAreaElement)) => {
|
||||
node.downcast::<HTMLTextAreaElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLTextAreaElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTitleElement)) => {
|
||||
node.downcast::<HTMLTitleElement>().unwrap() as &VirtualMethods
|
||||
node.downcast::<HTMLTitleElement>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(ElementTypeId::SVGElement(SVGElementTypeId::SVGGraphicsElement(
|
||||
SVGGraphicsElementTypeId::SVGSVGElement,
|
||||
))) => node.downcast::<SVGSVGElement>().unwrap() as &VirtualMethods,
|
||||
))) => node.downcast::<SVGSVGElement>().unwrap() as &dyn VirtualMethods,
|
||||
NodeTypeId::Element(ElementTypeId::Element) => {
|
||||
node.downcast::<Element>().unwrap() as &VirtualMethods
|
||||
node.downcast::<Element>().unwrap() as &dyn VirtualMethods
|
||||
},
|
||||
NodeTypeId::Element(_) => node.downcast::<HTMLElement>().unwrap() as &VirtualMethods,
|
||||
_ => node as &VirtualMethods,
|
||||
NodeTypeId::Element(_) => node.downcast::<HTMLElement>().unwrap() as &dyn VirtualMethods,
|
||||
_ => node as &dyn VirtualMethods,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ impl WebGLExtensionFeatures {
|
|||
#[must_root]
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
pub struct WebGLExtensions {
|
||||
extensions: DomRefCell<HashMap<String, Box<WebGLExtensionWrapper>>>,
|
||||
extensions: DomRefCell<HashMap<String, Box<dyn WebGLExtensionWrapper>>>,
|
||||
features: DomRefCell<WebGLExtensionFeatures>,
|
||||
webgl_version: WebGLVersion,
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ pub trait WebGLExtensionWrapper: JSTraceable + MallocSizeOf {
|
|||
fn is_enabled(&self) -> bool;
|
||||
fn enable(&self, ext: &WebGLExtensions);
|
||||
fn name(&self) -> &'static str;
|
||||
fn as_any(&self) -> &Any;
|
||||
fn as_any(&self) -> &dyn Any;
|
||||
}
|
||||
|
||||
#[must_root]
|
||||
|
@ -85,7 +85,7 @@ where
|
|||
T::name()
|
||||
}
|
||||
|
||||
fn as_any<'a>(&'a self) -> &'a Any {
|
||||
fn as_any<'a>(&'a self) -> &'a dyn Any {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
|
@ -384,7 +384,7 @@ impl Window {
|
|||
self.networking_task_source.clone()
|
||||
}
|
||||
|
||||
pub fn history_traversal_task_source(&self) -> Box<ScriptChan + Send> {
|
||||
pub fn history_traversal_task_source(&self) -> Box<dyn ScriptChan + Send> {
|
||||
self.history_traversal_task_source.clone()
|
||||
}
|
||||
|
||||
|
@ -412,12 +412,12 @@ impl Window {
|
|||
self.parent_info
|
||||
}
|
||||
|
||||
pub fn new_script_pair(&self) -> (Box<ScriptChan + Send>, Box<ScriptPort + Send>) {
|
||||
pub fn new_script_pair(&self) -> (Box<dyn ScriptChan + Send>, Box<dyn ScriptPort + Send>) {
|
||||
let (tx, rx) = channel();
|
||||
(Box::new(SendableMainThreadScriptChan(tx)), Box::new(rx))
|
||||
}
|
||||
|
||||
pub fn image_cache(&self) -> Arc<ImageCache> {
|
||||
pub fn image_cache(&self) -> Arc<dyn ImageCache> {
|
||||
self.image_cache.clone()
|
||||
}
|
||||
|
||||
|
@ -446,7 +446,7 @@ impl Window {
|
|||
&self.bluetooth_extra_permission_data
|
||||
}
|
||||
|
||||
pub fn css_error_reporter(&self) -> Option<&ParseErrorReporter> {
|
||||
pub fn css_error_reporter(&self) -> Option<&dyn ParseErrorReporter> {
|
||||
Some(&self.error_reporter)
|
||||
}
|
||||
|
||||
|
@ -1641,7 +1641,7 @@ impl Window {
|
|||
)
|
||||
}
|
||||
|
||||
pub fn layout(&self) -> &LayoutRPC {
|
||||
pub fn layout(&self) -> &dyn LayoutRPC {
|
||||
&*self.layout_rpc
|
||||
}
|
||||
|
||||
|
@ -2089,7 +2089,7 @@ impl Window {
|
|||
remote_event_task_source: RemoteEventTaskSource,
|
||||
websocket_task_source: WebsocketTaskSource,
|
||||
image_cache_chan: Sender<ImageCacheMsg>,
|
||||
image_cache: Arc<ImageCache>,
|
||||
image_cache: Arc<dyn ImageCache>,
|
||||
resource_threads: ResourceThreads,
|
||||
bluetooth_thread: IpcSender<BluetoothRequest>,
|
||||
mem_profiler_chan: MemProfilerChan,
|
||||
|
@ -2112,7 +2112,7 @@ impl Window {
|
|||
webrender_document: DocumentId,
|
||||
webrender_api_sender: RenderApiSender,
|
||||
) -> DomRoot<Self> {
|
||||
let layout_rpc: Box<LayoutRPC + Send> = {
|
||||
let layout_rpc: Box<dyn LayoutRPC + Send> = {
|
||||
let (rpc_send, rpc_recv) = channel();
|
||||
layout_chan.send(Msg::GetRPC(rpc_send)).unwrap();
|
||||
rpc_recv.recv().unwrap()
|
||||
|
|
|
@ -408,7 +408,7 @@ impl WorkerGlobalScope {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn script_chan(&self) -> Box<ScriptChan + Send> {
|
||||
pub fn script_chan(&self) -> Box<dyn ScriptChan + Send> {
|
||||
let dedicated = self.downcast::<DedicatedWorkerGlobalScope>();
|
||||
let service_worker = self.downcast::<ServiceWorkerGlobalScope>();
|
||||
if let Some(dedicated) = dedicated {
|
||||
|
@ -444,7 +444,7 @@ impl WorkerGlobalScope {
|
|||
WebsocketTaskSource(self.script_chan(), self.pipeline_id())
|
||||
}
|
||||
|
||||
pub fn new_script_pair(&self) -> (Box<ScriptChan + Send>, Box<ScriptPort + Send>) {
|
||||
pub fn new_script_pair(&self) -> (Box<dyn ScriptChan + Send>, Box<dyn ScriptPort + Send>) {
|
||||
let dedicated = self.downcast::<DedicatedWorkerGlobalScope>();
|
||||
if let Some(dedicated) = dedicated {
|
||||
return dedicated.new_script_pair();
|
||||
|
|
|
@ -93,7 +93,12 @@ impl WorkletGlobalScope {
|
|||
}
|
||||
|
||||
/// Register a paint worklet to the script thread.
|
||||
pub fn register_paint_worklet(&self, name: Atom, properties: Vec<Atom>, painter: Box<Painter>) {
|
||||
pub fn register_paint_worklet(
|
||||
&self,
|
||||
name: Atom,
|
||||
properties: Vec<Atom>,
|
||||
painter: Box<dyn Painter>,
|
||||
) {
|
||||
self.to_script_thread_sender
|
||||
.send(MainThreadScriptMsg::RegisterPaintWorklet {
|
||||
pipeline_id: self.globalscope.pipeline_id(),
|
||||
|
@ -147,7 +152,7 @@ pub struct WorkletGlobalScopeInit {
|
|||
/// Message to send to the scheduler
|
||||
pub scheduler_chan: IpcSender<TimerSchedulerMsg>,
|
||||
/// The image cache
|
||||
pub image_cache: Arc<ImageCache>,
|
||||
pub image_cache: Arc<dyn ImageCache>,
|
||||
}
|
||||
|
||||
/// <https://drafts.css-houdini.org/worklets/#worklet-global-scope-type>
|
||||
|
|
|
@ -21,7 +21,7 @@ use std::sync::{Arc, Mutex};
|
|||
|
||||
struct LayoutImageContext {
|
||||
id: PendingImageId,
|
||||
cache: Arc<ImageCache>,
|
||||
cache: Arc<dyn ImageCache>,
|
||||
}
|
||||
|
||||
impl FetchResponseListener for LayoutImageContext {
|
||||
|
@ -49,7 +49,7 @@ pub fn fetch_image_for_layout(
|
|||
url: ServoUrl,
|
||||
node: &Node,
|
||||
id: PendingImageId,
|
||||
cache: Arc<ImageCache>,
|
||||
cache: Arc<dyn ImageCache>,
|
||||
) {
|
||||
let context = Arc::new(Mutex::new(LayoutImageContext {
|
||||
id: id,
|
||||
|
|
|
@ -17,105 +17,38 @@
|
|||
allow(unknown_lints)
|
||||
)]
|
||||
|
||||
extern crate app_units;
|
||||
#[cfg(any(feature = "webgl_backtrace", feature = "js_backtrace"))]
|
||||
extern crate backtrace;
|
||||
extern crate base64;
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
extern crate bluetooth_traits;
|
||||
extern crate byteorder;
|
||||
extern crate canvas_traits;
|
||||
extern crate caseless;
|
||||
extern crate chrono;
|
||||
extern crate cookie as cookie_rs;
|
||||
#[macro_use]
|
||||
extern crate cssparser;
|
||||
#[macro_use]
|
||||
extern crate deny_public_fields;
|
||||
extern crate devtools_traits;
|
||||
extern crate dom_struct;
|
||||
#[macro_use]
|
||||
extern crate domobject_derive;
|
||||
extern crate embedder_traits;
|
||||
extern crate encoding_rs;
|
||||
#[macro_use]
|
||||
extern crate enum_iterator;
|
||||
extern crate euclid;
|
||||
extern crate fnv;
|
||||
extern crate gleam;
|
||||
extern crate half;
|
||||
extern crate headers_core;
|
||||
extern crate headers_ext;
|
||||
#[macro_use]
|
||||
extern crate html5ever;
|
||||
extern crate http;
|
||||
extern crate hyper;
|
||||
extern crate hyper_serde;
|
||||
extern crate image;
|
||||
extern crate ipc_channel;
|
||||
#[macro_use]
|
||||
extern crate js;
|
||||
#[macro_use]
|
||||
extern crate jstraceable_derive;
|
||||
extern crate keyboard_types;
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
extern crate libc;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
#[macro_use]
|
||||
extern crate malloc_size_of;
|
||||
#[macro_use]
|
||||
extern crate malloc_size_of_derive;
|
||||
extern crate metrics;
|
||||
extern crate mime;
|
||||
extern crate mime_guess;
|
||||
extern crate mitochondria;
|
||||
extern crate mozangle;
|
||||
extern crate msg;
|
||||
extern crate net_traits;
|
||||
extern crate num_traits;
|
||||
extern crate offscreen_gl_context;
|
||||
extern crate parking_lot;
|
||||
extern crate phf;
|
||||
extern crate pixels;
|
||||
#[macro_use]
|
||||
extern crate profile_traits;
|
||||
extern crate ref_filter_map;
|
||||
extern crate ref_slice;
|
||||
extern crate regex;
|
||||
extern crate script_layout_interface;
|
||||
extern crate script_traits;
|
||||
extern crate selectors;
|
||||
extern crate serde;
|
||||
extern crate serde_bytes;
|
||||
extern crate servo_allocator;
|
||||
extern crate servo_arc;
|
||||
#[macro_use]
|
||||
extern crate servo_atoms;
|
||||
#[macro_use]
|
||||
extern crate servo_channel;
|
||||
extern crate servo_config;
|
||||
extern crate servo_geometry;
|
||||
extern crate servo_media;
|
||||
extern crate servo_rand;
|
||||
extern crate servo_url;
|
||||
extern crate smallvec;
|
||||
#[macro_use]
|
||||
extern crate style;
|
||||
extern crate style_traits;
|
||||
extern crate swapper;
|
||||
extern crate time;
|
||||
#[cfg(target_os = "linux")]
|
||||
extern crate tinyfiledialogs;
|
||||
extern crate unicode_segmentation;
|
||||
extern crate url;
|
||||
extern crate utf8;
|
||||
extern crate uuid;
|
||||
extern crate webrender_api;
|
||||
extern crate webvr_traits;
|
||||
extern crate xml5ever;
|
||||
|
||||
#[macro_use]
|
||||
mod task;
|
||||
|
|
|
@ -66,7 +66,7 @@ pub enum CommonScriptMsg {
|
|||
/// Generic message that encapsulates event handling.
|
||||
Task(
|
||||
ScriptThreadEventCategory,
|
||||
Box<TaskBox>,
|
||||
Box<dyn TaskBox>,
|
||||
Option<PipelineId>,
|
||||
TaskSourceName,
|
||||
),
|
||||
|
@ -88,7 +88,7 @@ pub trait ScriptChan: JSTraceable {
|
|||
/// Send a message to the associated event loop.
|
||||
fn send(&self, msg: CommonScriptMsg) -> Result<(), ()>;
|
||||
/// Clone this handle.
|
||||
fn clone(&self) -> Box<ScriptChan + Send>;
|
||||
fn clone(&self) -> Box<dyn ScriptChan + Send>;
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, JSTraceable, PartialEq)]
|
||||
|
@ -539,7 +539,7 @@ unsafe extern "C" fn get_size(obj: *mut JSObject) -> usize {
|
|||
if dom_object.is_null() {
|
||||
return 0;
|
||||
}
|
||||
let mut ops = MallocSizeOfOps::new(::servo_allocator::usable_size, None, None);
|
||||
let mut ops = MallocSizeOfOps::new(servo_allocator::usable_size, None, None);
|
||||
(v.malloc_size_of)(&mut ops, dom_object)
|
||||
},
|
||||
Err(_e) => {
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
//! a page runs its course and the script thread returns to processing events in the main event
|
||||
//! loop.
|
||||
|
||||
extern crate itertools;
|
||||
|
||||
use bluetooth_traits::BluetoothRequest;
|
||||
use canvas_traits::webgl::WebGLPipeline;
|
||||
use crate::devtools;
|
||||
|
@ -94,6 +92,7 @@ use headers_ext::LastModified;
|
|||
use headers_ext::ReferrerPolicy as ReferrerPolicyHeader;
|
||||
use hyper_serde::Serde;
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use itertools;
|
||||
use js::glue::GetWindowProxyClass;
|
||||
use js::jsapi::{JSAutoCompartment, JSContext, JS_SetWrapObjectCallbacks};
|
||||
use js::jsapi::{JSTracer, SetWindowProxyClass};
|
||||
|
@ -260,7 +259,7 @@ pub enum MainThreadScriptMsg {
|
|||
pipeline_id: PipelineId,
|
||||
name: Atom,
|
||||
properties: Vec<Atom>,
|
||||
painter: Box<Painter>,
|
||||
painter: Box<dyn Painter>,
|
||||
},
|
||||
/// Dispatches a job queue.
|
||||
DispatchJobQueue { scope_url: ServoUrl },
|
||||
|
@ -314,7 +313,7 @@ impl QueuedTaskConversion for MainThreadScriptMsg {
|
|||
}
|
||||
}
|
||||
|
||||
impl OpaqueSender<CommonScriptMsg> for Box<ScriptChan + Send> {
|
||||
impl OpaqueSender<CommonScriptMsg> for Box<dyn ScriptChan + Send> {
|
||||
fn send(&self, msg: CommonScriptMsg) {
|
||||
ScriptChan::send(&**self, msg).unwrap();
|
||||
}
|
||||
|
@ -367,7 +366,7 @@ impl ScriptChan for SendableMainThreadScriptChan {
|
|||
self.0.send(msg).map_err(|_| ())
|
||||
}
|
||||
|
||||
fn clone(&self) -> Box<ScriptChan + Send> {
|
||||
fn clone(&self) -> Box<dyn ScriptChan + Send> {
|
||||
Box::new(SendableMainThreadScriptChan((&self.0).clone()))
|
||||
}
|
||||
}
|
||||
|
@ -383,7 +382,7 @@ impl ScriptChan for MainThreadScriptChan {
|
|||
.map_err(|_| ())
|
||||
}
|
||||
|
||||
fn clone(&self) -> Box<ScriptChan + Send> {
|
||||
fn clone(&self) -> Box<dyn ScriptChan + Send> {
|
||||
Box::new(MainThreadScriptChan((&self.0).clone()))
|
||||
}
|
||||
}
|
||||
|
@ -501,7 +500,7 @@ pub struct ScriptThread {
|
|||
/// A job queue for Service Workers keyed by their scope url
|
||||
job_queue_map: Rc<JobQueue>,
|
||||
/// Image cache for this script thread.
|
||||
image_cache: Arc<ImageCache>,
|
||||
image_cache: Arc<dyn ImageCache>,
|
||||
/// A handle to the resource thread. This is an `Arc` to avoid running out of file descriptors if
|
||||
/// there are many iframes.
|
||||
resource_threads: ResourceThreads,
|
||||
|
@ -515,21 +514,21 @@ pub struct ScriptThread {
|
|||
/// events in the event queue.
|
||||
chan: MainThreadScriptChan,
|
||||
|
||||
dom_manipulation_task_sender: Box<ScriptChan>,
|
||||
dom_manipulation_task_sender: Box<dyn ScriptChan>,
|
||||
|
||||
media_element_task_sender: Sender<MainThreadScriptMsg>,
|
||||
|
||||
user_interaction_task_sender: Sender<MainThreadScriptMsg>,
|
||||
|
||||
networking_task_sender: Box<ScriptChan>,
|
||||
networking_task_sender: Box<dyn ScriptChan>,
|
||||
|
||||
history_traversal_task_source: HistoryTraversalTaskSource,
|
||||
|
||||
file_reading_task_sender: Box<ScriptChan>,
|
||||
file_reading_task_sender: Box<dyn ScriptChan>,
|
||||
|
||||
performance_timeline_task_sender: Box<ScriptChan>,
|
||||
performance_timeline_task_sender: Box<dyn ScriptChan>,
|
||||
|
||||
remote_event_task_sender: Box<ScriptChan>,
|
||||
remote_event_task_sender: Box<dyn ScriptChan>,
|
||||
|
||||
/// A channel to hand out to threads that need to respond to a message from the script thread.
|
||||
control_chan: IpcSender<ConstellationControlMsg>,
|
||||
|
@ -913,7 +912,7 @@ impl ScriptThread {
|
|||
pipeline_id: PipelineId,
|
||||
name: Atom,
|
||||
properties: Vec<Atom>,
|
||||
painter: Box<Painter>,
|
||||
painter: Box<dyn Painter>,
|
||||
) {
|
||||
let window = self.documents.borrow().find_window(pipeline_id);
|
||||
let window = match window {
|
||||
|
|
|
@ -65,7 +65,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for TaskBox {
|
||||
impl fmt::Debug for dyn TaskBox {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fmt.debug_tuple(self.name())
|
||||
.field(&format_args!("..."))
|
||||
|
|
|
@ -18,7 +18,7 @@ use std::default::Default;
|
|||
pub type QueuedTask = (
|
||||
Option<TrustedWorkerAddress>,
|
||||
ScriptThreadEventCategory,
|
||||
Box<TaskBox>,
|
||||
Box<dyn TaskBox>,
|
||||
Option<PipelineId>,
|
||||
TaskSourceName,
|
||||
);
|
||||
|
|
|
@ -16,7 +16,7 @@ use std::fmt;
|
|||
use std::result::Result;
|
||||
|
||||
#[derive(JSTraceable)]
|
||||
pub struct DOMManipulationTaskSource(pub Box<ScriptChan + Send>, pub PipelineId);
|
||||
pub struct DOMManipulationTaskSource(pub Box<dyn ScriptChan + Send>, pub PipelineId);
|
||||
|
||||
impl Clone for DOMManipulationTaskSource {
|
||||
fn clone(&self) -> DOMManipulationTaskSource {
|
||||
|
|
|
@ -11,7 +11,7 @@ use msg::constellation_msg::PipelineId;
|
|||
use std::sync::Arc;
|
||||
|
||||
#[derive(JSTraceable)]
|
||||
pub struct FileReadingTaskSource(pub Box<ScriptChan + Send + 'static>, pub PipelineId);
|
||||
pub struct FileReadingTaskSource(pub Box<dyn ScriptChan + Send + 'static>, pub PipelineId);
|
||||
|
||||
impl Clone for FileReadingTaskSource {
|
||||
fn clone(&self) -> FileReadingTaskSource {
|
||||
|
|
|
@ -16,7 +16,7 @@ impl ScriptChan for HistoryTraversalTaskSource {
|
|||
.map_err(|_| ())
|
||||
}
|
||||
|
||||
fn clone(&self) -> Box<ScriptChan + Send> {
|
||||
fn clone(&self) -> Box<dyn ScriptChan + Send> {
|
||||
Box::new(HistoryTraversalTaskSource((&self.0).clone()))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::task_source::{TaskSource, TaskSourceName};
|
|||
use msg::constellation_msg::PipelineId;
|
||||
|
||||
#[derive(JSTraceable)]
|
||||
pub struct NetworkingTaskSource(pub Box<ScriptChan + Send + 'static>, pub PipelineId);
|
||||
pub struct NetworkingTaskSource(pub Box<dyn ScriptChan + Send + 'static>, pub PipelineId);
|
||||
|
||||
impl Clone for NetworkingTaskSource {
|
||||
fn clone(&self) -> NetworkingTaskSource {
|
||||
|
|
|
@ -16,7 +16,7 @@ use std::fmt;
|
|||
use std::result::Result;
|
||||
|
||||
#[derive(JSTraceable)]
|
||||
pub struct PerformanceTimelineTaskSource(pub Box<ScriptChan + Send + 'static>, pub PipelineId);
|
||||
pub struct PerformanceTimelineTaskSource(pub Box<dyn ScriptChan + Send + 'static>, pub PipelineId);
|
||||
|
||||
impl Clone for PerformanceTimelineTaskSource {
|
||||
fn clone(&self) -> PerformanceTimelineTaskSource {
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::task_source::{TaskSource, TaskSourceName};
|
|||
use msg::constellation_msg::PipelineId;
|
||||
|
||||
#[derive(JSTraceable)]
|
||||
pub struct RemoteEventTaskSource(pub Box<ScriptChan + Send + 'static>, pub PipelineId);
|
||||
pub struct RemoteEventTaskSource(pub Box<dyn ScriptChan + Send + 'static>, pub PipelineId);
|
||||
|
||||
impl Clone for RemoteEventTaskSource {
|
||||
fn clone(&self) -> RemoteEventTaskSource {
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::task_source::{TaskSource, TaskSourceName};
|
|||
use msg::constellation_msg::PipelineId;
|
||||
|
||||
#[derive(JSTraceable)]
|
||||
pub struct WebsocketTaskSource(pub Box<ScriptChan + Send + 'static>, pub PipelineId);
|
||||
pub struct WebsocketTaskSource(pub Box<dyn ScriptChan + Send + 'static>, pub PipelineId);
|
||||
|
||||
impl Clone for WebsocketTaskSource {
|
||||
fn clone(&self) -> WebsocketTaskSource {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::cookie_rs::Cookie;
|
||||
use cookie::Cookie;
|
||||
use crate::dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods;
|
||||
use crate::dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods;
|
||||
use crate::dom::bindings::codegen::Bindings::ElementBinding::ElementMethods;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue