mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 00:08:39 +09:00
Issue #2499 - Part 3: Add CSS clip overflow support with serialization fixes
This commit is contained in:
parent
205ea844f4
commit
5e8e1208e7
40 changed files with 144 additions and 97 deletions
|
|
@ -6406,22 +6406,35 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
|
|||
parentDisplay->mOverflowY,
|
||||
NS_STYLE_OVERFLOW_VISIBLE);
|
||||
|
||||
// CSS3 overflow-x and overflow-y require some fixup as well in some
|
||||
// cases. NS_STYLE_OVERFLOW_VISIBLE is meaningful only when used in both dimensions.
|
||||
// NS_STYLE_OVERFLOW_CLIP is now a standard value and should be preserved.
|
||||
if (display->mOverflowX != display->mOverflowY &&
|
||||
(display->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE ||
|
||||
display->mOverflowY == NS_STYLE_OVERFLOW_VISIBLE)) {
|
||||
// We can't store in the rule tree since a more specific rule might
|
||||
// change these conditions.
|
||||
// The visible/clip values of overflow compute to auto/hidden (respectively)
|
||||
// if one of overflow-x or overflow-y is neither visible nor clip.
|
||||
if (display->mOverflowX != display->mOverflowY) {
|
||||
conditions.SetUncacheable();
|
||||
|
||||
// Note: clip values are now preserved as-is when axes differ
|
||||
// Convert visible->auto only when paired with non-visible, non-clip values
|
||||
if (display->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE &&
|
||||
display->mOverflowY != NS_STYLE_OVERFLOW_CLIP) {
|
||||
display->mOverflowX = NS_STYLE_OVERFLOW_AUTO;
|
||||
}
|
||||
if (display->mOverflowY == NS_STYLE_OVERFLOW_VISIBLE &&
|
||||
display->mOverflowX != NS_STYLE_OVERFLOW_CLIP) {
|
||||
display->mOverflowY = NS_STYLE_OVERFLOW_AUTO;
|
||||
}
|
||||
|
||||
// Convert clip->hidden when paired with non-visible, non-clip values
|
||||
if (display->mOverflowX == NS_STYLE_OVERFLOW_CLIP &&
|
||||
display->mOverflowY != NS_STYLE_OVERFLOW_VISIBLE) {
|
||||
display->mOverflowX = NS_STYLE_OVERFLOW_HIDDEN;
|
||||
}
|
||||
if (display->mOverflowY == NS_STYLE_OVERFLOW_CLIP &&
|
||||
display->mOverflowX != NS_STYLE_OVERFLOW_VISIBLE) {
|
||||
display->mOverflowY = NS_STYLE_OVERFLOW_HIDDEN;
|
||||
}
|
||||
}
|
||||
|
||||
// When 'contain: paint', update overflow from 'visible' to 'clip'.
|
||||
if (display->IsContainPaint()) {
|
||||
// XXX This actually sets overflow-[x|y] to -moz-hidden-unscrollable.
|
||||
// XXX This actually sets overflow-[x|y] to clip.
|
||||
if (display->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE) {
|
||||
// This uncacheability (and the one below) could be fixed by adding
|
||||
// mOriginalOverflowX and mOriginalOverflowY fields, if necessary.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue