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
c63f96f6f6
commit
86ef51386e
@ -263,6 +263,13 @@ struct LayoutDevicePixel {
|
||||
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) {
|
||||
return LayoutDeviceIntPoint(NSAppUnitsToIntPixels(aPoint.x, aAppUnitsPerDevPixel),
|
||||
NSAppUnitsToIntPixels(aPoint.y, aAppUnitsPerDevPixel));
|
||||
|
@ -7901,8 +7901,9 @@ nsLayoutUtils::CalculateRootCompositionSize(nsIFrame* aFrame,
|
||||
// Adjust composition size for the size of scroll bars.
|
||||
nsIFrame* rootRootScrollFrame = rootPresShell ? rootPresShell->GetRootScrollFrame() : nullptr;
|
||||
nsMargin scrollbarMargins = ScrollbarAreaToExcludeFromCompositionBoundsFor(rootRootScrollFrame);
|
||||
CSSMargin margins = CSSMargin::FromAppUnits(scrollbarMargins);
|
||||
// Scrollbars are not subject to scaling, so CSS pixels = layer pixels for them.
|
||||
LayoutDeviceMargin margins = LayoutDeviceMargin::FromAppUnits(scrollbarMargins,
|
||||
rootPresContext->AppUnitsPerDevPixel());
|
||||
// Scrollbars are not subject to resolution scaling, so LD pixels = layer pixels for them.
|
||||
rootCompositionSize.width -= margins.LeftRight();
|
||||
rootCompositionSize.height -= margins.TopBottom();
|
||||
|
||||
@ -8433,8 +8434,9 @@ nsLayoutUtils::ComputeFrameMetrics(nsIFrame* aForFrame,
|
||||
}
|
||||
|
||||
nsMargin sizes = ScrollbarAreaToExcludeFromCompositionBoundsFor(aScrollFrame);
|
||||
// Scrollbars are not subject to scaling, so CSS pixels = layer pixels for them.
|
||||
ParentLayerMargin boundMargins = CSSMargin::FromAppUnits(sizes) * CSSToParentLayerScale(1.0f);
|
||||
// Scrollbars are not subject to resolution scaling, so LD pixels = layer pixels for them.
|
||||
ParentLayerMargin boundMargins = LayoutDeviceMargin::FromAppUnits(sizes, auPerDevPixel)
|
||||
* LayoutDeviceToParentLayerScale(1.0f);
|
||||
frameBounds.Deflate(boundMargins);
|
||||
|
||||
metrics.SetCompositionBounds(frameBounds);
|
||||
|
Loading…
Reference in New Issue
Block a user