mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-29 08:54:28 +00: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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user