diff --git a/layout/generic/nsHTMLCanvasFrame.cpp b/layout/generic/nsHTMLCanvasFrame.cpp index 6af9bb91e9d9..0f7db3fb6e77 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 000000000000..d21a0da083c9 --- /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 000000000000..0fa0b6752b9a --- /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 e5e672bfd7df..e164a05b29f0 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