mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1181087 - part 1 - Eliminate the few callers of physical-coordinate setters on the logical-coordinate geometry classes. r=smontagu
This commit is contained in:
parent
8e336f499c
commit
e3f1e25172
@ -230,10 +230,10 @@ nsMeterFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
LogicalSize autoSize(wm);
|
||||
autoSize.BSize(wm) = autoSize.ISize(wm) = fontMet->Font().size; // 1em
|
||||
|
||||
if (ResolvedOrientationIsVertical()) {
|
||||
autoSize.Height(wm) *= 5; // 5em
|
||||
if (ResolvedOrientationIsVertical() == wm.IsVertical()) {
|
||||
autoSize.ISize(wm) *= 5; // 5em
|
||||
} else {
|
||||
autoSize.Width(wm) *= 5; // 5em
|
||||
autoSize.BSize(wm) *= 5; // 5em
|
||||
}
|
||||
|
||||
return autoSize.ConvertTo(aWM, wm);
|
||||
|
@ -236,10 +236,10 @@ nsProgressFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
NSToCoordRound(StyleFont()->mFont.size *
|
||||
nsLayoutUtils::FontSizeInflationFor(this)); // 1em
|
||||
|
||||
if (ResolvedOrientationIsVertical()) {
|
||||
autoSize.Height(wm) *= 10; // 10em
|
||||
if (ResolvedOrientationIsVertical() == wm.IsVertical()) {
|
||||
autoSize.ISize(wm) *= 10; // 10em
|
||||
} else {
|
||||
autoSize.Width(wm) *= 10; // 10em
|
||||
autoSize.BSize(wm) *= 10; // 10em
|
||||
}
|
||||
|
||||
return autoSize.ConvertTo(aWM, wm);
|
||||
|
@ -215,11 +215,12 @@ nsTextControlFrame::CalcIntrinsicSize(nsRenderingContext* aRenderingContext,
|
||||
NS_ASSERTION(scrollableFrame, "Child must be scrollable");
|
||||
|
||||
if (scrollableFrame) {
|
||||
nsMargin scrollbarSizes =
|
||||
scrollableFrame->GetDesiredScrollbarSizes(PresContext(), aRenderingContext);
|
||||
LogicalMargin scrollbarSizes(aWM,
|
||||
scrollableFrame->GetDesiredScrollbarSizes(PresContext(),
|
||||
aRenderingContext));
|
||||
|
||||
aIntrinsicSize.Width(aWM) += scrollbarSizes.LeftRight();
|
||||
aIntrinsicSize.Height(aWM) += scrollbarSizes.TopBottom();
|
||||
aIntrinsicSize.ISize(aWM) += scrollbarSizes.IStartEnd(aWM);
|
||||
aIntrinsicSize.BSize(aWM) += scrollbarSizes.BStartEnd(aWM);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4328,20 +4328,20 @@ nsFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
||||
GetMinimumWidgetSize(presContext, this, disp->mAppearance,
|
||||
&widget, &canOverride);
|
||||
|
||||
// Dimensions from themed widgets are applied physically...
|
||||
nsSize size;
|
||||
size.width = presContext->DevPixelsToAppUnits(widget.width);
|
||||
size.height = presContext->DevPixelsToAppUnits(widget.height);
|
||||
// Convert themed widget's physical dimensions to logical coords
|
||||
LogicalSize size(aWM,
|
||||
nsSize(presContext->DevPixelsToAppUnits(widget.width),
|
||||
presContext->DevPixelsToAppUnits(widget.height)));
|
||||
|
||||
// GMWS() returns border-box; we need content-box
|
||||
size.width -= aBorder.Width(aWM) + aPadding.Width(aWM);
|
||||
size.height -= aBorder.Height(aWM) + aPadding.Height(aWM);
|
||||
size.ISize(aWM) -= aBorder.ISize(aWM) + aPadding.ISize(aWM);
|
||||
size.BSize(aWM) -= aBorder.BSize(aWM) + aPadding.BSize(aWM);
|
||||
|
||||
if (size.height > result.Height(aWM) || !canOverride) {
|
||||
result.Height(aWM) = size.height;
|
||||
if (size.BSize(aWM) > result.BSize(aWM) || !canOverride) {
|
||||
result.BSize(aWM) = size.BSize(aWM);
|
||||
}
|
||||
if (size.width > result.Width(aWM) || !canOverride) {
|
||||
result.Width(aWM) = size.width;
|
||||
if (size.ISize(aWM) > result.ISize(aWM) || !canOverride) {
|
||||
result.ISize(aWM) = size.ISize(aWM);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1960,10 +1960,10 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(
|
||||
// Note: We don't emulate this quirk for percents in calc() or in
|
||||
// vertical writing modes.
|
||||
if (!wm.IsVertical() &&
|
||||
NS_AUTOHEIGHT == cbSize.Height(wm)) {
|
||||
NS_AUTOHEIGHT == cbSize.BSize(wm)) {
|
||||
if (eCompatibility_NavQuirks == aPresContext->CompatibilityMode() &&
|
||||
mStylePosition->mHeight.GetUnit() == eStyleUnit_Percent) {
|
||||
cbSize.Height(wm) = CalcQuirkContainingBlockHeight(aContainingBlockRS);
|
||||
cbSize.BSize(wm) = CalcQuirkContainingBlockHeight(aContainingBlockRS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user