Bug 1323702 - Support cloning XUL element style="" attributes in Servo-styled documents. r?bholley draft
authorCameron McCormack <cam@mcc.id.au>
Mon, 09 Jan 2017 15:55:37 +0800
changeset 457584 840d98d813fe3cb9fc63edeae78edb04ee16ae88
parent 457583 7b94c217248cf16f08cb7f6880f976acaf35d867
child 541516 b9f71be40e30f1f9916092f3f0f76c177b5977bf
push id40816
push userbmo:cam@mcc.id.au
push dateMon, 09 Jan 2017 07:59:44 +0000
reviewersbholley
bugs1323702
milestone53.0a1
Bug 1323702 - Support cloning XUL element style="" attributes in Servo-styled documents. r?bholley MozReview-Commit-ID: Am2GjOCDVoe
dom/xul/nsXULElement.cpp
layout/mathml/crashtests/crashtests.list
--- 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