pub struct ParseOptions<'a> {
pub namespaces: &'a [(&'a str, Ns)],
pub attr_namespaces: &'a [(&'a str, AttrNs)],
pub default: Option<Ns>,
}Expand description
What a stylesheet’s @namespace rules would declare, for
SelectorList::parse_with. The default declares nothing, as
SelectorList::parse does.
Namespaces are named by Ns for elements and AttrNs for
attributes, so only the ones the parser puts nodes in can be declared:
HTML, SVG and MathML, and XLink, XML and XMLNS. A custom namespace URI
has nothing to name it. Neither do Ns::Xml and AttrNs::Host,
which stand for whatever namespace the host keeps for an XML node, so
declaring either is an error.
Fields§
§namespaces: &'a [(&'a str, Ns)]Prefixes and their namespaces: ("svg", Ns::Svg) makes svg|rect
a rect in the SVG namespace. Prefixes compare exactly.
attr_namespaces: &'a [(&'a str, AttrNs)]Prefixes for attribute selectors: ("xlink", AttrNs::XLink) makes
[xlink|href] SVG’s xlink:href. A prefix only in namespaces
names an element namespace, which no attribute is in, so it matches
nothing in an attribute selector.
default: Option<Ns>The @namespace without a prefix: type selectors and * without
a prefix match only elements in it, and so does a compound with
neither. Attribute selectors aren’t affected.
Trait Implementations§
Source§impl<'a> Clone for ParseOptions<'a>
impl<'a> Clone for ParseOptions<'a>
Source§fn clone(&self) -> ParseOptions<'a>
fn clone(&self) -> ParseOptions<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more