mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Issue #1370 - Part 3: Implement content keyword for flex-basis property
Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1105111
This commit is contained in:
parent
b6b20a04ec
commit
9dc59c43f1
9 changed files with 63 additions and 8 deletions
|
|
@ -4647,11 +4647,23 @@ nsFrame::SetCoordToFlexBasis(bool aIsInlineFlexItem,
|
|||
return;
|
||||
}
|
||||
|
||||
const nsStyleCoord* newCoord = aFlexBasis;
|
||||
|
||||
// Having 'content' as the value of the 'flex-basis' property is
|
||||
// equivalent to setting both 'flex-basis' and the main size
|
||||
// properties to 'auto', which is why a dummy 'auto' value will
|
||||
// be used here for the main size property.
|
||||
if (aFlexBasis->GetUnit() == eStyleUnit_Enumerated &&
|
||||
aFlexBasis->GetIntValue() == NS_STYLE_FLEX_BASIS_CONTENT) {
|
||||
static const nsStyleCoord autoStyleCoord(eStyleUnit_Auto);
|
||||
newCoord = &autoStyleCoord;
|
||||
}
|
||||
|
||||
// Override whichever styleCoord is in the flex container's main axis
|
||||
if (aIsInlineFlexItem) {
|
||||
*aInlineStyle = aFlexBasis;
|
||||
*aInlineStyle = newCoord;
|
||||
} else {
|
||||
*aBlockStyle = aFlexBasis;
|
||||
*aBlockStyle = newCoord;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue