aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
Diffstat (limited to 'components/script')
-rw-r--r--components/script/animation_timeline.rs1
-rw-r--r--components/script/animations.rs1
-rw-r--r--components/script/dom/abstractworkerglobalscope.rs2
-rw-r--r--components/script/dom/attr.rs2
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py2
-rw-r--r--components/script/dom/bindings/htmlconstructor.rs2
-rw-r--r--components/script/dom/bindings/str.rs1
-rw-r--r--components/script/dom/bindings/xmlname.rs2
-rw-r--r--components/script/dom/create.rs2
-rw-r--r--components/script/dom/cssrulelist.rs2
-rw-r--r--components/script/dom/cssstyledeclaration.rs3
-rw-r--r--components/script/dom/customelementregistry.rs2
-rw-r--r--components/script/dom/document.rs4
-rw-r--r--components/script/dom/domimplementation.rs1
-rw-r--r--components/script/dom/domtokenlist.rs2
-rw-r--r--components/script/dom/element.rs5
-rw-r--r--components/script/dom/eventtarget.rs1
-rw-r--r--components/script/dom/htmlanchorelement.rs2
-rw-r--r--components/script/dom/htmlareaelement.rs3
-rw-r--r--components/script/dom/htmlaudioelement.rs2
-rw-r--r--components/script/dom/htmlbaseelement.rs2
-rw-r--r--components/script/dom/htmlbodyelement.rs2
-rwxr-xr-xcomponents/script/dom/htmlbuttonelement.rs2
-rw-r--r--components/script/dom/htmlcanvaselement.rs2
-rw-r--r--components/script/dom/htmlcollection.rs2
-rw-r--r--components/script/dom/htmldetailselement.rs2
-rw-r--r--components/script/dom/htmldialogelement.rs2
-rw-r--r--components/script/dom/htmlelement.rs2
-rw-r--r--components/script/dom/htmlfieldsetelement.rs2
-rw-r--r--components/script/dom/htmlfontelement.rs2
-rw-r--r--components/script/dom/htmlformelement.rs2
-rw-r--r--components/script/dom/htmlheadelement.rs2
-rw-r--r--components/script/dom/htmlhrelement.rs2
-rw-r--r--components/script/dom/htmliframeelement.rs3
-rw-r--r--components/script/dom/htmlimageelement.rs2
-rwxr-xr-xcomponents/script/dom/htmlinputelement.rs2
-rw-r--r--components/script/dom/htmllabelelement.rs2
-rw-r--r--components/script/dom/htmllielement.rs2
-rw-r--r--components/script/dom/htmllinkelement.rs2
-rw-r--r--components/script/dom/htmlmediaelement.rs2
-rwxr-xr-xcomponents/script/dom/htmlobjectelement.rs2
-rw-r--r--components/script/dom/htmloptgroupelement.rs2
-rw-r--r--components/script/dom/htmloptionelement.rs2
-rw-r--r--components/script/dom/htmloptionscollection.rs1
-rw-r--r--components/script/dom/htmloutputelement.rs2
-rw-r--r--components/script/dom/htmlprogresselement.rs2
-rw-r--r--components/script/dom/htmlscriptelement.rs2
-rwxr-xr-xcomponents/script/dom/htmlselectelement.rs2
-rw-r--r--components/script/dom/htmlsourceelement.rs2
-rw-r--r--components/script/dom/htmlstyleelement.rs2
-rw-r--r--components/script/dom/htmltablecellelement.rs2
-rw-r--r--components/script/dom/htmltableelement.rs2
-rw-r--r--components/script/dom/htmltablerowelement.rs2
-rw-r--r--components/script/dom/htmltablesectionelement.rs2
-rwxr-xr-xcomponents/script/dom/htmltextareaelement.rs2
-rw-r--r--components/script/dom/htmltrackelement.rs2
-rw-r--r--components/script/dom/htmlvideoelement.rs2
-rw-r--r--components/script/dom/macros.rs36
-rw-r--r--components/script/dom/mutationobserver.rs2
-rw-r--r--components/script/dom/node.rs4
-rw-r--r--components/script/dom/range.rs1
-rw-r--r--components/script/dom/request.rs1
-rw-r--r--components/script/dom/servoparser/async_html.rs4
-rw-r--r--components/script/dom/servoparser/mod.rs2
-rw-r--r--components/script/dom/servoparser/prefetch.rs2
-rw-r--r--components/script/dom/svgelement.rs2
-rw-r--r--components/script/dom/svgsvgelement.rs2
-rwxr-xr-xcomponents/script/dom/validitystate.rs1
-rw-r--r--components/script/dom/webgl_validations/types.rs1
-rw-r--r--components/script/dom/webglrenderingcontext.rs1
-rw-r--r--components/script/dom/window.rs2
-rw-r--r--components/script/dom/windowproxy.rs2
-rw-r--r--components/script/dom/worklet.rs1
-rw-r--r--components/script/layout_dom/element.rs2
-rw-r--r--components/script/layout_dom/node.rs1
-rw-r--r--components/script/lib.rs23
-rw-r--r--components/script/script_module.rs1
-rw-r--r--components/script/script_runtime.rs2
-rw-r--r--components/script/script_thread.rs3
-rw-r--r--components/script/serviceworker_manager.rs2
-rw-r--r--components/script/timers.rs1
-rw-r--r--components/script/window_named_properties.rs2
82 files changed, 114 insertions, 103 deletions
diff --git a/components/script/animation_timeline.rs b/components/script/animation_timeline.rs
index 54127b94e9e..ea2a88af380 100644
--- a/components/script/animation_timeline.rs
+++ b/components/script/animation_timeline.rs
@@ -7,6 +7,7 @@
//! A timeline module, used to specify an `AnimationTimeline` which determines
//! the time used for synchronizing animations in the script thread.
+use jstraceable_derive::JSTraceable;
use time;
/// A `AnimationTimeline` which is used to synchronize animations during the script
diff --git a/components/script/animations.rs b/components/script/animations.rs
index 531d941d6f9..752deb5c9b4 100644
--- a/components/script/animations.rs
+++ b/components/script/animations.rs
@@ -23,6 +23,7 @@ use fxhash::{FxHashMap, FxHashSet};
use libc::c_void;
use msg::constellation_msg::PipelineId;
use script_traits::{AnimationState as AnimationsPresentState, ScriptMsg, UntrustedNodeAddress};
+use serde::{Deserialize, Serialize};
use std::cell::Cell;
use style::animation::{
Animation, AnimationSetKey, AnimationState, DocumentAnimationSet, ElementAnimationSet,
diff --git a/components/script/dom/abstractworkerglobalscope.rs b/components/script/dom/abstractworkerglobalscope.rs
index 0bf298e1a4e..0261c82996c 100644
--- a/components/script/dom/abstractworkerglobalscope.rs
+++ b/components/script/dom/abstractworkerglobalscope.rs
@@ -12,7 +12,7 @@ use crate::dom::workerglobalscope::WorkerGlobalScope;
use crate::realms::enter_realm;
use crate::script_runtime::{CommonScriptMsg, ScriptChan, ScriptPort};
use crate::task_queue::{QueuedTaskConversion, TaskQueue};
-use crossbeam_channel::{Receiver, Sender};
+use crossbeam_channel::{select, Receiver, Sender};
use devtools_traits::DevtoolScriptControlMsg;
/// A ScriptChan that can be cloned freely and will silently send a TrustedWorkerAddress with
diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs
index 2ad3d60bbbd..e8fce0493bc 100644
--- a/components/script/dom/attr.rs
+++ b/components/script/dom/attr.rs
@@ -16,7 +16,7 @@ use crate::dom::virtualmethods::vtable_for;
use crate::script_thread::ScriptThread;
use devtools_traits::AttrInfo;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Namespace, Prefix};
+use html5ever::{namespace_url, ns, LocalName, Namespace, Prefix};
use servo_atoms::Atom;
use std::borrow::ToOwned;
use std::mem;
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 37cf8385d87..6676e977737 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -8040,7 +8040,7 @@ class GlobalGenRoots():
CGGeneric("const %s = %#x;" % args)
for args in flags
], "\n")), pre="#[derive(Clone, Copy)]\npub struct Globals: u8 {\n", post="\n}")
- globals_ = CGWrapper(CGIndenter(global_flags), pre="bitflags! {\n", post="\n}")
+ globals_ = CGWrapper(CGIndenter(global_flags), pre="bitflags::bitflags! {\n", post="\n}")
phf = CGGeneric("include!(concat!(env!(\"OUT_DIR\"), \"/InterfaceObjectMapPhf.rs\"));")
diff --git a/components/script/dom/bindings/htmlconstructor.rs b/components/script/dom/bindings/htmlconstructor.rs
index 8a16cf2e6de..9a2c037de46 100644
--- a/components/script/dom/bindings/htmlconstructor.rs
+++ b/components/script/dom/bindings/htmlconstructor.rs
@@ -84,7 +84,7 @@ use crate::dom::window::Window;
use crate::script_runtime::JSContext;
use crate::script_thread::ScriptThread;
use html5ever::interface::QualName;
-use html5ever::LocalName;
+use html5ever::{local_name, namespace_url, ns, LocalName};
use js::conversions::ToJSValConvertible;
use js::glue::{UnwrapObjectDynamic, UnwrapObjectStatic};
use js::jsapi::{CallArgs, CurrentGlobalOrNull};
diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs
index 2a9a974bac9..ef772ce355c 100644
--- a/components/script/dom/bindings/str.rs
+++ b/components/script/dom/bindings/str.rs
@@ -7,6 +7,7 @@ use chrono::prelude::{Utc, Weekday};
use chrono::{Datelike, TimeZone};
use cssparser::CowRcStr;
use html5ever::{LocalName, Namespace};
+use lazy_static::lazy_static;
use regex::Regex;
use servo_atoms::Atom;
use std::borrow::{Borrow, Cow, ToOwned};
diff --git a/components/script/dom/bindings/xmlname.rs b/components/script/dom/bindings/xmlname.rs
index b4e6aab289f..672f8c522b3 100644
--- a/components/script/dom/bindings/xmlname.rs
+++ b/components/script/dom/bindings/xmlname.rs
@@ -6,7 +6,7 @@
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
use crate::dom::bindings::str::DOMString;
-use html5ever::{LocalName, Namespace, Prefix};
+use html5ever::{namespace_url, ns, LocalName, Namespace, Prefix};
/// Validate a qualified name. See https://dom.spec.whatwg.org/#validate for details.
pub fn validate_qualified_name(qualified_name: &str) -> ErrorResult {
diff --git a/components/script/dom/create.rs b/components/script/dom/create.rs
index 087148cb037..48064fe2f3e 100644
--- a/components/script/dom/create.rs
+++ b/components/script/dom/create.rs
@@ -84,7 +84,7 @@ use crate::dom::svgelement::SVGElement;
use crate::dom::svgsvgelement::SVGSVGElement;
use crate::realms::{enter_realm, InRealm};
use crate::script_thread::ScriptThread;
-use html5ever::{LocalName, Prefix, QualName};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix, QualName};
use js::rust::HandleObject;
use servo_config::pref;
diff --git a/components/script/dom/cssrulelist.rs b/components/script/dom/cssrulelist.rs
index 0734f46abd1..df0ab6134e9 100644
--- a/components/script/dom/cssrulelist.rs
+++ b/components/script/dom/cssrulelist.rs
@@ -14,11 +14,11 @@ use crate::dom::cssrule::CSSRule;
use crate::dom::cssstylesheet::CSSStyleSheet;
use crate::dom::htmlelement::HTMLElement;
use crate::dom::window::Window;
-use crate::style::stylesheets::StylesheetLoader as StyleStylesheetLoader;
use crate::stylesheet_loader::StylesheetLoader;
use dom_struct::dom_struct;
use servo_arc::Arc;
use style::shared_lock::Locked;
+use style::stylesheets::StylesheetLoader as StyleStylesheetLoader;
use style::stylesheets::{
AllowImportRules, CssRules, CssRulesHelpers, KeyframesRule, RulesMutateError,
};
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs
index a2cc459d94c..0e4e541ecf2 100644
--- a/components/script/dom/cssstyledeclaration.rs
+++ b/components/script/dom/cssstyledeclaration.rs
@@ -14,6 +14,7 @@ use crate::dom::element::Element;
use crate::dom::node::{document_from_node, stylesheets_owner_from_node, window_from_node, Node};
use crate::dom::window::Window;
use dom_struct::dom_struct;
+use html5ever::local_name;
use servo_arc::Arc;
use servo_url::ServoUrl;
use style::attr::AttrValue;
@@ -475,5 +476,5 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
}
// https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-_camel_cased_attribute
- css_properties_accessors!(css_properties);
+ style::css_properties_accessors!(css_properties);
}
diff --git a/components/script/dom/customelementregistry.rs b/components/script/dom/customelementregistry.rs
index ba36a2d30df..9439e7e95bc 100644
--- a/components/script/dom/customelementregistry.rs
+++ b/components/script/dom/customelementregistry.rs
@@ -34,7 +34,7 @@ use crate::realms::{enter_realm, InRealm};
use crate::script_runtime::JSContext;
use crate::script_thread::ScriptThread;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Namespace, Prefix};
+use html5ever::{namespace_url, ns, LocalName, Namespace, Prefix};
use js::conversions::ToJSValConvertible;
use js::glue::UnwrapObjectStatic;
use js::jsapi::{HandleValueArray, Heap, IsCallable, IsConstructor};
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index c3d83be6966..c34ed1128d0 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -114,17 +114,19 @@ use crate::timers::OneshotTimerCallback;
use canvas_traits::webgl::{self, WebGLContextId, WebGLMsg};
use content_security_policy::{self as csp, CspList};
use cookie::Cookie;
+use cssparser::{_cssparser_internal_to_lowercase, match_ignore_ascii_case};
use devtools_traits::ScriptToDevtoolsControlMsg;
use dom_struct::dom_struct;
use embedder_traits::EmbedderMsg;
use encoding_rs::{Encoding, UTF_8};
use euclid::default::{Point2D, Rect, Size2D};
-use html5ever::{LocalName, Namespace, QualName};
+use html5ever::{local_name, namespace_url, ns, LocalName, Namespace, QualName};
use hyper_serde::Serde;
use ipc_channel::ipc::{self, IpcSender};
use js::jsapi::JSObject;
use js::rust::HandleObject;
use keyboard_types::{Code, Key, KeyState};
+use lazy_static::lazy_static;
use metrics::{
InteractiveFlag, InteractiveMetrics, InteractiveWindow, ProfilerMetadataFactory,
ProgressiveWebMetric,
diff --git a/components/script/dom/domimplementation.rs b/components/script/dom/domimplementation.rs
index 1a07c1b5e8c..95a62b19efa 100644
--- a/components/script/dom/domimplementation.rs
+++ b/components/script/dom/domimplementation.rs
@@ -26,6 +26,7 @@ use crate::dom::node::Node;
use crate::dom::text::Text;
use crate::dom::xmldocument::XMLDocument;
use dom_struct::dom_struct;
+use html5ever::{local_name, namespace_url, ns};
use script_traits::DocumentActivity;
// https://dom.spec.whatwg.org/#domimplementation
diff --git a/components/script/dom/domtokenlist.rs b/components/script/dom/domtokenlist.rs
index 1e01cea8070..0d8b4908f53 100644
--- a/components/script/dom/domtokenlist.rs
+++ b/components/script/dom/domtokenlist.rs
@@ -11,7 +11,7 @@ use crate::dom::bindings::str::DOMString;
use crate::dom::element::Element;
use crate::dom::node::window_from_node;
use dom_struct::dom_struct;
-use html5ever::LocalName;
+use html5ever::{namespace_url, ns, LocalName};
use servo_atoms::Atom;
use style::str::HTML_SPACE_CHARACTERS;
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index ed04d2e562c..ecbc3c8c097 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -84,6 +84,7 @@ use crate::dom::window::ReflowReason;
use crate::script_thread::ScriptThread;
use crate::stylesheet_loader::StylesheetOwner;
use crate::task::TaskOnce;
+use cssparser::{_cssparser_internal_to_lowercase, match_ignore_ascii_case};
use devtools_traits::AttrInfo;
use dom_struct::dom_struct;
use euclid::default::Rect;
@@ -92,7 +93,9 @@ use html5ever::serialize;
use html5ever::serialize::SerializeOpts;
use html5ever::serialize::TraversalScope;
use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode};
-use html5ever::{LocalName, Namespace, Prefix, QualName};
+use html5ever::{
+ local_name, namespace_prefix, namespace_url, ns, LocalName, Namespace, Prefix, QualName,
+};
use js::jsapi::Heap;
use js::jsval::JSVal;
use js::rust::HandleObject;
diff --git a/components/script/dom/eventtarget.rs b/components/script/dom/eventtarget.rs
index dde317955cc..83180485ec1 100644
--- a/components/script/dom/eventtarget.rs
+++ b/components/script/dom/eventtarget.rs
@@ -34,6 +34,7 @@ use crate::dom::virtualmethods::VirtualMethods;
use crate::dom::window::Window;
use crate::dom::workerglobalscope::WorkerGlobalScope;
use crate::realms::{enter_realm, InRealm};
+use deny_public_fields::DenyPublicFields;
use dom_struct::dom_struct;
use fnv::FnvHasher;
use js::jsapi::JS_GetFunctionObject;
diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs
index d52ab647509..c16b55b88fb 100644
--- a/components/script/dom/htmlanchorelement.rs
+++ b/components/script/dom/htmlanchorelement.rs
@@ -28,7 +28,7 @@ use crate::dom::urlhelper::UrlHelper;
use crate::dom::virtualmethods::VirtualMethods;
use crate::task_source::TaskSource;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use net_traits::request::Referrer;
use num_traits::ToPrimitive;
diff --git a/components/script/dom/htmlareaelement.rs b/components/script/dom/htmlareaelement.rs
index 0df17d1b857..5a3a3e645b4 100644
--- a/components/script/dom/htmlareaelement.rs
+++ b/components/script/dom/htmlareaelement.rs
@@ -16,9 +16,10 @@ use crate::dom::htmlanchorelement::follow_hyperlink;
use crate::dom::htmlelement::HTMLElement;
use crate::dom::node::Node;
use crate::dom::virtualmethods::VirtualMethods;
+use cssparser::{_cssparser_internal_to_lowercase, match_ignore_ascii_case};
use dom_struct::dom_struct;
use euclid::default::Point2D;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, LocalName, Prefix};
use js::rust::HandleObject;
use servo_atoms::Atom;
use std::default::Default;
diff --git a/components/script/dom/htmlaudioelement.rs b/components/script/dom/htmlaudioelement.rs
index 1a2de74832e..7040dd80b59 100644
--- a/components/script/dom/htmlaudioelement.rs
+++ b/components/script/dom/htmlaudioelement.rs
@@ -14,7 +14,7 @@ use crate::dom::htmlmediaelement::HTMLMediaElement;
use crate::dom::node::Node;
use crate::dom::window::Window;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix, QualName};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix, QualName};
use js::rust::HandleObject;
#[dom_struct]
diff --git a/components/script/dom/htmlbaseelement.rs b/components/script/dom/htmlbaseelement.rs
index 29fd459458a..72e8ab85a08 100644
--- a/components/script/dom/htmlbaseelement.rs
+++ b/components/script/dom/htmlbaseelement.rs
@@ -13,7 +13,7 @@ use crate::dom::htmlelement::HTMLElement;
use crate::dom::node::{document_from_node, BindContext, Node, UnbindContext};
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use servo_url::ServoUrl;
diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs
index d3408db6386..28587611603 100644
--- a/components/script/dom/htmlbodyelement.rs
+++ b/components/script/dom/htmlbodyelement.rs
@@ -17,7 +17,7 @@ use crate::dom::virtualmethods::VirtualMethods;
use cssparser::RGBA;
use dom_struct::dom_struct;
use embedder_traits::EmbedderMsg;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use servo_url::ServoUrl;
use style::attr::AttrValue;
diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs
index 14f5d6abcaf..59abe891603 100755
--- a/components/script/dom/htmlbuttonelement.rs
+++ b/components/script/dom/htmlbuttonelement.rs
@@ -23,7 +23,7 @@ use crate::dom::validation::{is_barred_by_datalist_ancestor, Validatable};
use crate::dom::validitystate::{ValidationFlags, ValidityState};
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, LocalName, Prefix};
use js::rust::HandleObject;
use std::cell::Cell;
use std::default::Default;
diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs
index c5d46f3f42c..03c4061938e 100644
--- a/components/script/dom/htmlcanvaselement.rs
+++ b/components/script/dom/htmlcanvaselement.rs
@@ -35,7 +35,7 @@ use canvas_traits::canvas::{CanvasId, CanvasMsg, FromScriptMsg};
use canvas_traits::webgl::{GLContextAttributes, WebGLVersion};
use dom_struct::dom_struct;
use euclid::default::{Rect, Size2D};
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use image::codecs::png::PngEncoder;
use image::{ColorType, ImageEncoder};
use ipc_channel::ipc::{self as ipcchan, IpcSharedMemory};
diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs
index 02a225fb9b6..8bf1135ed73 100644
--- a/components/script/dom/htmlcollection.rs
+++ b/components/script/dom/htmlcollection.rs
@@ -13,7 +13,7 @@ use crate::dom::element::Element;
use crate::dom::node::{document_from_node, Node};
use crate::dom::window::Window;
use dom_struct::dom_struct;
-use html5ever::{LocalName, QualName};
+use html5ever::{local_name, namespace_url, ns, LocalName, QualName};
use servo_atoms::Atom;
use std::cell::Cell;
use style::str::split_html_space_chars;
diff --git a/components/script/dom/htmldetailselement.rs b/components/script/dom/htmldetailselement.rs
index 6996164fe00..bec0e4dbbf6 100644
--- a/components/script/dom/htmldetailselement.rs
+++ b/components/script/dom/htmldetailselement.rs
@@ -15,7 +15,7 @@ use crate::dom::node::{window_from_node, Node, NodeDamage};
use crate::dom::virtualmethods::VirtualMethods;
use crate::task_source::TaskSource;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, LocalName, Prefix};
use js::rust::HandleObject;
use std::cell::Cell;
diff --git a/components/script/dom/htmldialogelement.rs b/components/script/dom/htmldialogelement.rs
index b907e3d3912..88d4cc545f5 100644
--- a/components/script/dom/htmldialogelement.rs
+++ b/components/script/dom/htmldialogelement.rs
@@ -13,7 +13,7 @@ use crate::dom::eventtarget::EventTarget;
use crate::dom::htmlelement::HTMLElement;
use crate::dom::node::{window_from_node, Node};
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
#[dom_struct]
diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs
index c2c2bb29a7f..abfcb4f6151 100644
--- a/components/script/dom/htmlelement.rs
+++ b/components/script/dom/htmlelement.rs
@@ -35,7 +35,7 @@ use crate::dom::node::{Node, ShadowIncluding};
use crate::dom::text::Text;
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use script_layout_interface::message::QueryMsg;
use std::collections::HashSet;
diff --git a/components/script/dom/htmlfieldsetelement.rs b/components/script/dom/htmlfieldsetelement.rs
index 1b7f325425a..881bf0d64b4 100644
--- a/components/script/dom/htmlfieldsetelement.rs
+++ b/components/script/dom/htmlfieldsetelement.rs
@@ -18,7 +18,7 @@ use crate::dom::validation::Validatable;
use crate::dom::validitystate::ValidityState;
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, LocalName, Prefix};
use js::rust::HandleObject;
use std::default::Default;
use style::element_state::ElementState;
diff --git a/components/script/dom/htmlfontelement.rs b/components/script/dom/htmlfontelement.rs
index 8ec432cf504..453a1d5c96f 100644
--- a/components/script/dom/htmlfontelement.rs
+++ b/components/script/dom/htmlfontelement.rs
@@ -14,7 +14,7 @@ use crate::dom::node::Node;
use crate::dom::virtualmethods::VirtualMethods;
use cssparser::RGBA;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use servo_atoms::Atom;
use style::attr::AttrValue;
diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs
index 9a1cdc40555..5ec6e76ae80 100644
--- a/components/script/dom/htmlformelement.rs
+++ b/components/script/dom/htmlformelement.rs
@@ -60,7 +60,7 @@ use crate::task_source::TaskSource;
use dom_struct::dom_struct;
use encoding_rs::{Encoding, UTF_8};
use headers::{ContentType, HeaderMapExt};
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use http::Method;
use js::rust::HandleObject;
use mime::{self, Mime};
diff --git a/components/script/dom/htmlheadelement.rs b/components/script/dom/htmlheadelement.rs
index 81c0f4bd777..cbb22801fef 100644
--- a/components/script/dom/htmlheadelement.rs
+++ b/components/script/dom/htmlheadelement.rs
@@ -13,7 +13,7 @@ use crate::dom::node::{document_from_node, BindContext, Node, ShadowIncluding};
use crate::dom::userscripts::load_script;
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
#[dom_struct]
diff --git a/components/script/dom/htmlhrelement.rs b/components/script/dom/htmlhrelement.rs
index d553e8f3261..13ab5786be9 100644
--- a/components/script/dom/htmlhrelement.rs
+++ b/components/script/dom/htmlhrelement.rs
@@ -13,7 +13,7 @@ use crate::dom::node::Node;
use crate::dom::virtualmethods::VirtualMethods;
use cssparser::RGBA;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index 99a4fd15a11..a16aaa9abfa 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -25,8 +25,9 @@ use crate::dom::virtualmethods::VirtualMethods;
use crate::dom::window::ReflowReason;
use crate::dom::windowproxy::WindowProxy;
use crate::script_thread::ScriptThread;
+use bitflags::bitflags;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use ipc_channel::ipc;
use js::rust::HandleObject;
use msg::constellation_msg::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId};
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index cd6e27537e5..d02a850ccb8 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -53,7 +53,7 @@ use app_units::{Au, AU_PER_PX};
use cssparser::{Parser, ParserInput};
use dom_struct::dom_struct;
use euclid::Point2D;
-use html5ever::{LocalName, Prefix, QualName};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix, QualName};
use ipc_channel::ipc;
use ipc_channel::ipc::IpcSender;
use ipc_channel::router::ROUTER;
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs
index d6f4d42b6b5..2e6911203ea 100755
--- a/components/script/dom/htmlinputelement.rs
+++ b/components/script/dom/htmlinputelement.rs
@@ -54,7 +54,7 @@ use chrono::{Datelike, Weekday};
use dom_struct::dom_struct;
use embedder_traits::FilterPattern;
use encoding_rs::Encoding;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::jsapi::{
ClippedTime, DateGetMsecSinceEpoch, Handle, JSObject, JS_ClearPendingException, NewDateObject,
NewUCRegExpObject, ObjectIsDate, RegExpFlag_Unicode, RegExpFlags,
diff --git a/components/script/dom/htmllabelelement.rs b/components/script/dom/htmllabelelement.rs
index e42bc8b508d..07de5963ee1 100644
--- a/components/script/dom/htmllabelelement.rs
+++ b/components/script/dom/htmllabelelement.rs
@@ -21,7 +21,7 @@ use crate::dom::htmlformelement::{FormControl, FormControlElementHelpers, HTMLFo
use crate::dom::node::{Node, ShadowIncluding};
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use style::attr::AttrValue;
diff --git a/components/script/dom/htmllielement.rs b/components/script/dom/htmllielement.rs
index e2e2248272d..1ba7237b76f 100644
--- a/components/script/dom/htmllielement.rs
+++ b/components/script/dom/htmllielement.rs
@@ -11,7 +11,7 @@ use crate::dom::htmlelement::HTMLElement;
use crate::dom::node::Node;
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, LocalName, Prefix};
use js::rust::HandleObject;
use style::attr::AttrValue;
diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs
index 6b833d6473a..c6d03721c46 100644
--- a/components/script/dom/htmllinkelement.rs
+++ b/components/script/dom/htmllinkelement.rs
@@ -28,7 +28,7 @@ use crate::stylesheet_loader::{StylesheetContextSource, StylesheetLoader, Styles
use cssparser::{Parser as CssParser, ParserInput};
use dom_struct::dom_struct;
use embedder_traits::EmbedderMsg;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use net_traits::ReferrerPolicy;
use servo_arc::Arc;
diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs
index 5fae503be08..405916adcaa 100644
--- a/components/script/dom/htmlmediaelement.rs
+++ b/components/script/dom/htmlmediaelement.rs
@@ -70,7 +70,7 @@ use embedder_traits::resources::{self, Resource as EmbedderResource};
use embedder_traits::{MediaPositionState, MediaSessionEvent, MediaSessionPlaybackState};
use euclid::default::Size2D;
use headers::{ContentLength, ContentRange, HeaderMapExt};
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use http::header::{self, HeaderMap, HeaderValue};
use ipc_channel::ipc;
use ipc_channel::router::ROUTER;
diff --git a/components/script/dom/htmlobjectelement.rs b/components/script/dom/htmlobjectelement.rs
index 348e52d9ee2..447d40b6a78 100755
--- a/components/script/dom/htmlobjectelement.rs
+++ b/components/script/dom/htmlobjectelement.rs
@@ -17,7 +17,7 @@ use crate::dom::validation::Validatable;
use crate::dom::validitystate::ValidityState;
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use net_traits::image::base::Image;
use servo_arc::Arc;
diff --git a/components/script/dom/htmloptgroupelement.rs b/components/script/dom/htmloptgroupelement.rs
index 0f737bcd521..499f88aa93b 100644
--- a/components/script/dom/htmloptgroupelement.rs
+++ b/components/script/dom/htmloptgroupelement.rs
@@ -16,7 +16,7 @@ use crate::dom::validation::Validatable;
use crate::dom::validitystate::ValidationFlags;
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, LocalName, Prefix};
use js::rust::HandleObject;
use style::element_state::ElementState;
diff --git a/components/script/dom/htmloptionelement.rs b/components/script/dom/htmloptionelement.rs
index d11b221f0df..3d5abc655c0 100644
--- a/components/script/dom/htmloptionelement.rs
+++ b/components/script/dom/htmloptionelement.rs
@@ -27,7 +27,7 @@ use crate::dom::validitystate::ValidationFlags;
use crate::dom::virtualmethods::VirtualMethods;
use crate::dom::window::Window;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix, QualName};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix, QualName};
use js::rust::HandleObject;
use std::cell::Cell;
use std::convert::TryInto;
diff --git a/components/script/dom/htmloptionscollection.rs b/components/script/dom/htmloptionscollection.rs
index a4b47a2b49b..4c826eb8ce4 100644
--- a/components/script/dom/htmloptionscollection.rs
+++ b/components/script/dom/htmloptionscollection.rs
@@ -22,6 +22,7 @@ use crate::dom::htmlselectelement::HTMLSelectElement;
use crate::dom::node::{document_from_node, Node};
use crate::dom::window::Window;
use dom_struct::dom_struct;
+use html5ever::local_name;
#[dom_struct]
pub struct HTMLOptionsCollection {
diff --git a/components/script/dom/htmloutputelement.rs b/components/script/dom/htmloutputelement.rs
index 533fc953d5c..6d8033fe299 100644
--- a/components/script/dom/htmloutputelement.rs
+++ b/components/script/dom/htmloutputelement.rs
@@ -18,7 +18,7 @@ use crate::dom::validation::Validatable;
use crate::dom::validitystate::ValidityState;
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, LocalName, Prefix};
use js::rust::HandleObject;
#[dom_struct]
diff --git a/components/script/dom/htmlprogresselement.rs b/components/script/dom/htmlprogresselement.rs
index 917ed3f592e..dc19a7a63f9 100644
--- a/components/script/dom/htmlprogresselement.rs
+++ b/components/script/dom/htmlprogresselement.rs
@@ -12,7 +12,7 @@ use crate::dom::htmlelement::HTMLElement;
use crate::dom::node::Node;
use crate::dom::nodelist::NodeList;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, LocalName, Prefix};
use js::rust::HandleObject;
#[dom_struct]
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs
index dfadc364ded..30c6ad7fb47 100644
--- a/components/script/dom/htmlscriptelement.rs
+++ b/components/script/dom/htmlscriptelement.rs
@@ -40,7 +40,7 @@ use content_security_policy as csp;
use core::ffi::c_void;
use dom_struct::dom_struct;
use encoding_rs::Encoding;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use ipc_channel::ipc;
use ipc_channel::router::ROUTER;
use js::jsapi::{CanCompileOffThread, CompileToStencilOffThread1, OffThreadToken};
diff --git a/components/script/dom/htmlselectelement.rs b/components/script/dom/htmlselectelement.rs
index 0cfda5bfaa6..04d52ae695d 100755
--- a/components/script/dom/htmlselectelement.rs
+++ b/components/script/dom/htmlselectelement.rs
@@ -30,7 +30,7 @@ use crate::dom::validation::{is_barred_by_datalist_ancestor, Validatable};
use crate::dom::validitystate::{ValidationFlags, ValidityState};
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, LocalName, Prefix};
use js::rust::HandleObject;
use std::default::Default;
use std::iter;
diff --git a/components/script/dom/htmlsourceelement.rs b/components/script/dom/htmlsourceelement.rs
index e8b542c7a4c..91e33e1ea9a 100644
--- a/components/script/dom/htmlsourceelement.rs
+++ b/components/script/dom/htmlsourceelement.rs
@@ -17,7 +17,7 @@ use crate::dom::htmlmediaelement::HTMLMediaElement;
use crate::dom::node::{BindContext, Node, UnbindContext};
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, LocalName, Prefix};
use js::rust::HandleObject;
#[dom_struct]
diff --git a/components/script/dom/htmlstyleelement.rs b/components/script/dom/htmlstyleelement.rs
index e2ffb441f73..846c1ccf59e 100644
--- a/components/script/dom/htmlstyleelement.rs
+++ b/components/script/dom/htmlstyleelement.rs
@@ -20,7 +20,7 @@ use crate::dom::virtualmethods::VirtualMethods;
use crate::stylesheet_loader::{StylesheetLoader, StylesheetOwner};
use cssparser::{Parser as CssParser, ParserInput};
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use net_traits::ReferrerPolicy;
use servo_arc::Arc;
diff --git a/components/script/dom/htmltablecellelement.rs b/components/script/dom/htmltablecellelement.rs
index 68daaa76614..9db63e6ffe0 100644
--- a/components/script/dom/htmltablecellelement.rs
+++ b/components/script/dom/htmltablecellelement.rs
@@ -16,7 +16,7 @@ use crate::dom::node::Node;
use crate::dom::virtualmethods::VirtualMethods;
use cssparser::RGBA;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
use style::context::QuirksMode;
diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs
index 6ce8c0569e1..189eac21a17 100644
--- a/components/script/dom/htmltableelement.rs
+++ b/components/script/dom/htmltableelement.rs
@@ -22,7 +22,7 @@ use crate::dom::node::{document_from_node, window_from_node, Node};
use crate::dom::virtualmethods::VirtualMethods;
use cssparser::RGBA;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use std::cell::Cell;
use style::attr::{parse_unsigned_integer, AttrValue, LengthOrPercentageOrAuto};
diff --git a/components/script/dom/htmltablerowelement.rs b/components/script/dom/htmltablerowelement.rs
index 6e8eb34899e..43006a85757 100644
--- a/components/script/dom/htmltablerowelement.rs
+++ b/components/script/dom/htmltablerowelement.rs
@@ -21,7 +21,7 @@ use crate::dom::node::{window_from_node, Node};
use crate::dom::virtualmethods::VirtualMethods;
use cssparser::RGBA;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use style::attr::AttrValue;
diff --git a/components/script/dom/htmltablesectionelement.rs b/components/script/dom/htmltablesectionelement.rs
index 03cddf7bdd4..ccaf409e10a 100644
--- a/components/script/dom/htmltablesectionelement.rs
+++ b/components/script/dom/htmltablesectionelement.rs
@@ -17,7 +17,7 @@ use crate::dom::node::{window_from_node, Node};
use crate::dom::virtualmethods::VirtualMethods;
use cssparser::RGBA;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use style::attr::AttrValue;
diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs
index 6ff51963348..2220058db98 100755
--- a/components/script/dom/htmltextareaelement.rs
+++ b/components/script/dom/htmltextareaelement.rs
@@ -36,7 +36,7 @@ use crate::textinput::{
Direction, KeyReaction, Lines, SelectionDirection, TextInput, UTF16CodeUnits, UTF8Bytes,
};
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use script_traits::ScriptToConstellationChan;
use std::cell::Cell;
diff --git a/components/script/dom/htmltrackelement.rs b/components/script/dom/htmltrackelement.rs
index 05ceed14f1e..08e450aea52 100644
--- a/components/script/dom/htmltrackelement.rs
+++ b/components/script/dom/htmltrackelement.rs
@@ -14,7 +14,7 @@ use crate::dom::htmlelement::HTMLElement;
use crate::dom::node::Node;
use crate::dom::texttrack::TextTrack;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, LocalName, Prefix};
use js::rust::HandleObject;
#[derive(Clone, Copy, JSTraceable, MallocSizeOf, PartialEq)]
diff --git a/components/script/dom/htmlvideoelement.rs b/components/script/dom/htmlvideoelement.rs
index 45e843d0efc..828f8d6f4a8 100644
--- a/components/script/dom/htmlvideoelement.rs
+++ b/components/script/dom/htmlvideoelement.rs
@@ -23,7 +23,7 @@ use crate::image_listener::{generate_cache_listener_for_element, ImageCacheListe
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
use dom_struct::dom_struct;
use euclid::default::Size2D;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, LocalName, Prefix};
use ipc_channel::ipc;
use ipc_channel::router::ROUTER;
use js::rust::HandleObject;
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs
index fd17d64d4f7..4b32a54d6aa 100644
--- a/components/script/dom/macros.rs
+++ b/components/script/dom/macros.rs
@@ -9,7 +9,7 @@ macro_rules! make_getter(
use crate::dom::bindings::inheritance::Castable;
use crate::dom::element::Element;
let element = self.upcast::<Element>();
- element.get_string_attribute(&local_name!($htmlname))
+ element.get_string_attribute(&html5ever::local_name!($htmlname))
}
);
);
@@ -21,7 +21,7 @@ macro_rules! make_bool_getter(
use crate::dom::bindings::inheritance::Castable;
use crate::dom::element::Element;
let element = self.upcast::<Element>();
- element.has_attribute(&local_name!($htmlname))
+ element.has_attribute(&html5ever::local_name!($htmlname))
}
);
);
@@ -40,7 +40,7 @@ macro_rules! make_limited_int_setter(
};
let element = self.upcast::<Element>();
- element.set_int_attribute(&local_name!($htmlname), value);
+ element.set_int_attribute(&html5ever::local_name!($htmlname), value);
Ok(())
}
);
@@ -54,7 +54,7 @@ macro_rules! make_int_setter(
use crate::dom::element::Element;
let element = self.upcast::<Element>();
- element.set_int_attribute(&local_name!($htmlname), value)
+ element.set_int_attribute(&html5ever::local_name!($htmlname), value)
}
);
($attr:ident, $htmlname:tt) => {
@@ -69,7 +69,7 @@ macro_rules! make_int_getter(
use crate::dom::bindings::inheritance::Castable;
use crate::dom::element::Element;
let element = self.upcast::<Element>();
- element.get_int_attribute(&local_name!($htmlname), $default)
+ element.get_int_attribute(&html5ever::local_name!($htmlname), $default)
}
);
@@ -85,7 +85,7 @@ macro_rules! make_uint_getter(
use crate::dom::bindings::inheritance::Castable;
use crate::dom::element::Element;
let element = self.upcast::<Element>();
- element.get_uint_attribute(&local_name!($htmlname), $default)
+ element.get_uint_attribute(&html5ever::local_name!($htmlname), $default)
}
);
($attr:ident, $htmlname:tt) => {
@@ -100,7 +100,7 @@ macro_rules! make_url_getter(
use crate::dom::bindings::inheritance::Castable;
use crate::dom::element::Element;
let element = self.upcast::<Element>();
- element.get_url_attribute(&local_name!($htmlname))
+ element.get_url_attribute(&html5ever::local_name!($htmlname))
}
);
);
@@ -112,7 +112,7 @@ macro_rules! make_url_setter(
use crate::dom::bindings::inheritance::Castable;
use crate::dom::element::Element;
let element = self.upcast::<Element>();
- element.set_url_attribute(&local_name!($htmlname),
+ element.set_url_attribute(&html5ever::local_name!($htmlname),
value);
}
);
@@ -126,7 +126,7 @@ macro_rules! make_form_action_getter(
use crate::dom::element::Element;
let element = self.upcast::<Element>();
let doc = crate::dom::node::document_from_node(self);
- let attr = element.get_attribute(&ns!(), &local_name!($htmlname));
+ let attr = element.get_attribute(&html5ever::ns!(), &html5ever::local_name!($htmlname));
let value = attr.as_ref().map(|attr| attr.value());
let value = match value {
Some(ref value) if !value.is_empty() => &***value,
@@ -162,7 +162,7 @@ macro_rules! make_enumerated_getter(
use crate::dom::bindings::inheritance::Castable;
use crate::dom::element::Element;
let element = self.upcast::<Element>();
- let mut val = element.get_string_attribute(&local_name!($htmlname));
+ let mut val = element.get_string_attribute(&html5ever::local_name!($htmlname));
val.make_ascii_lowercase();
// https://html.spec.whatwg.org/multipage/#attr-fs-method
match &*val {
@@ -182,7 +182,7 @@ macro_rules! make_setter(
use crate::dom::bindings::inheritance::Castable;
use crate::dom::element::Element;
let element = self.upcast::<Element>();
- element.set_string_attribute(&local_name!($htmlname), value)
+ element.set_string_attribute(&html5ever::local_name!($htmlname), value)
}
);
);
@@ -194,7 +194,7 @@ macro_rules! make_bool_setter(
use crate::dom::bindings::inheritance::Castable;
use crate::dom::element::Element;
let element = self.upcast::<Element>();
- element.set_bool_attribute(&local_name!($htmlname), value)
+ element.set_bool_attribute(&html5ever::local_name!($htmlname), value)
}
);
);
@@ -212,7 +212,7 @@ macro_rules! make_uint_setter(
value
};
let element = self.upcast::<Element>();
- element.set_uint_attribute(&local_name!($htmlname), value)
+ element.set_uint_attribute(&html5ever::local_name!($htmlname), value)
}
);
($attr:ident, $htmlname:tt) => {
@@ -235,7 +235,7 @@ macro_rules! make_limited_uint_setter(
value
};
let element = self.upcast::<Element>();
- element.set_uint_attribute(&local_name!($htmlname), value);
+ element.set_uint_attribute(&html5ever::local_name!($htmlname), value);
Ok(())
}
);
@@ -251,7 +251,7 @@ macro_rules! make_atomic_setter(
use crate::dom::bindings::inheritance::Castable;
use crate::dom::element::Element;
let element = self.upcast::<Element>();
- element.set_atomic_attribute(&local_name!($htmlname), value)
+ element.set_atomic_attribute(&html5ever::local_name!($htmlname), value)
}
);
);
@@ -265,7 +265,7 @@ macro_rules! make_legacy_color_setter(
use style::attr::AttrValue;
let element = self.upcast::<Element>();
let value = AttrValue::from_legacy_color(value.into());
- element.set_attribute(&local_name!($htmlname), value)
+ element.set_attribute(&html5ever::local_name!($htmlname), value)
}
);
);
@@ -278,7 +278,7 @@ macro_rules! make_dimension_setter(
use crate::dom::element::Element;
let element = self.upcast::<Element>();
let value = AttrValue::from_dimension(value.into());
- element.set_attribute(&local_name!($htmlname), value)
+ element.set_attribute(&html5ever::local_name!($htmlname), value)
}
);
);
@@ -291,7 +291,7 @@ macro_rules! make_nonzero_dimension_setter(
use crate::dom::element::Element;
let element = self.upcast::<Element>();
let value = AttrValue::from_nonzero_dimension(value.into());
- element.set_attribute(&local_name!($htmlname), value)
+ element.set_attribute(&html5ever::local_name!($htmlname), value)
}
);
);
diff --git a/components/script/dom/mutationobserver.rs b/components/script/dom/mutationobserver.rs
index 0adac701253..8c558408d86 100644
--- a/components/script/dom/mutationobserver.rs
+++ b/components/script/dom/mutationobserver.rs
@@ -17,7 +17,7 @@ use crate::dom::window::Window;
use crate::microtask::Microtask;
use crate::script_thread::ScriptThread;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Namespace};
+use html5ever::{namespace_url, ns, LocalName, Namespace};
use js::rust::HandleObject;
use std::rc::Rc;
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 797d57dfa6e..39655064bdd 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -64,11 +64,13 @@ use crate::dom::virtualmethods::{vtable_for, VirtualMethods};
use crate::dom::window::Window;
use crate::script_thread::ScriptThread;
use app_units::Au;
+use bitflags::bitflags;
use devtools_traits::NodeInfo;
use dom_struct::dom_struct;
use euclid::default::{Point2D, Rect, Size2D, Vector2D};
-use html5ever::{Namespace, Prefix, QualName};
+use html5ever::{namespace_url, ns, Namespace, Prefix, QualName};
use js::jsapi::JSObject;
+
use js::rust::HandleObject;
use libc::{self, c_void, uintptr_t};
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs
index 0a150866dd8..edcac751212 100644
--- a/components/script/dom/range.rs
+++ b/components/script/dom/range.rs
@@ -28,6 +28,7 @@ use crate::dom::node::{Node, ShadowIncluding, UnbindContext};
use crate::dom::selection::Selection;
use crate::dom::text::Text;
use crate::dom::window::Window;
+use deny_public_fields::DenyPublicFields;
use dom_struct::dom_struct;
use js::jsapi::JSTracer;
use js::rust::HandleObject;
diff --git a/components/script/dom/request.rs b/components/script/dom/request.rs
index 26234e7ab68..a2699351674 100644
--- a/components/script/dom/request.rs
+++ b/components/script/dom/request.rs
@@ -25,6 +25,7 @@ use crate::dom::headers::{Guard, Headers};
use crate::dom::promise::Promise;
use crate::dom::readablestream::ReadableStream;
use crate::script_runtime::JSContext as SafeJSContext;
+use cssparser::{_cssparser_internal_to_lowercase, match_ignore_ascii_case};
use dom_struct::dom_struct;
use http::header::{HeaderName, HeaderValue};
use http::method::InvalidMethod;
diff --git a/components/script/dom/servoparser/async_html.rs b/components/script/dom/servoparser/async_html.rs
index 6a87458d9f1..5b063dcc78a 100644
--- a/components/script/dom/servoparser/async_html.rs
+++ b/components/script/dom/servoparser/async_html.rs
@@ -29,7 +29,9 @@ use html5ever::tree_builder::{
ElementFlags, NextParserState, NodeOrText as HtmlNodeOrText, QuirksMode, TreeSink,
};
use html5ever::tree_builder::{TreeBuilder, TreeBuilderOpts};
-use html5ever::{Attribute as HtmlAttribute, ExpandedName, QualName};
+use html5ever::{
+ local_name, namespace_url, ns, Attribute as HtmlAttribute, ExpandedName, QualName,
+};
use servo_url::ServoUrl;
use std::borrow::Cow;
use std::cell::Cell;
diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs
index 62d963e2e74..db5aed41962 100644
--- a/components/script/dom/servoparser/mod.rs
+++ b/components/script/dom/servoparser/mod.rs
@@ -46,7 +46,7 @@ use html5ever::tendril::fmt::UTF8;
use html5ever::tendril::{ByteTendril, StrTendril, TendrilSink};
use html5ever::tokenizer::TokenizerResult;
use html5ever::tree_builder::{ElementFlags, NextParserState, NodeOrText, QuirksMode, TreeSink};
-use html5ever::{Attribute, ExpandedName, LocalName, QualName};
+use html5ever::{local_name, namespace_url, ns, Attribute, ExpandedName, LocalName, QualName};
use hyper_serde::Serde;
use mime::{self, Mime};
use msg::constellation_msg::PipelineId;
diff --git a/components/script/dom/servoparser/prefetch.rs b/components/script/dom/servoparser/prefetch.rs
index 2f1da052978..73db542984c 100644
--- a/components/script/dom/servoparser/prefetch.rs
+++ b/components/script/dom/servoparser/prefetch.rs
@@ -19,7 +19,7 @@ use html5ever::tokenizer::TokenSinkResult;
use html5ever::tokenizer::Tokenizer as HtmlTokenizer;
use html5ever::tokenizer::TokenizerResult;
use html5ever::Attribute;
-use html5ever::LocalName;
+use html5ever::{local_name, LocalName};
use js::jsapi::JSTracer;
use msg::constellation_msg::PipelineId;
use net_traits::request::CorsSettings;
diff --git a/components/script/dom/svgelement.rs b/components/script/dom/svgelement.rs
index 3f88ab608c0..dc1620f2598 100644
--- a/components/script/dom/svgelement.rs
+++ b/components/script/dom/svgelement.rs
@@ -12,7 +12,7 @@ use crate::dom::node::window_from_node;
use crate::dom::node::Node;
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use style::element_state::ElementState;
diff --git a/components/script/dom/svgsvgelement.rs b/components/script/dom/svgsvgelement.rs
index df3d1e5cd3a..f903c3b2735 100644
--- a/components/script/dom/svgsvgelement.rs
+++ b/components/script/dom/svgsvgelement.rs
@@ -12,7 +12,7 @@ use crate::dom::node::Node;
use crate::dom::svggraphicselement::SVGGraphicsElement;
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
-use html5ever::{LocalName, Prefix};
+use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use script_layout_interface::SVGSVGData;
use style::attr::AttrValue;
diff --git a/components/script/dom/validitystate.rs b/components/script/dom/validitystate.rs
index 81f4c254e43..38f700ea542 100755
--- a/components/script/dom/validitystate.rs
+++ b/components/script/dom/validitystate.rs
@@ -13,6 +13,7 @@ use crate::dom::htmlfieldsetelement::HTMLFieldSetElement;
use crate::dom::htmlformelement::FormControlElementHelpers;
use crate::dom::node::Node;
use crate::dom::window::Window;
+use bitflags::bitflags;
use dom_struct::dom_struct;
use itertools::Itertools;
use std::cell::Cell;
diff --git a/components/script/dom/webgl_validations/types.rs b/components/script/dom/webgl_validations/types.rs
index e7d87202e3a..b28664843e9 100644
--- a/components/script/dom/webgl_validations/types.rs
+++ b/components/script/dom/webgl_validations/types.rs
@@ -4,6 +4,7 @@
use crate::dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2RenderingContextConstants as constants;
use canvas_traits::gl_enums;
+use serde::{Deserialize, Serialize};
gl_enums! {
pub enum TexImageTarget {
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index b6225850975..8127f8c5f3a 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -54,6 +54,7 @@ use crate::dom::window::Window;
use crate::script_runtime::JSContext as SafeJSContext;
#[cfg(feature = "webgl_backtrace")]
use backtrace::Backtrace;
+use bitflags::bitflags;
use canvas_traits::webgl::WebGLError::*;
use canvas_traits::webgl::{
webgl_channel, AlphaTreatment, GLContextAttributes, GLLimits, GlType, Parameter, SizedDataType,
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 002c228d02f..b1b3399d823 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -62,7 +62,6 @@ use crate::dom::worklet::Worklet;
use crate::dom::workletglobalscope::WorkletGlobalScopeType;
use crate::fetch;
use crate::layout_image::fetch_image_for_layout;
-use crate::malloc_size_of::MallocSizeOf;
use crate::microtask::MicrotaskQueue;
use crate::realms::InRealm;
use crate::script_runtime::{
@@ -101,6 +100,7 @@ use js::rust::wrappers::JS_DefineProperty;
use js::rust::{
CustomAutoRooter, CustomAutoRooterGuard, HandleObject, HandleValue, MutableHandleObject,
};
+use malloc_size_of::MallocSizeOf;
use media::WindowGLContext;
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use net_traits::image_cache::{ImageCache, ImageResponder, ImageResponse};
diff --git a/components/script/dom/windowproxy.rs b/components/script/dom/windowproxy.rs
index a2b1cbfe7f4..f4aae865000 100644
--- a/components/script/dom/windowproxy.rs
+++ b/components/script/dom/windowproxy.rs
@@ -22,6 +22,7 @@ use crate::script_runtime::JSContext as SafeJSContext;
use crate::script_thread::ScriptThread;
use dom_struct::dom_struct;
use embedder_traits::EmbedderMsg;
+use html5ever::local_name;
use indexmap::map::IndexMap;
use ipc_channel::ipc;
use js::glue::{CreateWrapperProxyHandler, ProxyTraps};
@@ -52,6 +53,7 @@ use script_traits::{
AuxiliaryBrowsingContextLoadInfo, HistoryEntryReplacement, LoadData, LoadOrigin,
};
use script_traits::{NewLayoutInfo, ScriptMsg};
+use serde::{Deserialize, Serialize};
use servo_url::{ImmutableOrigin, ServoUrl};
use std::cell::Cell;
use std::ptr;
diff --git a/components/script/dom/worklet.rs b/components/script/dom/worklet.rs
index b1f9fc83ebe..75acc13c650 100644
--- a/components/script/dom/worklet.rs
+++ b/components/script/dom/worklet.rs
@@ -46,6 +46,7 @@ use js::jsapi::JSGCParamKey;
use js::jsapi::JSTracer;
use js::jsapi::JS_GetGCParameter;
use js::jsapi::{GCReason, JS_GC};
+use malloc_size_of::malloc_size_of_is_0;
use msg::constellation_msg::PipelineId;
use net_traits::request::Destination;
use net_traits::request::RequestBuilder;
diff --git a/components/script/layout_dom/element.rs b/components/script/layout_dom/element.rs
index 91be4baa6ed..2b1c199cbaa 100644
--- a/components/script/layout_dom/element.rs
+++ b/components/script/layout_dom/element.rs
@@ -12,7 +12,7 @@ use crate::dom::characterdata::LayoutCharacterDataHelpers;
use crate::dom::element::{Element, LayoutElementHelpers};
use crate::dom::node::{LayoutNodeHelpers, NodeFlags};
use atomic_refcell::{AtomicRef, AtomicRefMut};
-use html5ever::{LocalName, Namespace};
+use html5ever::{local_name, namespace_url, ns, LocalName, Namespace};
use script_layout_interface::wrapper_traits::{
GetStyleAndOpaqueLayoutData, LayoutDataTrait, LayoutNode, PseudoElementType,
ThreadSafeLayoutElement, ThreadSafeLayoutNode,
diff --git a/components/script/layout_dom/node.rs b/components/script/layout_dom/node.rs
index 22d28b9e165..7674a10e743 100644
--- a/components/script/layout_dom/node.rs
+++ b/components/script/layout_dom/node.rs
@@ -17,6 +17,7 @@ use crate::dom::node::{LayoutNodeHelpers, Node, NodeFlags};
use crate::dom::text::Text;
use atomic_refcell::AtomicRefCell;
use gfx_traits::ByteIndex;
+use html5ever::{local_name, namespace_url, ns};
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use net_traits::image::base::{Image, ImageMetadata};
use range::Range;
diff --git a/components/script/lib.rs b/components/script/lib.rs
index ecb4bf8a853..e78cd58d7a7 100644
--- a/components/script/lib.rs
+++ b/components/script/lib.rs
@@ -21,38 +21,17 @@
#![register_tool(unrooted_must_root_lint)]
#![register_tool(trace_in_no_trace_lint)]
-#[macro_use]
-extern crate bitflags;
-#[macro_use]
-extern crate crossbeam_channel;
-#[macro_use]
-extern crate cssparser;
-#[macro_use]
-extern crate deny_public_fields;
-#[macro_use]
-extern crate domobject_derive;
-#[macro_use]
-extern crate html5ever;
+// These are used a lot so let's keep them for now
#[macro_use]
extern crate js;
#[macro_use]
extern crate jstraceable_derive;
#[macro_use]
-extern crate lazy_static;
-#[macro_use]
extern crate log;
#[macro_use]
-extern crate malloc_size_of;
-#[macro_use]
extern crate malloc_size_of_derive;
#[macro_use]
-extern crate profile_traits;
-#[macro_use]
-extern crate serde;
-#[macro_use]
extern crate servo_atoms;
-#[macro_use]
-extern crate style;
mod animation_timeline;
mod animations;
diff --git a/components/script/script_module.rs b/components/script/script_module.rs
index f09ba9bf6c2..ad36507c3a3 100644
--- a/components/script/script_module.rs
+++ b/components/script/script_module.rs
@@ -37,6 +37,7 @@ use crate::script_runtime::JSContext as SafeJSContext;
use crate::task::TaskBox;
use crate::task_source::TaskSourceName;
use encoding_rs::UTF_8;
+use html5ever::local_name;
use hyper_serde::Serde;
use indexmap::IndexSet;
use ipc_channel::ipc;
diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs
index 6dc1e24fd7c..3db34ea97c4 100644
--- a/components/script/script_runtime.rs
+++ b/components/script/script_runtime.rs
@@ -73,9 +73,11 @@ use js::rust::IntoHandle;
use js::rust::ParentRuntime;
use js::rust::Runtime as RustRuntime;
use js::rust::{JSEngine, JSEngineHandle};
+use lazy_static::lazy_static;
use malloc_size_of::MallocSizeOfOps;
use msg::constellation_msg::PipelineId;
use profile_traits::mem::{Report, ReportKind, ReportsChan};
+use profile_traits::path;
use servo_config::opts;
use servo_config::pref;
use std::cell::Cell;
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 6f8c60ad7e7..be456b8d1f7 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -85,7 +85,7 @@ use crate::task_source::TaskSourceName;
use crate::webdriver_handlers;
use bluetooth_traits::BluetoothRequest;
use canvas_traits::webgl::WebGLPipeline;
-use crossbeam_channel::{unbounded, Receiver, Sender};
+use crossbeam_channel::{select, unbounded, Receiver, Sender};
use devtools_traits::CSSError;
use devtools_traits::{DevtoolScriptControlMsg, DevtoolsPageInfo};
use devtools_traits::{NavigationState, ScriptToDevtoolsControlMsg, WorkerId};
@@ -94,6 +94,7 @@ use euclid::default::{Point2D, Rect};
use euclid::Vector2D;
use headers::ReferrerPolicy as ReferrerPolicyHeader;
use headers::{HeaderMapExt, LastModified};
+use html5ever::{local_name, namespace_url, ns};
use hyper_serde::Serde;
use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER;
diff --git a/components/script/serviceworker_manager.rs b/components/script/serviceworker_manager.rs
index e3db04c4235..7b222546bd8 100644
--- a/components/script/serviceworker_manager.rs
+++ b/components/script/serviceworker_manager.rs
@@ -13,7 +13,7 @@ use crate::dom::serviceworkerglobalscope::{
};
use crate::dom::serviceworkerregistration::longest_prefix_match;
use crate::script_runtime::ContextForRequestInterrupt;
-use crossbeam_channel::{unbounded, Receiver, RecvError, Sender};
+use crossbeam_channel::{select, unbounded, Receiver, RecvError, Sender};
use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER;
use msg::constellation_msg::PipelineNamespace;
diff --git a/components/script/timers.rs b/components/script/timers.rs
index d337f197061..c7c2d15ef38 100644
--- a/components/script/timers.rs
+++ b/components/script/timers.rs
@@ -14,6 +14,7 @@ use crate::dom::testbinding::TestBindingCallback;
use crate::dom::xmlhttprequest::XHRTimeoutCallback;
use crate::script_module::ScriptFetchOptions;
use crate::script_thread::ScriptThread;
+use deny_public_fields::DenyPublicFields;
use euclid::Length;
use ipc_channel::ipc::IpcSender;
use js::jsapi::Heap;
diff --git a/components/script/window_named_properties.rs b/components/script/window_named_properties.rs
index 46cf61d7c2e..0a133d2cd34 100644
--- a/components/script/window_named_properties.rs
+++ b/components/script/window_named_properties.rs
@@ -34,7 +34,7 @@ struct SyncWrapper(*const libc::c_void);
#[allow(unsafe_code)]
unsafe impl Sync for SyncWrapper {}
-lazy_static! {
+lazy_static::lazy_static! {
static ref HANDLER: SyncWrapper = {
let traps = ProxyTraps {
enter: None,