Bug 1117983 - Part 3: Implement the min-{block,inline}-size logical properties. r=dbaron

This commit is contained in:
Cameron McCormack 2015-01-17 15:50:09 +11:00
Родитель c7bda81337
Коммит 228d7a7703
5 изменённых файлов: 84 добавлений и 1 удалений

Просмотреть файл

@ -2467,6 +2467,41 @@ CSS_PROP_POSITION(
nullptr,
offsetof(nsStylePosition, mMinHeight),
eStyleAnimType_Coord)
CSS_PROP_LOGICAL(
min-block-size,
min_block_size,
MinBlockSize,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_AXIS |
CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
"layout.css.vertical-text.enabled",
VARIANT_AHKLP | VARIANT_CALC,
kWidthKTable,
MinSize,
Position,
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_LOGICAL(
min-inline-size,
min_inline_size,
MinInlineSize,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_STORES_CALC |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_LOGICAL |
CSS_PROPERTY_LOGICAL_AXIS,
"layout.css.vertical-text.enabled",
VARIANT_AHKLP | VARIANT_CALC,
kWidthKTable,
MinSize,
Position,
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
CSS_PROP_POSITION(
min-width,
min_width,

Просмотреть файл

@ -51,4 +51,5 @@ CSS_PROP_LOGICAL_GROUP_SHORTHAND(BorderWidth)
CSS_PROP_LOGICAL_GROUP_SHORTHAND(Margin)
CSS_PROP_LOGICAL_GROUP_AXIS(MaxSize)
CSS_PROP_LOGICAL_GROUP_SHORTHAND(Padding)
CSS_PROP_LOGICAL_GROUP_AXIS(MinSize)
CSS_PROP_LOGICAL_GROUP_AXIS(Size)

Просмотреть файл

@ -2562,6 +2562,12 @@ static const nsCSSProperty gMaxSizeLogicalGroupTable[] = {
eCSSProperty_UNKNOWN
};
static const nsCSSProperty gMinSizeLogicalGroupTable[] = {
eCSSProperty_min_height,
eCSSProperty_min_width,
eCSSProperty_UNKNOWN
};
static const nsCSSProperty gSizeLogicalGroupTable[] = {
eCSSProperty_height,
eCSSProperty_width,

Просмотреть файл

@ -7473,7 +7473,10 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
SETCOORD_LPAH | SETCOORD_INITIAL_AUTO | SETCOORD_STORE_CALC |
SETCOORD_UNSET_INITIAL,
aContext, mPresContext, canStoreInRuleTree);
SetCoord(*aRuleData->ValueForMinHeight(), pos->mMinHeight, parentPos->mMinHeight,
const nsCSSValue* minHeight = aRuleData->ValueForMinHeight();
SetCoord(minHeight->GetUnit() == eCSSUnit_Enumerated ?
nsCSSValue(eCSSUnit_Unset) : *minHeight,
pos->mMinHeight, parentPos->mMinHeight,
SETCOORD_LPAH | SETCOORD_INITIAL_AUTO | SETCOORD_STORE_CALC |
SETCOORD_UNSET_INITIAL,
aContext, mPresContext, canStoreInRuleTree);

Просмотреть файл

@ -4555,6 +4555,8 @@ function logical_axis_prop_get_computed(cs, property)
"inline-size": { horizontal: "width", vertical: "height" },
"max-block-size": { horizontal: "max-height", vertical: "max-width" },
"max-inline-size": { horizontal: "max-width", vertical: "max-height" },
"min-block-size": { horizontal: "min-height", vertical: "min-width" },
"min-inline-size": { horizontal: "min-width", vertical: "min-height" },
};
if (!mappings[property]) {
@ -5065,6 +5067,42 @@ if (SpecialPowers.getBoolPref("layout.css.vertical-text.enabled")) {
],
invalid_values: ["none", "5" ]
},
"min-block-size": {
domProp: "minBlockSize",
inherited: false,
type: CSS_TYPE_LONGHAND,
logical: true,
axis: true,
get_computed: logical_axis_prop_get_computed,
prerequisites: { "display": "block" },
initial_values: [ "auto", "0", "calc(0em)", "calc(-2px)", "calc(-1%)" ],
other_values: [ "30px", "50%",
"calc(2px)",
"calc(50%)",
"calc(3*25px)",
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: ["none", "5" ]
},
"min-inline-size": {
domProp: "minInlineSize",
inherited: false,
type: CSS_TYPE_LONGHAND,
logical: true,
axis: true,
get_computed: logical_axis_prop_get_computed,
prerequisites: { "display": "block" },
initial_values: [ "auto", "0", "calc(0em)", "calc(-2px)", "calc(-1%)" ],
other_values: [ "30px", "50%",
"calc(2px)",
"calc(50%)",
"calc(3*25px)",
"calc(25px*3)",
"calc(3*25px + 50%)",
],
invalid_values: ["none", "5" ]
},
"padding-block-end": {
domProp: "paddingBlockEnd",
inherited: false,