mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 897787. Use background-size in preference to background positioning area size for a background-image's preferered size. r=roc
This commit is contained in:
parent
9c23e87963
commit
8a2940a22f
@ -3131,18 +3131,19 @@ nsCSSRendering::PrepareBackgroundLayer(nsPresContext* aPresContext,
|
||||
// proper background positioning when background-position is defined with
|
||||
// percentages.
|
||||
CSSSizeOrRatio intrinsicSize = state.mImageRenderer.ComputeIntrinsicSize();
|
||||
nsSize bgPositionSize = bgPositioningArea.Size();
|
||||
nsSize imageSize = ComputeDrawnSizeForBackground(intrinsicSize,
|
||||
bgPositioningArea.Size(),
|
||||
bgPositionSize,
|
||||
aLayer.mSize);
|
||||
if (imageSize.width <= 0 || imageSize.height <= 0)
|
||||
return state;
|
||||
|
||||
state.mImageRenderer.SetPreferredSize(intrinsicSize,
|
||||
bgPositioningArea.Size());
|
||||
imageSize);
|
||||
|
||||
// Compute the position of the background now that the background's size is
|
||||
// determined.
|
||||
ComputeBackgroundAnchorPoint(aLayer, bgPositioningArea.Size(), imageSize,
|
||||
ComputeBackgroundAnchorPoint(aLayer, bgPositionSize, imageSize,
|
||||
&imageTopLeft, &state.mAnchor);
|
||||
imageTopLeft += bgPositioningArea.TopLeft();
|
||||
state.mAnchor += bgPositioningArea.TopLeft();
|
||||
|
Loading…
Reference in New Issue
Block a user