Use the correct area for computing the gradient image for 'background-position: fixed' gradients. (Bug 509681) r=roc

This commit is contained in:
Michael Ventnor 2009-08-22 10:10:12 -07:00
parent b4f7befaba
commit 393f4ad8c7
4 changed files with 8 additions and 4 deletions

View File

@ -1963,10 +1963,6 @@ PaintBackgroundLayer(nsPresContext* aPresContext,
}
}
nsSize imageSize = imageRenderer.ComputeSize(bgPositioningArea.Size());
if (imageSize.width <= 0 || imageSize.height <= 0)
return;
// Compute the anchor point.
//
// relative to aBorderArea.TopLeft() (which is where the top-left
@ -2006,6 +2002,10 @@ PaintBackgroundLayer(nsPresContext* aPresContext,
} else {
offset = bgPositioningArea.TopLeft();
}
nsSize imageSize = imageRenderer.ComputeSize(bgPositioningArea.Size());
if (imageSize.width <= 0 || imageSize.height <= 0)
return;
// Scale the image as specified for background-size and as required for
// proper background positioning when background-position is defined with

View File

@ -0,0 +1 @@
<body style="border: 0; margin: 0; padding: 0;"><div style="background: -moz-linear-gradient(top, bottom, from(blue), to(aqua)) no-repeat; width: 100%; height: 100%;">&nbsp;</div></body>

View File

@ -0,0 +1,2 @@
<!-- bug 509681 -->
<body style="background: -moz-linear-gradient(top, bottom, from(blue), to(aqua)) fixed no-repeat;">

View File

@ -6,3 +6,4 @@
== nostops.html nostops-ref.html
== onestop.html onestop-ref.html
== twostops.html twostops-ref.html
== linear-viewport.html linear-viewport-ref.html