/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
impl DeepCloneWithLock for DocumentRule { /// Deep clones this DocumentRule. fn deep_clone_with_lock(
&self,
lock: &SharedRwLock,
guard: &SharedRwLockReadGuard,
) -> Self { let rules = self.rules.read_with(guard);
DocumentRule {
condition: self.condition.clone(),
rules: Arc::new(lock.wrap(rules.deep_clone_with_lock(lock, guard))),
source_location: self.source_location.clone(),
}
}
}
/// The kind of media document that the rule will match. #[derive(Clone, Copy, Debug, Parse, PartialEq, ToCss, ToShmem)] #[allow(missing_docs)] pubenum MediaDocumentKind {
All,
Image,
Video,
}
/// A matching function for a `@document` rule's condition. #[derive(Clone, Debug, ToCss, ToShmem)] pubenum DocumentMatchingFunction { /// Exact URL matching function. It evaluates to true whenever the /// URL of the document being styled is exactly the URL given.
Url(CssUrl), /// 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. #[css(function)]
UrlPrefix(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. #[css(function)]
Domain(String), /// Regular expression matching function. It evaluates to true /// whenever the regular expression matches the entirety of the URL /// of the document being styled. #[css(function)]
Regexp(String), /// Matching function for a media document. #[css(function)]
MediaDocument(MediaDocumentKind), /// Matching function for a plain-text document. #[css(function)]
PlainTextDocument(()), /// Matching function for a document that can be observed by other content /// documents. #[css(function)]
UnobservableDocument(()),
}
/// A `@document` rule's condition. /// /// <https://www.w3.org/TR/2012/WD-css3-conditional-20120911/#at-document> /// /// The `@document` rule's condition is written as a comma-separated list of /// URL matching functions, and the condition evaluates to true whenever any /// one of those functions evaluates to true. #[derive(Clone, Debug, ToCss, ToShmem)] #[css(comma)] pubstruct DocumentCondition(#[css(iterable)] Vec<DocumentMatchingFunction>);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.