Bug 1793689 - Make GetMinimumWidgetSize work properly on non-XUL flexbox. r=TYLin,layout-reviewers
The XUL behavior in nsBox.cpp is fairly different to what the non-XUL
layout code paths do. In particular, canOverride=false means that the
min-{width,height} properties cannot go under the min widget size of the
widget, but that doesn't mean that intrinsic sizes don't affect the
final size of the widget.
This is very visible if you turn on flex emulation on Windows or macOS,
where the toolbar has an appearance that returns
width=0,height=N,canOverride=false.
With flex emulation we'd collapse the item to be zero-width, which is
not good at all.
The good thing is that this is no longer exposed to the web
(non-native-theme always returns canOverride=true), and our front-end
code doesn't seem to rely on this, so we can just remove support for
canOverride=false.
Differential Revision: https://phabricator.services.mozilla.com/D158608
This commit is contained in:
@@ -1827,10 +1827,8 @@ nsITheme* nsTreeBodyFrame::GetTwistyRect(int32_t aRowIndex,
|
||||
}
|
||||
|
||||
if (useTheme) {
|
||||
LayoutDeviceIntSize minTwistySizePx;
|
||||
bool canOverride = true;
|
||||
theme->GetMinimumWidgetSize(aPresContext, this, appearance,
|
||||
&minTwistySizePx, &canOverride);
|
||||
LayoutDeviceIntSize minTwistySizePx =
|
||||
theme->GetMinimumWidgetSize(aPresContext, this, appearance);
|
||||
|
||||
// GMWS() returns size in pixels, we need to convert it back to app units
|
||||
nsSize minTwistySize;
|
||||
@@ -1839,8 +1837,9 @@ nsITheme* nsTreeBodyFrame::GetTwistyRect(int32_t aRowIndex,
|
||||
minTwistySize.height =
|
||||
aPresContext->DevPixelsToAppUnits(minTwistySizePx.height);
|
||||
|
||||
if (aTwistyRect.width < minTwistySize.width || !canOverride)
|
||||
if (aTwistyRect.width < minTwistySize.width) {
|
||||
aTwistyRect.width = minTwistySize.width;
|
||||
}
|
||||
}
|
||||
|
||||
return useTheme ? theme : nullptr;
|
||||
|
||||
Reference in New Issue
Block a user