pub enum DocumentMatchingFunction {
Url(CssUrl),
UrlPrefix(String),
Domain(String),
Regexp(String),
MediaDocument(MediaDocumentKind),
PlainTextDocument(()),
UnobservableDocument(()),
}
Expand description
A matching function for a @document
rule’s condition.
Variants§
Url(CssUrl)
Exact URL matching function. It evaluates to true whenever the URL of the document being styled is exactly the URL given.
UrlPrefix(String)
URL prefix matching function. It evaluates to true whenever the URL of the document being styled has the argument to the function as an initial substring (which is true when the two strings are equal). When the argument is the empty string, it evaluates to true for all documents.
Domain(String)
Domain matching function. It evaluates to true whenever the URL of the document being styled has a host subcomponent and that host subcomponent is exactly the argument to the ‘domain()’ function or a final substring of the host component is a period (U+002E) immediately followed by the argument to the ‘domain()’ function.
Regexp(String)
Regular expression matching function. It evaluates to true whenever the regular expression matches the entirety of the URL of the document being styled.
MediaDocument(MediaDocumentKind)
Matching function for a media document.
PlainTextDocument(())
Matching function for a plain-text document.
UnobservableDocument(())
Matching function for a document that can be observed by other content documents.
Implementations§
source§impl DocumentMatchingFunction
impl DocumentMatchingFunction
sourcepub fn parse<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>>
pub fn parse<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>
Parse a URL matching function for a@document
rule’s condition.
Trait Implementations§
source§impl Clone for DocumentMatchingFunction
impl Clone for DocumentMatchingFunction
source§fn clone(&self) -> DocumentMatchingFunction
fn clone(&self) -> DocumentMatchingFunction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DocumentMatchingFunction
impl Debug for DocumentMatchingFunction
source§impl ToCss for DocumentMatchingFunction
impl ToCss for DocumentMatchingFunction
source§impl ToShmem for DocumentMatchingFunction
impl ToShmem for DocumentMatchingFunction
Auto Trait Implementations§
impl Freeze for DocumentMatchingFunction
impl RefUnwindSafe for DocumentMatchingFunction
impl Send for DocumentMatchingFunction
impl Sync for DocumentMatchingFunction
impl Unpin for DocumentMatchingFunction
impl UnwindSafe for DocumentMatchingFunction
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<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