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:
David Shin
2025-04-08 02:29:18 +00:00
parent 40e6a5c66e
commit 85c922b0dd
33 changed files with 963 additions and 622 deletions

View File

@@ -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};
}