#[repr(C)]pub(crate) struct FontFaceSet {
target: EventTarget,
promise: DomRefCell<TracedPromise>,
set_entries: DomRefCell<Vec<Dom<FontFace>>>,
status: Cell<FontFaceSetLoadStatus>,
}Expand description
Fields§
§target: EventTarget§promise: DomRefCell<TracedPromise>§set_entries: DomRefCell<Vec<Dom<FontFace>>>§status: Cell<FontFaceSetLoadStatus>Implementations§
Source§impl FontFaceSet
impl FontFaceSet
fn __assert_parent_type(&self)
Source§impl FontFaceSet
impl FontFaceSet
fn new_inherited(promise: &RootedPromise) -> Self
pub(crate) fn new( cx: &mut JSContext, global: &GlobalScope, proto: Option<HandleObject<'_>>, ) -> DomRoot<Self>
pub(super) fn handle_font_face_status_changed( &self, cx: &mut JSContext, font_face: &FontFace, )
Sourcepub(crate) fn maybe_switch_worker_set_to_loaded(&self, cx: &mut JSContext)
pub(crate) fn maybe_switch_worker_set_to_loaded(&self, cx: &mut JSContext)
Workers are never pending on the environment, so their font face set switches to
loaded as soon as none of its fonts are loading. For documents this is done by
Document::maybe_fulfill_font_ready_promise.
https://drafts.csswg.org/css-font-loading/#switch-the-fontfaceset-to-loaded
Sourcepub(crate) fn fulfill_ready_promise_if_needed(&self, cx: &mut JSContext) -> bool
pub(crate) fn fulfill_ready_promise_if_needed(&self, cx: &mut JSContext) -> bool
Fulfill the font ready promise, returning true if it was not already fulfilled beforehand.
pub(crate) fn waiting_to_fullfill_promise(&self) -> bool
fn contains_face(&self, target: &FontFace) -> bool
Sourcefn delete_face(&self, target: &FontFace) -> bool
fn delete_face(&self, target: &FontFace) -> bool
Removes a face from the set’s set entries.
Sourcepub(crate) fn switch_to_loading(&self, cx: &mut JSContext)
pub(crate) fn switch_to_loading(&self, cx: &mut JSContext)
Sourcefn fire_font_load_event(
&self,
cx: &mut JSContext,
event_name: Atom,
font_faces: &[DomRoot<FontFace>],
)
fn fire_font_load_event( &self, cx: &mut JSContext, event_name: Atom, font_faces: &[DomRoot<FontFace>], )
Runs the CSS cascade to ensure that new @font-face rules have
an entry in this set.
Sourcepub(crate) fn notify_font_face_rules_removed(
&self,
removed_font_face_rules: &[ServoArc<FontFaceRuleInfo>],
)
pub(crate) fn notify_font_face_rules_removed( &self, removed_font_face_rules: &[ServoArc<FontFaceRuleInfo>], )
Marks the entries corresponding to removed @font-face rules as not css-connected.
Sourcefn query_fonts(
&self,
target_family: &FamilyName,
sample_text: &str,
) -> Vec<DomRoot<FontFace>> ⓘ
fn query_fonts( &self, target_family: &FamilyName, sample_text: &str, ) -> Vec<DomRoot<FontFace>> ⓘ
Uses the font matching rules to select font faces within self that can be used to
render the provided text.
This is used to implement Step 6 of https://drafts.csswg.org/css-font-loading/#find-the-matching-font-faces.
Sourcefn find_the_matching_font_faces(
&self,
global: &GlobalScope,
font: &str,
sample_text: &str,
) -> Result<Vec<DomRoot<FontFace>>, FontQuerySyntaxError>
fn find_the_matching_font_faces( &self, global: &GlobalScope, font: &str, sample_text: &str, ) -> Result<Vec<DomRoot<FontFace>>, FontQuerySyntaxError>
Trait Implementations§
§impl Castable for FontFaceSet
impl Castable for FontFaceSet
impl DerivedFrom<EventTarget> for FontFaceSet
Source§impl DomObject for FontFaceSet
impl DomObject for FontFaceSet
type ReflectorType = <EventTarget as DomObject>::ReflectorType
Source§fn reflector(&self) -> &Reflector<Self::ReflectorType>
fn reflector(&self) -> &Reflector<Self::ReflectorType>
Source§impl DomObjectIteratorWrap<DomTypeHolder> for FontFaceSet
impl DomObjectIteratorWrap<DomTypeHolder> for FontFaceSet
Source§const ITER_WRAP: unsafe fn(&mut JSContext, &GlobalScope, Option<HandleObject<'_>>, Box<IterableIterator<DomTypeHolder, Self>>) -> Root<Dom<IterableIterator<DomTypeHolder, Self>>>
const ITER_WRAP: unsafe fn(&mut JSContext, &GlobalScope, Option<HandleObject<'_>>, Box<IterableIterator<DomTypeHolder, Self>>) -> Root<Dom<IterableIterator<DomTypeHolder, Self>>>
IterableIterator<T>Source§impl DomObjectWrap<DomTypeHolder> for FontFaceSet
impl DomObjectWrap<DomTypeHolder> for FontFaceSet
Source§impl Drop for FontFaceSet
impl Drop for FontFaceSet
impl Eq for FontFaceSet
Source§impl FontFaceSetMethods<DomTypeHolder> for FontFaceSet
impl FontFaceSetMethods<DomTypeHolder> for FontFaceSet
Source§fn Ready(&self, cx: &mut JSContext) -> RootedPromise
fn Ready(&self, cx: &mut JSContext) -> RootedPromise
Source§fn Status(&self) -> FontFaceSetLoadStatus
fn Status(&self) -> FontFaceSetLoadStatus
fn GetOnloading( &self, cx: &mut JSContext, ) -> Option<RootedCallback<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnloading( &self, cx: &mut JSContext, listener: Option<RootedCallback<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnloadingdone( &self, cx: &mut JSContext, ) -> Option<RootedCallback<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnloadingdone( &self, cx: &mut JSContext, listener: Option<RootedCallback<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnloadingerror( &self, cx: &mut JSContext, ) -> Option<RootedCallback<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnloadingerror( &self, cx: &mut JSContext, listener: Option<RootedCallback<EventHandlerNonNull<DomTypeHolder>>>, )
Source§impl HasParent for FontFaceSet
impl HasParent for FontFaceSet
Source§fn as_parent(&self) -> &EventTarget
fn as_parent(&self) -> &EventTarget
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = EventTarget
Source§impl HasPrototype for FontFaceSet
impl HasPrototype for FontFaceSet
const PROTOTYPE_ID: ID = script_bindings::codegen::PrototypeList::ID::FontFaceSet
Source§impl IDLInterface for FontFaceSet
impl IDLInterface for FontFaceSet
Source§const PROTO_ID: ID = PrototypeList::ID::FontFaceSet
const PROTO_ID: ID = PrototypeList::ID::FontFaceSet
Source§const PROTO_FIRST: u16 = 193
const PROTO_FIRST: u16 = 193
Source§const PROTO_LAST: u16 = 193
const PROTO_LAST: u16 = 193
Source§impl IteratorDerives for FontFaceSet
impl IteratorDerives for FontFaceSet
Source§impl MallocSizeOf for FontFaceSet
impl MallocSizeOf for FontFaceSet
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl MutDomObject for FontFaceSet
impl MutDomObject for FontFaceSet
Source§impl PartialEq for FontFaceSet
impl PartialEq for FontFaceSet
Source§impl PrototypeInitializer for FontFaceSet
impl PrototypeInitializer for FontFaceSet
fn set_proto_id(&mut self, id: ID)
Source§impl Setlike for FontFaceSet
impl Setlike for FontFaceSet
fn get_index(&self, cx: &mut JSContext, index: u32) -> Option<Self::Key>
fn size(&self, cx: &mut JSContext) -> u32
fn add(&self, cx: &mut JSContext, face: Self::Key)
fn has(&self, cx: &mut JSContext, target: Self::Key) -> bool
fn clear(&self, cx: &mut JSContext)
fn delete(&self, cx: &mut JSContext, to_delete: Self::Key) -> bool
Source§impl ToJSValConvertible for FontFaceSet
impl ToJSValConvertible for FontFaceSet
Source§fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
self to a JSVal. JSAPI failure causes a panic.Auto Trait Implementations§
impl !Freeze for FontFaceSet
impl !RefUnwindSafe for FontFaceSet
impl !Send for FontFaceSet
impl !Sync for FontFaceSet
impl !UnwindSafe for FontFaceSet
impl Unpin for FontFaceSet
impl UnsafeUnpin for FontFaceSet
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_from_reflector(&self) -> 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
Nodes 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§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
impl<T> ErasedDestructor for Twhere
T: 'static,
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