mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1189837 - Subtract scrollbars in LD pixels rather than CSS pixels. r=mstange
This commit is contained in:
parent
036c083e8d
commit
63a4a4b834
@ -263,6 +263,13 @@ struct LayoutDevicePixel {
|
|||||||
NSAppUnitsToFloatPixels(aPoint.y, aAppUnitsPerDevPixel));
|
NSAppUnitsToFloatPixels(aPoint.y, aAppUnitsPerDevPixel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static LayoutDeviceMargin FromAppUnits(const nsMargin& aMargin, nscoord aAppUnitsPerDevPixel) {
|
||||||
|
return LayoutDeviceMargin(NSAppUnitsToFloatPixels(aMargin.top, aAppUnitsPerDevPixel),
|
||||||
|
NSAppUnitsToFloatPixels(aMargin.right, aAppUnitsPerDevPixel),
|
||||||
|
NSAppUnitsToFloatPixels(aMargin.bottom, aAppUnitsPerDevPixel),
|
||||||
|
NSAppUnitsToFloatPixels(aMargin.left, aAppUnitsPerDevPixel));
|
||||||
|
}
|
||||||
|
|
||||||
static LayoutDeviceIntPoint FromAppUnitsRounded(const nsPoint& aPoint, nscoord aAppUnitsPerDevPixel) {
|
static LayoutDeviceIntPoint FromAppUnitsRounded(const nsPoint& aPoint, nscoord aAppUnitsPerDevPixel) {
|
||||||
return LayoutDeviceIntPoint(NSAppUnitsToIntPixels(aPoint.x, aAppUnitsPerDevPixel),
|
return LayoutDeviceIntPoint(NSAppUnitsToIntPixels(aPoint.x, aAppUnitsPerDevPixel),
|
||||||
NSAppUnitsToIntPixels(aPoint.y, aAppUnitsPerDevPixel));
|
NSAppUnitsToIntPixels(aPoint.y, aAppUnitsPerDevPixel));
|
||||||
|
@ -7901,8 +7901,9 @@ nsLayoutUtils::CalculateRootCompositionSize(nsIFrame* aFrame,
|
|||||||
// Adjust composition size for the size of scroll bars.
|
// Adjust composition size for the size of scroll bars.
|
||||||
nsIFrame* rootRootScrollFrame = rootPresShell ? rootPresShell->GetRootScrollFrame() : nullptr;
|
nsIFrame* rootRootScrollFrame = rootPresShell ? rootPresShell->GetRootScrollFrame() : nullptr;
|
||||||
nsMargin scrollbarMargins = ScrollbarAreaToExcludeFromCompositionBoundsFor(rootRootScrollFrame);
|
nsMargin scrollbarMargins = ScrollbarAreaToExcludeFromCompositionBoundsFor(rootRootScrollFrame);
|
||||||
CSSMargin margins = CSSMargin::FromAppUnits(scrollbarMargins);
|
LayoutDeviceMargin margins = LayoutDeviceMargin::FromAppUnits(scrollbarMargins,
|
||||||
// Scrollbars are not subject to scaling, so CSS pixels = layer pixels for them.
|
rootPresContext->AppUnitsPerDevPixel());
|
||||||
|
// Scrollbars are not subject to resolution scaling, so LD pixels = layer pixels for them.
|
||||||
rootCompositionSize.width -= margins.LeftRight();
|
rootCompositionSize.width -= margins.LeftRight();
|
||||||
rootCompositionSize.height -= margins.TopBottom();
|
rootCompositionSize.height -= margins.TopBottom();
|
||||||
|
|
||||||
@ -8433,8 +8434,9 @@ nsLayoutUtils::ComputeFrameMetrics(nsIFrame* aForFrame,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsMargin sizes = ScrollbarAreaToExcludeFromCompositionBoundsFor(aScrollFrame);
|
nsMargin sizes = ScrollbarAreaToExcludeFromCompositionBoundsFor(aScrollFrame);
|
||||||
// Scrollbars are not subject to scaling, so CSS pixels = layer pixels for them.
|
// Scrollbars are not subject to resolution scaling, so LD pixels = layer pixels for them.
|
||||||
ParentLayerMargin boundMargins = CSSMargin::FromAppUnits(sizes) * CSSToParentLayerScale(1.0f);
|
ParentLayerMargin boundMargins = LayoutDeviceMargin::FromAppUnits(sizes, auPerDevPixel)
|
||||||
|
* LayoutDeviceToParentLayerScale(1.0f);
|
||||||
frameBounds.Deflate(boundMargins);
|
frameBounds.Deflate(boundMargins);
|
||||||
|
|
||||||
metrics.SetCompositionBounds(frameBounds);
|
metrics.SetCompositionBounds(frameBounds);
|
||||||
|
Loading…
Reference in New Issue
Block a user