diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 87519f9a8bb..42524d28a2c 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -3771,10 +3771,14 @@ GraphicsFilter nsLayoutUtils::GetGraphicsFilterForFrame(nsIFrame* aForFrame) { GraphicsFilter defaultFilter = gfxPattern::FILTER_GOOD; - nsIFrame *frame = nsCSSRendering::IsCanvasFrame(aForFrame) ? - nsCSSRendering::FindBackgroundStyleFrame(aForFrame) : aForFrame; + nsStyleContext *sc; + if (nsCSSRendering::IsCanvasFrame(aForFrame)) { + nsCSSRendering::FindBackground(aForFrame->PresContext(), aForFrame, &sc); + } else { + sc = aForFrame->StyleContext(); + } - switch (frame->StyleSVG()->mImageRendering) { + switch (sc->StyleSVG()->mImageRendering) { case NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED: return gfxPattern::FILTER_FAST; case NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY: