stylo: Create separate Attr type

This commit is contained in:
Manish Goregaokar 2017-05-31 18:03:33 -07:00 committed by Manish Goregaokar
parent 25d193ba34
commit 5de2f29080
6 changed files with 132 additions and 67 deletions

View file

@ -4401,12 +4401,12 @@ clip-path
as_utf16_and_forget(&value);
}
}
ContentItem::Attr(ns, val) => {
ContentItem::Attr(attr) => {
self.gecko.mContents[i].mType = eStyleContentType_Attr;
let s = if let Some((_, ns)) = ns {
format!("{}|{}", ns, val)
let s = if let Some((_, ns)) = attr.namespace {
format!("{}|{}", ns, attr.attribute)
} else {
val.into()
attr.attribute.into()
};
unsafe {
// NB: we share allocators, so doing this is fine.