Bug 1923959: Resolve anchor for (max) sizes. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D240864
This commit is contained in:
@@ -12117,17 +12117,22 @@ PresShell::WindowSizeConstraints PresShell::GetWindowSizeConstraints() {
|
||||
return {minSize, maxSize};
|
||||
}
|
||||
const auto* pos = rootFrame->StylePosition();
|
||||
if (pos->GetMinWidth().ConvertsToLength()) {
|
||||
minSize.width = pos->GetMinWidth().ToLength();
|
||||
const auto positionProperty = rootFrame->StyleDisplay()->mPosition;
|
||||
if (const auto styleMinWidth = pos->GetMinWidth(positionProperty);
|
||||
styleMinWidth->ConvertsToLength()) {
|
||||
minSize.width = styleMinWidth->ToLength();
|
||||
}
|
||||
if (pos->GetMinHeight().ConvertsToLength()) {
|
||||
minSize.height = pos->GetMinHeight().ToLength();
|
||||
if (const auto styleMinHeight = pos->GetMinHeight(positionProperty);
|
||||
styleMinHeight->ConvertsToLength()) {
|
||||
minSize.height = styleMinHeight->ToLength();
|
||||
}
|
||||
if (pos->GetMaxWidth().ConvertsToLength()) {
|
||||
maxSize.width = pos->GetMaxWidth().ToLength();
|
||||
if (const auto maxWidth = pos->GetMaxWidth(positionProperty);
|
||||
maxWidth->ConvertsToLength()) {
|
||||
maxSize.width = maxWidth->ToLength();
|
||||
}
|
||||
if (pos->GetMaxHeight().ConvertsToLength()) {
|
||||
maxSize.height = pos->GetMaxHeight().ToLength();
|
||||
if (const auto maxHeight = pos->GetMaxHeight(positionProperty);
|
||||
maxHeight->ConvertsToLength()) {
|
||||
maxSize.height = maxHeight->ToLength();
|
||||
}
|
||||
return {minSize, maxSize};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user