Bug 975397 - Call TrackImage when constructing a new nsStyleBorder. r=heycam

I confirmed that the crashtest crashes in the harness without the patch.

--HG--
rename : layout/reftests/backgrounds/blue-32x32.png => layout/style/crashtests/blue-32x32.png
This commit is contained in:
L. David Baron 2014-04-02 22:56:19 -07:00
parent 0d47a4402b
commit 10790a02c1
4 changed files with 20 additions and 0 deletions

View File

@ -419,6 +419,10 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
}
nsStyleBorder newStyleBorder(*styleBorder);
// We could do something fancy to avoid the TrackImage/UntrackImage
// work, but it doesn't seem worth it. (We need to call TrackImage
// since we're not going through nsRuleNode::ComputeBorderData.)
newStyleBorder.TrackImage(aPresContext);
NS_FOR_CSS_SIDES(side) {
newStyleBorder.SetBorderColor(side,
@ -428,6 +432,11 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
PaintBorderWithStyleBorder(aPresContext, aRenderingContext, aForFrame,
aDirtyRect, aBorderArea, newStyleBorder,
aStyleContext, aSkipSides);
// We could do something fancy to avoid the TrackImage/UntrackImage
// work, but it doesn't seem worth it. (We need to call UntrackImage
// since we're not going through nsStyleBorder::Destroy.)
newStyleBorder.UntrackImage(aPresContext);
}
void

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

View File

@ -0,0 +1,10 @@
<!DOCTYPE HTML>
<title>border-image on link with visited styles</title>
<style>
:link { color: blue }
:visited { color: purple }
:link, :visited { border: medium solid; border-image: url(blue-32x32.png) 4 4 4 4; }
</style>
<a href="http://example.com/">test</a>

View File

@ -104,3 +104,4 @@ load 945048-1.html
load 972199-1.html
load 989965-1.html
load large_border_image_width.html
load border-image-visited-link.html