#[repr(C)]pub(crate) struct HTMLLinkElement {Show 13 fields
htmlelement: HTMLElement,
rel_list: MutNullableDom<DOMTokenList>,
relations: Cell<LinkRelations>,
stylesheet: DomRefCell<Option<Arc<Stylesheet>>>,
cssom_stylesheet: MutNullableDom<CSSStyleSheet>,
parser_inserted: Cell<bool>,
pending_loads: Cell<u32>,
any_failed_load: Cell<bool>,
request_generation_id: Cell<RequestGenerationId>,
is_explicitly_enabled: Cell<bool>,
previous_type_matched: Cell<bool>,
previous_media_environment_matched: Cell<bool>,
line_number: u64,
}
Fields§
§htmlelement: HTMLElement
§rel_list: MutNullableDom<DOMTokenList>
The relations as specified by the “rel” attribute
relations: Cell<LinkRelations>
The link relations as they are used in practice.
The reason this is seperate from HTMLLinkElement::rel_list is that
a literal list is a bit unwieldy and that there are corner cases to consider
(Like rev="made"
implying an author relationship that is not represented in rel_list)
stylesheet: DomRefCell<Option<Arc<Stylesheet>>>
§cssom_stylesheet: MutNullableDom<CSSStyleSheet>
§parser_inserted: Cell<bool>
§pending_loads: Cell<u32>
The number of loads that this link element has triggered (could be more than one because of imports) and have not yet finished.
any_failed_load: Cell<bool>
Whether any of the loads have failed.
request_generation_id: Cell<RequestGenerationId>
A monotonically increasing counter that keeps track of which stylesheet to apply.
is_explicitly_enabled: Cell<bool>
§previous_type_matched: Cell<bool>
Whether the previous type matched with the destination
previous_media_environment_matched: Cell<bool>
Whether the previous media environment matched with the media query
line_number: u64
Line number this element was created on
Implementations§
Source§impl HTMLLinkElement
impl HTMLLinkElement
fn __assert_parent_type(&self)
Source§impl HTMLLinkElement
impl HTMLLinkElement
fn new_inherited( local_name: LocalName, prefix: Option<Prefix>, document: &Document, creator: ElementCreator, ) -> HTMLLinkElement
pub(crate) fn new( local_name: LocalName, prefix: Option<Prefix>, document: &Document, proto: Option<HandleObject<'_>>, creator: ElementCreator, can_gc: CanGc, ) -> DomRoot<HTMLLinkElement>
pub(crate) fn get_request_generation_id(&self) -> RequestGenerationId
pub(crate) fn set_stylesheet(&self, s: Arc<Stylesheet>)
pub(crate) fn get_stylesheet(&self) -> Option<Arc<Stylesheet>>
pub(crate) fn get_cssom_stylesheet( &self, can_gc: CanGc, ) -> Option<DomRoot<CSSStyleSheet>>
pub(crate) fn is_alternate(&self) -> bool
pub(crate) fn is_effectively_disabled(&self) -> bool
fn clean_stylesheet_ownership(&self)
Source§impl HTMLLinkElement
impl HTMLLinkElement
fn compute_destination_for_attribute(&self) -> Destination
Sourcefn processing_options(&self) -> LinkProcessingOptions
fn processing_options(&self) -> LinkProcessingOptions
Sourcefn default_fetch_and_process_the_linked_resource(
&self,
) -> Option<RequestBuilder>
fn default_fetch_and_process_the_linked_resource( &self, ) -> Option<RequestBuilder>
https://html.spec.whatwg.org/multipage/#default-fetch-and-process-the-linked-resource
This method does not implement Step 7 (fetching the request) and instead returns the RequestBuilder, as the fetch context that should be used depends on the link type.
Sourcefn linked_resource_fetch_setup(&self, request: &mut RequestBuilder) -> bool
fn linked_resource_fetch_setup(&self, request: &mut RequestBuilder) -> bool
Sourcefn fetch_and_process_prefetch_link(&self, href: &str)
fn fetch_and_process_prefetch_link(&self, href: &str)
The fetch and process the linked resource
algorithm for rel="prefetch"
Sourcefn handle_stylesheet_url(&self, href: &str)
fn handle_stylesheet_url(&self, href: &str)
Sourcefn handle_disabled_attribute_change(&self, disabled: bool)
fn handle_disabled_attribute_change(&self, disabled: bool)
fn handle_favicon_url(&self)
fn register_image_cache_callback( &self, id: PendingImageId, ) -> IpcSender<ImageCacheResponseMessage>
Sourcefn process_favicon_response(&self, image: Image)
fn process_favicon_response(&self, image: Image)
Rasterizes a loaded favicon file if necessary and notifies the embedder about it.
Sourcefn handle_preload_url(&self)
fn handle_preload_url(&self)
Sourcefn preload(&self, options: LinkProcessingOptions)
fn preload(&self, options: LinkProcessingOptions)
Sourcefn type_matches_destination(
mime_type: &str,
destination: Option<Destination>,
) -> bool
fn type_matches_destination( mime_type: &str, destination: Option<Destination>, ) -> bool
fn fire_event_after_response( &self, response: Result<ResourceFetchTiming, NetworkError>, )
Trait Implementations§
§impl Castable for HTMLLinkElement
impl Castable for HTMLLinkElement
Source§impl DomObject for HTMLLinkElement
impl DomObject for HTMLLinkElement
Source§impl DomObjectWrap<DomTypeHolder> for HTMLLinkElement
impl DomObjectWrap<DomTypeHolder> for HTMLLinkElement
Source§const WRAP: unsafe fn(SafeJSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>, CanGc) -> Root<Dom<Self>> = {script_bindings::codegen::GenericBindings::HTMLLinkElementBinding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::html::htmllinkelement::HTMLLinkElement>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::html::htmllinkelement::HTMLLinkElement>>}
const WRAP: unsafe fn(SafeJSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>, CanGc) -> Root<Dom<Self>> = {script_bindings::codegen::GenericBindings::HTMLLinkElementBinding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b> unsafe fn(script_bindings::script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::html::htmllinkelement::HTMLLinkElement>, script_bindings::script_runtime::CanGc) -> script_bindings::root::Root<script_bindings::root::Dom<dom::html::htmllinkelement::HTMLLinkElement>>}
Source§impl HTMLLinkElementMethods<DomTypeHolder> for HTMLLinkElement
impl HTMLLinkElementMethods<DomTypeHolder> for HTMLLinkElement
fn Href(&self) -> USVString
fn SetHref(&self, value: USVString)
fn Rel(&self) -> DOMString
fn SetRel(&self, rel: DOMString, can_gc: CanGc)
fn As(&self) -> DOMString
fn SetAs(&self, value: DOMString)
fn Media(&self) -> DOMString
fn SetMedia(&self, value: DOMString)
fn Integrity(&self) -> DOMString
fn SetIntegrity(&self, value: DOMString)
fn Hreflang(&self) -> DOMString
fn SetHreflang(&self, value: DOMString)
fn Type(&self) -> DOMString
fn SetType(&self, value: DOMString)
fn Disabled(&self) -> bool
fn SetDisabled(&self, value: bool)
fn RelList(&self, can_gc: CanGc) -> DomRoot<DOMTokenList>
fn Charset(&self) -> DOMString
fn SetCharset(&self, value: DOMString)
fn Rev(&self) -> DOMString
fn SetRev(&self, value: DOMString)
fn Target(&self) -> DOMString
fn SetTarget(&self, value: DOMString)
fn GetCrossOrigin(&self) -> Option<DOMString>
fn SetCrossOrigin(&self, value: Option<DOMString>, can_gc: CanGc)
fn ReferrerPolicy(&self) -> DOMString
fn SetReferrerPolicy(&self, value: DOMString)
fn GetSheet(&self, can_gc: CanGc) -> Option<DomRoot<DOMStyleSheet>>
Source§impl HasParent for HTMLLinkElement
impl HasParent for HTMLLinkElement
Source§fn as_parent(&self) -> &HTMLElement
fn as_parent(&self) -> &HTMLElement
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = HTMLElement
Source§impl IDLInterface for HTMLLinkElement
impl IDLInterface for HTMLLinkElement
Source§impl MallocSizeOf for HTMLLinkElement
impl MallocSizeOf for HTMLLinkElement
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl MutDomObject for HTMLLinkElement
impl MutDomObject for HTMLLinkElement
Source§impl PartialEq for HTMLLinkElement
impl PartialEq for HTMLLinkElement
Source§impl StylesheetOwner for HTMLLinkElement
impl StylesheetOwner for HTMLLinkElement
Source§fn increment_pending_loads_count(&self)
fn increment_pending_loads_count(&self)
Source§fn load_finished(&self, succeeded: bool) -> Option<bool>
fn load_finished(&self, succeeded: bool) -> Option<bool>
Source§fn parser_inserted(&self) -> bool
fn parser_inserted(&self) -> bool
Source§fn referrer_policy(&self) -> ReferrerPolicy
fn referrer_policy(&self) -> ReferrerPolicy
Source§fn set_origin_clean(&self, origin_clean: bool)
fn set_origin_clean(&self, origin_clean: bool)
Source§impl ToJSValConvertible for HTMLLinkElement
impl ToJSValConvertible for HTMLLinkElement
Source§impl Traceable for HTMLLinkElement
impl Traceable for HTMLLinkElement
Source§impl VirtualMethods for HTMLLinkElement
impl VirtualMethods for HTMLLinkElement
Source§fn super_type(&self) -> Option<&dyn VirtualMethods>
fn super_type(&self) -> Option<&dyn VirtualMethods>
Source§fn attribute_mutated(
&self,
attr: &Attr,
mutation: AttributeMutation<'_>,
can_gc: CanGc,
)
fn attribute_mutated( &self, attr: &Attr, mutation: AttributeMutation<'_>, can_gc: CanGc, )
Source§fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue
name
on this element.Source§fn bind_to_tree(&self, context: &BindContext, can_gc: CanGc)
fn bind_to_tree(&self, context: &BindContext, can_gc: CanGc)
Source§fn unbind_from_tree(&self, context: &UnbindContext<'_>, can_gc: CanGc)
fn unbind_from_tree(&self, context: &UnbindContext<'_>, can_gc: CanGc)
Source§fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool
fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool
true
if given attribute attr
affects style of the
given element.Source§fn post_connection_steps(&self)
fn post_connection_steps(&self)
Source§fn children_changed(&self, mutation: &ChildrenMutation<'_>)
fn children_changed(&self, mutation: &ChildrenMutation<'_>)
Source§fn handle_event(&self, event: &Event, can_gc: CanGc)
fn handle_event(&self, event: &Event, can_gc: CanGc)
Source§fn adopting_steps(&self, old_doc: &Document, can_gc: CanGc)
fn adopting_steps(&self, old_doc: &Document, can_gc: CanGc)
Source§fn cloning_steps(
&self,
copy: &Node,
maybe_doc: Option<&Document>,
clone_children: CloneChildrenFlag,
can_gc: CanGc,
)
fn cloning_steps( &self, copy: &Node, maybe_doc: Option<&Document>, clone_children: CloneChildrenFlag, can_gc: CanGc, )
impl DerivedFrom<Element> for HTMLLinkElement
impl DerivedFrom<EventTarget> for HTMLLinkElement
impl DerivedFrom<HTMLElement> for HTMLLinkElement
impl DerivedFrom<Node> for HTMLLinkElement
impl Eq for HTMLLinkElement
Auto Trait Implementations§
impl !Freeze for HTMLLinkElement
impl !RefUnwindSafe for HTMLLinkElement
impl !Send for HTMLLinkElement
impl !Sync for HTMLLinkElement
impl Unpin for HTMLLinkElement
impl !UnwindSafe for HTMLLinkElement
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<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
GlobalScope
] of the realm that the DomObject
was created in. If this
object is a Node
, this will be different from it’s owning Document
if adopted by. For
Node
s it’s almost always better to use NodeTraits::owning_global
.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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