pub struct Tag {
pub kind: TagKind,
pub name: LocalName,
pub self_closing: bool,
pub attrs: Vec<Attribute>,
pub had_duplicate_attributes: bool,
}Expand description
A tag token.
Fields§
§kind: TagKindWhether the tag is a start or an end tag.
name: LocalName§self_closing: boolWhether the tag closes itself.
An example of a self closing tag is <foo />.
attrs: Vec<Attribute>§had_duplicate_attributes: boolWhether duplicate attributes were encountered during tokenization. This is used for CSP nonce validation - elements with duplicate attributes are not nonceable per the CSP spec.
Implementations§
Source§impl Tag
impl Tag
Sourcepub fn equiv_modulo_attr_order(&self, other: &Tag) -> bool
pub fn equiv_modulo_attr_order(&self, other: &Tag) -> bool
Are the tags equivalent when we don’t care about attribute order? Also ignores the self-closing flag.
pub(crate) fn get_attribute(&self, name: &LocalName) -> Option<StrTendril>
Trait Implementations§
impl Eq for Tag
impl StructuralPartialEq for Tag
Auto Trait Implementations§
impl Freeze for Tag
impl !RefUnwindSafe for Tag
impl !Send for Tag
impl !Sync for Tag
impl Unpin for Tag
impl UnwindSafe for Tag
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
Mutably borrows from an owned value. Read more