Bug 1153693 - Only call ReleaseRef on nsStyle{ClipPath,Filter} once when setting a new value. r=dbaron

This commit is contained in:
Cameron McCormack 2015-04-13 12:34:15 +10:00
parent 12fce2feee
commit 97788259ef
3 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
.a { clip-path: url(z); }
#x { clip-path: inherit; }
</style>
</head>
<body>
<div class="a">
<div class="a" id="x"></div>
</div>
</body>
</html>

View File

@ -112,5 +112,6 @@ load 1066089-1.html
load 1074651-1.html
pref(dom.webcomponents.enabled,true) load 1089463-1.html
pref(layout.css.expensive-style-struct-assertions.enabled,true) load 1136010-1.html
load 1153693-1.html
load large_border_image_width.html
load border-image-visited-link.html

View File

@ -1068,8 +1068,6 @@ nsStyleClipPath::operator=(const nsStyleClipPath& aOther)
return *this;
}
ReleaseRef();
if (aOther.mType == NS_STYLE_CLIP_PATH_URL) {
SetURL(aOther.mURL);
} else if (aOther.mType == NS_STYLE_CLIP_PATH_SHAPE) {
@ -1077,6 +1075,7 @@ nsStyleClipPath::operator=(const nsStyleClipPath& aOther)
} else if (aOther.mType == NS_STYLE_CLIP_PATH_BOX) {
SetSizingBox(aOther.mSizingBox);
} else {
ReleaseRef();
mSizingBox = NS_STYLE_CLIP_SHAPE_SIZING_NOBOX;
mType = NS_STYLE_CLIP_PATH_NONE;
}
@ -1187,7 +1186,11 @@ nsStyleFilter::operator=(const nsStyleFilter& aOther)
SetDropShadow(aOther.mDropShadow);
} else if (aOther.mType != NS_STYLE_FILTER_NONE) {
SetFilterParameter(aOther.mFilterParameter, aOther.mType);
} else {
ReleaseRef();
mType = NS_STYLE_FILTER_NONE;
}
return *this;
}
@ -1220,6 +1223,7 @@ nsStyleFilter::ReleaseRef()
NS_ASSERTION(mURL, "expected pointer");
mURL->Release();
}
mURL = nullptr;
}
void