From 10790a02c11154107326ba5716ce94580038087c Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Wed, 2 Apr 2014 22:56:19 -0700 Subject: [PATCH] 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 --- layout/base/nsCSSRendering.cpp | 9 +++++++++ layout/style/crashtests/blue-32x32.png | Bin 0 -> 110 bytes .../crashtests/border-image-visited-link.html | 10 ++++++++++ layout/style/crashtests/crashtests.list | 1 + 4 files changed, 20 insertions(+) create mode 100644 layout/style/crashtests/blue-32x32.png create mode 100644 layout/style/crashtests/border-image-visited-link.html diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index d91309be173..2d8bb4616da 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -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 diff --git a/layout/style/crashtests/blue-32x32.png b/layout/style/crashtests/blue-32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..deefd19b2ac53bef91c82ed2f6f4ea5f53a9e34f GIT binary patch literal 110 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={W7>k44ofy`glX(f`Xn49fhIkx* zd)ASWfq{i(!{YjMuMfAm)=WCN{G4&4gMt7D3sa**K`P_IV~qB%vRdu|^)Pt4`njxg HN@xNA-ozi} literal 0 HcmV?d00001 diff --git a/layout/style/crashtests/border-image-visited-link.html b/layout/style/crashtests/border-image-visited-link.html new file mode 100644 index 00000000000..b6e3ae5d783 --- /dev/null +++ b/layout/style/crashtests/border-image-visited-link.html @@ -0,0 +1,10 @@ + +border-image on link with visited styles + +test diff --git a/layout/style/crashtests/crashtests.list b/layout/style/crashtests/crashtests.list index e414f287ef9..acd709c35e6 100644 --- a/layout/style/crashtests/crashtests.list +++ b/layout/style/crashtests/crashtests.list @@ -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