Issue #2780: Add back the mismatch overflow handling in nsRuleNode.cpp

This commit is contained in:
erixreyes 2025-07-08 00:46:07 +08:00 committed by roytam1
commit c3590da576

View file

@ -6427,6 +6427,15 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
display->mOverflowY = NS_STYLE_OVERFLOW_HIDDEN;
}
// If 'visible' is specified but doesn't match the other dimension, it
// turns into 'auto'.
if (display->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE) {
display->mOverflowX = NS_STYLE_OVERFLOW_AUTO;
}
if (display->mOverflowY == NS_STYLE_OVERFLOW_VISIBLE) {
display->mOverflowY = NS_STYLE_OVERFLOW_AUTO;
}
}
// When 'contain: paint', update overflow from 'visible' to 'clip'.