/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use std::fmt; use embedder_traits::UntrustedNodeAddress; use euclid::default::Point2D; use layout_api::{NodesFromPointQueryType, QueryMsg}; use servo_arc::Arc; use style::invalidation::media_queries::{MediaListKey, ToMediaListKey}; use style::media_queries::MediaList; use style::shared_lock::{SharedRwLock as StyleSharedRwLock, SharedRwLockReadGuard}; use style::stylesheets::scope_rule::ImplicitScopeRoot; use style::stylesheets::{Stylesheet, StylesheetContents}; use stylo_atoms::Atom; use super::bindings::trace::HashMapTracedValues; use crate::dom::bindings::cell::DomRefCell; use crate::dom::bindings::codegen::Bindings::NodeBinding::Node_Binding::NodeMethods; use crate::dom::bindings::codegen::Bindings::ShadowRootBinding::ShadowRootMethods; use crate::dom::bindings::inheritance::Castable; use crate::dom::bindings::num::Finite; use crate::dom::bindings::root::{Dom, DomRoot}; use crate::dom::element::Element; use crate::dom::htmlelement::HTMLElement; use crate::dom::node::{self, Node, VecPreOrderInsertionHelper}; use crate::dom::shadowroot::ShadowRoot; use crate::dom::types::CSSStyleSheet; use crate::dom::window::Window; use crate::script_runtime::CanGc; use crate::stylesheet_set::StylesheetSetRef; /// Stylesheet could be constructed by a CSSOM object CSSStylesheet or parsed /// from HTML element such as `