script::dom::bindings::codegen::GenericBindings::FontFaceBinding

Type Alias CSSOMString

Source
pub(crate) type CSSOMString = DOMString;

Aliased Type§

struct CSSOMString(/* private fields */);

Implementations

Source§

impl DOMString

Source

pub fn new() -> DOMString

Creates a new DOMString.

Source

pub fn from_string(s: String) -> DOMString

Creates a new DOMString from a String.

Source

pub fn str(&self) -> &str

Get the internal &str value of this DOMString.

Source

pub fn push_str(&mut self, string: &str)

Appends a given string slice onto the end of this String.

Source

pub fn clear(&mut self)

Clears this DOMString, removing all contents.

Source

pub fn truncate(&mut self, new_len: usize)

Shortens this String to the specified length.

Source

pub fn strip_newlines(&mut self)

Removes newline characters according to https://infra.spec.whatwg.org/#strip-newlines.

Source

pub fn strip_leading_and_trailing_ascii_whitespace(&mut self)

Removes leading and trailing ASCII whitespaces according to https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace.

Source

pub fn is_valid_floating_point_number_string(&self) -> bool

Source

pub fn parse_floating_point_number(&self) -> Option<f64>

Source

pub fn set_best_representation_of_the_floating_point_number(&mut self)

Applies the same processing as parse_floating_point_number with some additional handling according to ECMA’s string conversion steps.

Used for specific elements when handling floating point values, namely the number and range inputs, as well as meter and progress elements.

https://html.spec.whatwg.org/multipage/#best-representation-of-the-number-as-a-floating-point-number https://tc39.es/ecma262/#sec-numeric-types-number-tostring

Trait Implementations

Source§

impl AsRef<str> for DOMString

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<str> for DOMString

Source§

fn borrow(&self) -> &str

Immutably borrows from an owned value. Read more
Source§

impl Clone for DOMString

Source§

fn clone(&self) -> DOMString

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DOMString

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for DOMString

Source§

fn default() -> DOMString

Returns the “default value” for a type. Read more
Source§

impl Deref for DOMString

Source§

type Target = str

The resulting type after dereferencing.
Source§

fn deref(&self) -> &str

Dereferences the value.
Source§

impl DerefMut for DOMString

Source§

fn deref_mut(&mut self) -> &mut str

Mutably dereferences the value.
Source§

impl Display for DOMString

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Extend<char> for DOMString

Source§

fn extend<I>(&mut self, iterable: I)
where I: IntoIterator<Item = char>,

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl Extractable for DOMString

Source§

fn extract( &self, global: &GlobalScope, can_gc: CanGc, ) -> Fallible<ExtractedBody>

Source§

impl From<&str> for DOMString

Source§

fn from(contents: &str) -> DOMString

Converts to this type from the input type.
Source§

impl<'a> From<Cow<'a, str>> for DOMString

Source§

fn from(contents: Cow<'a, str>) -> DOMString

Converts to this type from the input type.
Source§

impl From<SelectionDirection> for DOMString

Source§

fn from(direction: SelectionDirection) -> DOMString

Converts to this type from the input type.
Source§

impl From<String> for DOMString

Source§

fn from(contents: String) -> DOMString

Converts to this type from the input type.
Source§

impl FromJSValConvertible for DOMString

Source§

type Config = StringificationBehavior

Optional configurable behaviour switch; use () for no configuration.
Source§

unsafe fn from_jsval( cx: *mut JSContext, value: Handle<'_, Value>, null_behavior: StringificationBehavior, ) -> Result<ConversionResult<DOMString>, ()>

Convert val to type Self. Optional configuration of type T can be passed as the option argument. If it returns Err(()), a JSAPI exception is pending. If it returns Ok(Failure(reason)), there is no pending JSAPI exception.
Source§

impl Hash for DOMString

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl MallocSizeOf for DOMString

Source§

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.
Source§

impl Ord for DOMString

Source§

fn cmp(&self, other: &DOMString) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<'a> PartialEq<&'a str> for DOMString

Source§

fn eq(&self, other: &&'a str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<str> for DOMString

Source§

fn eq(&self, other: &str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for DOMString

Source§

fn eq(&self, other: &DOMString) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for DOMString

Source§

fn partial_cmp(&self, other: &DOMString) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl RecordKey for DOMString

Source§

fn to_utf16_vec(&self) -> Vec<u16>

Source§

unsafe fn from_id( cx: *mut JSContext, id: Handle<'_, PropertyKey>, ) -> Result<ConversionResult<DOMString>, ()>

Attempt to extract a key from a JS id. Read more
Source§

impl ToJSValConvertible for DOMString

Source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandle<'_, Value>)

Convert self to a JSVal. JSAPI failure causes a panic.
Source§

impl Traceable for DOMString

Source§

unsafe fn trace(&self, _: *mut JSTracer)

Trace self.
Source§

impl Eq for DOMString

Source§

impl StructuralPartialEq for DOMString