diff --git a/layout/generic/nsHTMLCanvasFrame.cpp b/layout/generic/nsHTMLCanvasFrame.cpp index 6af9bb91e9d..0f7db3fb6e7 100644 --- a/layout/generic/nsHTMLCanvasFrame.cpp +++ b/layout/generic/nsHTMLCanvasFrame.cpp @@ -236,19 +236,17 @@ nsHTMLCanvasFrame::PaintCanvas(nsIRenderingContext& aRenderingContext, if (inner.width == 0 || inner.height == 0) return; + gfxRect devInner(presContext->AppUnitsToGfxUnits(inner)); + nsIntSize sizeCSSPixels = GetCanvasSize(); - nsSize sizeAppUnits(nsPresContext::CSSPixelsToAppUnits(sizeCSSPixels.width), - nsPresContext::CSSPixelsToAppUnits(sizeCSSPixels.height)); + gfxFloat sx = devInner.size.width / (gfxFloat) sizeCSSPixels.width; + gfxFloat sy = devInner.size.height / (gfxFloat) sizeCSSPixels.height; gfxContext *ctx = aRenderingContext.ThebesContext(); - gfxFloat sx = inner.width / (gfxFloat) sizeAppUnits.width; - gfxFloat sy = inner.height / (gfxFloat) sizeAppUnits.height; - ctx->Save(); - ctx->Translate(gfxPoint(presContext->AppUnitsToGfxUnits(inner.x), - presContext->AppUnitsToGfxUnits(inner.y))); + ctx->Translate(devInner.pos); ctx->Scale(sx, sy); canvas->RenderContexts(ctx); diff --git a/layout/reftests/bugs/488692-1-ref.html b/layout/reftests/bugs/488692-1-ref.html new file mode 100644 index 00000000000..d21a0da083c --- /dev/null +++ b/layout/reftests/bugs/488692-1-ref.html @@ -0,0 +1,6 @@ + + + +
+ + diff --git a/layout/reftests/bugs/488692-1.html b/layout/reftests/bugs/488692-1.html new file mode 100644 index 00000000000..0fa0b6752b9 --- /dev/null +++ b/layout/reftests/bugs/488692-1.html @@ -0,0 +1,11 @@ + + + + + + + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index e5e672bfd7d..e164a05b29f 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1229,3 +1229,4 @@ fails-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 481948-3.html 481948-3-ref.html # differ == 487539-1.html about:blank == 488390-1.html 488390-1-ref.html == 488685-1.html 488685-1-ref.html +== 488692-1.html 488692-1-ref.html