Bug 1323702 - Support cloning XUL element style="" attributes in Servo-styled documents. r?bholley
MozReview-Commit-ID: Am2GjOCDVoe
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -376,18 +376,17 @@ nsXULElement::Clone(mozilla::dom::NodeIn
for (uint32_t i = 0; i < count; ++i) {
const nsAttrName* originalName = mAttrsAndChildren.AttrNameAt(i);
const nsAttrValue* originalValue = mAttrsAndChildren.AttrAt(i);
nsAttrValue attrValue;
// Style rules need to be cloned.
if (originalValue->Type() == nsAttrValue::eCSSDeclaration) {
DeclarationBlock* decl = originalValue->GetCSSDeclarationValue();
- RefPtr<css::Declaration>
- declClone = new css::Declaration(*decl->AsGecko());
+ RefPtr<DeclarationBlock> declClone = decl->Clone();
nsString stringValue;
originalValue->ToString(stringValue);
attrValue.SetTo(declClone.forget(), &stringValue);
} else {
attrValue.SetTo(*originalValue);
}
@@ -1913,18 +1912,17 @@ nsXULElement::MakeHeavyweight(nsXULProto
nsresult rv;
for (i = 0; i < aPrototype->mNumAttributes; ++i) {
nsXULPrototypeAttribute* protoattr = &aPrototype->mAttributes[i];
nsAttrValue attrValue;
// Style rules need to be cloned.
if (protoattr->mValue.Type() == nsAttrValue::eCSSDeclaration) {
DeclarationBlock* decl = protoattr->mValue.GetCSSDeclarationValue();
- RefPtr<css::Declaration>
- declClone = new css::Declaration(*decl->AsGecko());
+ RefPtr<DeclarationBlock> declClone = decl->Clone();
nsString stringValue;
protoattr->mValue.ToString(stringValue);
attrValue.SetTo(declClone.forget(), &stringValue);
} else {
attrValue.SetTo(protoattr->mValue);
}
--- a/layout/mathml/crashtests/crashtests.list
+++ b/layout/mathml/crashtests/crashtests.list
@@ -46,17 +46,17 @@ load 412237-1.xml
load 413063-1.xhtml
load 416907-1.xhtml
load 420420-1.xhtml
load 431072-1.xhtml
load 443089-1.xhtml
load 463763-1.xhtml
load 463763-2.xhtml
load 476547-1.xhtml
-skip-if(stylo) load 477740-1.xhtml # bug 1323702
+load 477740-1.xhtml
load 541620-1.xhtml
load 557474-1.html
load 654928-1.html
asserts-if(stylo,12) load 655451-1.xhtml # bug 1324660
load 713606-1.html
load 716349-1.html
load 848725-1.html
load 848725-2.html