pub(crate) type CSSOMString = DOMString;
Aliased Type§
struct CSSOMString(/* private fields */);
Implementations
Source§impl DOMString
impl DOMString
Sourcepub fn from_string(s: String) -> DOMString
pub fn from_string(s: String) -> DOMString
Creates a new DOMString
from a String
.
Sourcepub fn push_str(&mut self, string: &str)
pub fn push_str(&mut self, string: &str)
Appends a given string slice onto the end of this String.
Sourcepub fn strip_newlines(&mut self)
pub fn strip_newlines(&mut self)
Removes newline characters according to https://infra.spec.whatwg.org/#strip-newlines.
Sourcepub fn strip_leading_and_trailing_ascii_whitespace(&mut self)
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.
Sourcepub fn is_valid_floating_point_number_string(&self) -> bool
pub fn is_valid_floating_point_number_string(&self) -> bool
Sourcepub fn parse_floating_point_number(&self) -> Option<f64>
pub fn parse_floating_point_number(&self) -> Option<f64>
Sourcepub fn set_best_representation_of_the_floating_point_number(&mut self)
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 Extend<char> for DOMString
impl Extend<char> for DOMString
Source§fn extend<I>(&mut self, iterable: I)where
I: IntoIterator<Item = char>,
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)
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)
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
impl Extractable for DOMString
fn extract( &self, global: &GlobalScope, can_gc: CanGc, ) -> Fallible<ExtractedBody>
Source§impl From<SelectionDirection> for DOMString
impl From<SelectionDirection> for DOMString
Source§fn from(direction: SelectionDirection) -> DOMString
fn from(direction: SelectionDirection) -> DOMString
Converts to this type from the input type.
Source§impl FromJSValConvertible for DOMString
impl FromJSValConvertible for DOMString
Source§type Config = StringificationBehavior
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>, ()>
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 MallocSizeOf for DOMString
impl MallocSizeOf for DOMString
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.