pub(crate) struct DocumentOrShadowRoot {
window: Dom<Window>,
}
Fields§
§window: Dom<Window>
Implementations§
Source§impl DocumentOrShadowRoot
impl DocumentOrShadowRoot
pub(crate) fn new(window: &Window) -> Self
pub(crate) fn element_from_point( &self, x: Finite<f64>, y: Finite<f64>, document_element: Option<DomRoot<Element>>, has_browsing_context: bool, ) -> Option<DomRoot<Element>>
pub(crate) fn elements_from_point( &self, x: Finite<f64>, y: Finite<f64>, document_element: Option<DomRoot<Element>>, has_browsing_context: bool, ) -> Vec<DomRoot<Element>> ⓘ
pub(crate) fn get_active_element( &self, focused_element: Option<DomRoot<Element>>, body: Option<DomRoot<HTMLElement>>, document_element: Option<DomRoot<Element>>, ) -> Option<DomRoot<Element>>
Sourcepub(crate) fn remove_stylesheet(
owner: StylesheetSource,
s: &Arc<Stylesheet>,
stylesheets: StylesheetSetRef<'_, ServoStylesheetInDocument>,
)
pub(crate) fn remove_stylesheet( owner: StylesheetSource, s: &Arc<Stylesheet>, stylesheets: StylesheetSetRef<'_, ServoStylesheetInDocument>, )
Remove a stylesheet owned by owner
from the list of document sheets.
Sourcepub(crate) fn add_stylesheet(
owner: StylesheetSource,
stylesheets: StylesheetSetRef<'_, ServoStylesheetInDocument>,
sheet: Arc<Stylesheet>,
insertion_point: Option<ServoStylesheetInDocument>,
style_shared_lock: &StyleSharedRwLock,
)
pub(crate) fn add_stylesheet( owner: StylesheetSource, stylesheets: StylesheetSetRef<'_, ServoStylesheetInDocument>, sheet: Arc<Stylesheet>, insertion_point: Option<ServoStylesheetInDocument>, style_shared_lock: &StyleSharedRwLock, )
Add a stylesheet owned by owner
to the list of document sheets, in the
correct tree position.
Sourcepub(crate) fn unregister_named_element(
&self,
id_map: &DomRefCell<HashMapTracedValues<Atom, Vec<Dom<Element>>>>,
to_unregister: &Element,
id: &Atom,
)
pub(crate) fn unregister_named_element( &self, id_map: &DomRefCell<HashMapTracedValues<Atom, Vec<Dom<Element>>>>, to_unregister: &Element, id: &Atom, )
Remove any existing association between the provided id/name and any elements in this document.
Sourcepub(crate) fn register_named_element(
&self,
id_map: &DomRefCell<HashMapTracedValues<Atom, Vec<Dom<Element>>>>,
element: &Element,
id: &Atom,
root: DomRoot<Node>,
)
pub(crate) fn register_named_element( &self, id_map: &DomRefCell<HashMapTracedValues<Atom, Vec<Dom<Element>>>>, element: &Element, id: &Atom, root: DomRoot<Node>, )
Associate an element present in this document with the provided id/name.
Sourcefn set_adopted_stylesheet(
adopted_stylesheets: &mut Vec<Dom<CSSStyleSheet>>,
incoming_stylesheets: &[Dom<CSSStyleSheet>],
owner: &StyleSheetListOwner,
) -> ErrorResult
fn set_adopted_stylesheet( adopted_stylesheets: &mut Vec<Dom<CSSStyleSheet>>, incoming_stylesheets: &[Dom<CSSStyleSheet>], owner: &StyleSheetListOwner, ) -> ErrorResult
Inner part of adopted stylesheet. We are setting it by, assuming it is a FrozenArray instead of an ObservableArray. Thus, it would have a completely different workflow compared to the spec. The workflow here is actually following Gecko’s implementation of AdoptedStylesheet before the implementation of ObservableArray.
The main purpose from this function is to set the &mut adopted_stylesheet
to match
incoming_stylesheet
and update the corresponding Styleset in a Document or a ShadowRoot.
In case of duplicates, the setter will respect the last duplicates.
https://drafts.csswg.org/cssom/#dom-documentorshadowroot-adoptedstylesheets
Sourcepub(crate) fn set_adopted_stylesheet_from_jsval(
context: JSContext,
adopted_stylesheets: &mut Vec<Dom<CSSStyleSheet>>,
incoming_value: HandleValue<'_>,
owner: &StyleSheetListOwner,
) -> ErrorResult
pub(crate) fn set_adopted_stylesheet_from_jsval( context: JSContext, adopted_stylesheets: &mut Vec<Dom<CSSStyleSheet>>, incoming_value: HandleValue<'_>, owner: &StyleSheetListOwner, ) -> ErrorResult
Set adoptedStylesheet given a js value by converting and passing the converted values to the inner DocumentOrShadowRoot::set_adopted_stylesheet.
Trait Implementations§
Source§impl Clone for DocumentOrShadowRoot
impl Clone for DocumentOrShadowRoot
Source§fn clone(&self) -> DocumentOrShadowRoot
fn clone(&self) -> DocumentOrShadowRoot
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl MallocSizeOf for DocumentOrShadowRoot
impl MallocSizeOf for DocumentOrShadowRoot
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Auto Trait Implementations§
impl Freeze for DocumentOrShadowRoot
impl !RefUnwindSafe for DocumentOrShadowRoot
impl !Send for DocumentOrShadowRoot
impl !Sync for DocumentOrShadowRoot
impl Unpin for DocumentOrShadowRoot
impl !UnwindSafe for DocumentOrShadowRoot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more