Bug 1457985: Fix a typo in nsStyleContentData copy-constructor. draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 30 Apr 2018 20:41:08 +0200
changeset 789917 473af3e95e8c0229a898a4605dd12efcc9078fad
parent 789915 c80d4798b4e1c5211917f54286a32c387b21af99
push id108364
push userbmo:emilio@crisal.io
push dateMon, 30 Apr 2018 18:48:04 +0000
bugs1457985
milestone61.0a1
Bug 1457985: Fix a typo in nsStyleContentData copy-constructor. MozReview-Commit-ID: FtcA6Nm4dwr
layout/style/crashtests/1457985.html
layout/style/crashtests/crashtests.list
layout/style/nsStyleStruct.cpp
new file mode 100644
--- /dev/null
+++ b/layout/style/crashtests/1457985.html
@@ -0,0 +1,2 @@
+<body style="content:attr(a) open-quote">
+<header style="all:inherit">
--- a/layout/style/crashtests/crashtests.list
+++ b/layout/style/crashtests/crashtests.list
@@ -270,8 +270,9 @@ pref(dom.webcomponents.shadowdom.enabled
 load 1426312.html
 load 1439793.html
 load 1409183.html
 pref(dom.webcomponents.shadowdom.enabled,true) load 1445682.html
 load 1450691.html
 pref(dom.webcomponents.shadowdom.enabled,true) load 1453206.html
 load 1454140.html
 load 1455108.html
+load 1457985.html
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -4156,17 +4156,17 @@ nsStyleContentData::nsStyleContentData(c
       mContent.mImage->AddRef();
       break;
     case eStyleContentType_Counter:
     case eStyleContentType_Counters:
       mContent.mCounters = aOther.mContent.mCounters;
       mContent.mCounters->AddRef();
       break;
     case eStyleContentType_Attr:
-      mContent.mAttr = new nsStyleContentAttr(*mContent.mAttr);
+      mContent.mAttr = new nsStyleContentAttr(*aOther.mContent.mAttr);
       break;
     case eStyleContentType_String:
       mContent.mString = NS_strdup(aOther.mContent.mString);
       break;
     default:
       MOZ_ASSERT(!aOther.mContent.mString);
       mContent.mString = nullptr;
   }