pub(crate) struct DocumentOrShadowRoot {
window: Dom<Window>,
custom_element_registry: MutNullableDom<CustomElementRegistry>,
}Fields§
§window: Dom<Window>§custom_element_registry: MutNullableDom<CustomElementRegistry>Implementations§
Source§impl DocumentOrShadowRoot
impl DocumentOrShadowRoot
pub(crate) fn new(window: &Window) -> Self
Sourcepub(crate) fn custom_element_registry(
&self,
) -> Option<DomRoot<CustomElementRegistry>>
pub(crate) fn custom_element_registry( &self, ) -> Option<DomRoot<CustomElementRegistry>>
pub(crate) fn set_custom_element_registry( &self, registry: Option<&CustomElementRegistry>, )
Sourcepub(crate) fn retarget_hit_test_result(
&self,
this: &Node,
node: &Node,
) -> Option<DomRoot<Element>>
pub(crate) fn retarget_hit_test_result( &self, this: &Node, node: &Node, ) -> Option<DomRoot<Element>>
Retarget the result of elementsFromPoint or elementFromPoint according to the
resolution in https://github.com/w3c/csswg-drafts/issues/556.
Sourcepub(crate) fn element_from_point(
&self,
this: &Node,
x: Finite<f64>,
y: Finite<f64>,
document_element: Option<DomRoot<Element>>,
has_browsing_context: bool,
) -> Option<DomRoot<Element>>
pub(crate) fn element_from_point( &self, this: &Node, x: Finite<f64>, y: Finite<f64>, document_element: Option<DomRoot<Element>>, has_browsing_context: bool, ) -> Option<DomRoot<Element>>
Sourcepub(crate) fn elements_from_point(
&self,
this: &Node,
x: Finite<f64>,
y: Finite<f64>,
document_element: Option<DomRoot<Element>>,
has_browsing_context: bool,
) -> Vec<DomRoot<Element>> ⓘ
pub(crate) fn elements_from_point( &self, this: &Node, x: Finite<f64>, y: Finite<f64>, document_element: Option<DomRoot<Element>>, has_browsing_context: bool, ) -> Vec<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.
Sourcefn set_adopted_stylesheets(
adopted_stylesheets: &mut Vec<Dom<CSSStyleSheet>>,
incoming_stylesheets: &[Dom<CSSStyleSheet>],
owner: &StyleSheetListOwner,
) -> ErrorResult
fn set_adopted_stylesheets( adopted_stylesheets: &mut Vec<Dom<CSSStyleSheet>>, incoming_stylesheets: &[Dom<CSSStyleSheet>], owner: &StyleSheetListOwner, ) -> ErrorResult
https://drafts.csswg.org/cssom/#dom-documentorshadowroot-adoptedstylesheets
To replace the DOM-side adopted stylesheet list:
- Validate each incoming stylesheet against the owner document.
- Remove the old effective constructed stylesheets from the style set.
- Rebuild the effective constructed stylesheet order from
incoming_stylesheets.
Sourcepub(crate) fn on_set_adopted_stylesheets(
adopted_stylesheets: &mut Vec<Dom<CSSStyleSheet>>,
value: &CSSStyleSheet,
index: u32,
owner: &StyleSheetListOwner,
) -> ErrorResult
pub(crate) fn on_set_adopted_stylesheets( adopted_stylesheets: &mut Vec<Dom<CSSStyleSheet>>, value: &CSSStyleSheet, index: u32, owner: &StyleSheetListOwner, ) -> ErrorResult
Sourcepub(crate) fn on_delete_adopted_stylesheets(
adopted_stylesheets: &mut Vec<Dom<CSSStyleSheet>>,
index: u32,
owner: &StyleSheetListOwner,
) -> ErrorResult
pub(crate) fn on_delete_adopted_stylesheets( adopted_stylesheets: &mut Vec<Dom<CSSStyleSheet>>, index: u32, owner: &StyleSheetListOwner, ) -> ErrorResult
Trait Implementations§
Source§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
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Auto Trait Implementations§
impl !Freeze for DocumentOrShadowRoot
impl !RefUnwindSafe for DocumentOrShadowRoot
impl !Send for DocumentOrShadowRoot
impl !Sync for DocumentOrShadowRoot
impl Unpin for DocumentOrShadowRoot
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert