mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-19 23:07:33 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
96fb72ec56
106 changed files with 4038 additions and 1148 deletions
|
|
@ -1248,18 +1248,6 @@ Declaration::GetPropertyValueInternal(
|
|||
// #2 <'grid-template-rows'> / [ auto-flow && dense? ] <'grid-auto-columns'>?
|
||||
// #3 [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>
|
||||
case eCSSProperty_grid: {
|
||||
const nsCSSValue& columnGapValue =
|
||||
*data->ValueFor(eCSSProperty_grid_column_gap);
|
||||
if (columnGapValue.GetUnit() != eCSSUnit_Pixel ||
|
||||
columnGapValue.GetFloatValue() != 0.0f) {
|
||||
return; // Not serializable, bail.
|
||||
}
|
||||
const nsCSSValue& rowGapValue =
|
||||
*data->ValueFor(eCSSProperty_grid_row_gap);
|
||||
if (rowGapValue.GetUnit() != eCSSUnit_Pixel ||
|
||||
rowGapValue.GetFloatValue() != 0.0f) {
|
||||
return; // Not serializable, bail.
|
||||
}
|
||||
const nsCSSValue& areasValue =
|
||||
*data->ValueFor(eCSSProperty_grid_template_areas);
|
||||
const nsCSSValue& columnsValue =
|
||||
|
|
@ -1475,7 +1463,7 @@ Declaration::GetPropertyValueInternal(
|
|||
}
|
||||
MOZ_FALLTHROUGH;
|
||||
}
|
||||
case eCSSProperty_grid_gap: {
|
||||
case eCSSProperty_gap: {
|
||||
const nsCSSPropertyID* subprops =
|
||||
nsCSSProps::SubpropertyEntryFor(aProperty);
|
||||
MOZ_ASSERT(subprops[2] == eCSSProperty_UNKNOWN,
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ CSS_KEY(column, column)
|
|||
CSS_KEY(column-reverse, column_reverse)
|
||||
CSS_KEY(condensed, condensed)
|
||||
CSS_KEY(contain, contain)
|
||||
CSS_KEY(content, content)
|
||||
CSS_KEY(content-box, content_box)
|
||||
CSS_KEY(contents, contents)
|
||||
CSS_KEY(context-fill, context_fill)
|
||||
|
|
|
|||
|
|
@ -1015,7 +1015,7 @@ protected:
|
|||
bool ParseGridColumnRow(nsCSSPropertyID aStartPropID,
|
||||
nsCSSPropertyID aEndPropID);
|
||||
bool ParseGridArea();
|
||||
bool ParseGridGap();
|
||||
bool ParseGap();
|
||||
|
||||
bool ParseInitialLetter();
|
||||
|
||||
|
|
@ -8638,7 +8638,7 @@ CSSParserImpl::ParseFlex()
|
|||
// "a unitless zero that is not already preceded by two flex factors must be
|
||||
// interpreted as a flex factor.
|
||||
if (ParseNonNegativeVariant(tmpVal, flexBasisVariantMask | VARIANT_NUMBER,
|
||||
nsCSSProps::kWidthKTable) != CSSParseResult::Ok) {
|
||||
nsCSSProps::kFlexBasisKTable) != CSSParseResult::Ok) {
|
||||
// First component was not a valid flex-basis or flex-grow value. Fail.
|
||||
return false;
|
||||
}
|
||||
|
|
@ -8687,7 +8687,7 @@ CSSParserImpl::ParseFlex()
|
|||
if (!wasFirstComponentFlexBasis) {
|
||||
CSSParseResult result =
|
||||
ParseNonNegativeVariant(tmpVal, flexBasisVariantMask,
|
||||
nsCSSProps::kWidthKTable);
|
||||
nsCSSProps::kFlexBasisKTable);
|
||||
if (result == CSSParseResult::Error) {
|
||||
return false;
|
||||
} else if (result == CSSParseResult::Ok) {
|
||||
|
|
@ -9774,13 +9774,6 @@ CSSParserImpl::ParseGrid()
|
|||
return true;
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-grid/#grid-shorthand
|
||||
// "Also, the gutter properties are reset by this shorthand,
|
||||
// even though they can't be set by it."
|
||||
value.SetFloatValue(0.0f, eCSSUnit_Pixel);
|
||||
AppendValue(eCSSProperty_grid_row_gap, value);
|
||||
AppendValue(eCSSProperty_grid_column_gap, value);
|
||||
|
||||
// [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>
|
||||
auto res = ParseGridShorthandAutoProps(NS_STYLE_GRID_AUTO_FLOW_ROW);
|
||||
if (res == CSSParseResult::Error) {
|
||||
|
|
@ -10087,12 +10080,12 @@ CSSParserImpl::ParseGridArea()
|
|||
}
|
||||
|
||||
bool
|
||||
CSSParserImpl::ParseGridGap()
|
||||
CSSParserImpl::ParseGap()
|
||||
{
|
||||
nsCSSValue first;
|
||||
if (ParseSingleTokenVariant(first, VARIANT_INHERIT, nullptr)) {
|
||||
AppendValue(eCSSProperty_grid_row_gap, first);
|
||||
AppendValue(eCSSProperty_grid_column_gap, first);
|
||||
AppendValue(eCSSProperty_row_gap, first);
|
||||
AppendValue(eCSSProperty_column_gap, first);
|
||||
return true;
|
||||
}
|
||||
if (ParseNonNegativeVariant(first, VARIANT_LPCALC, nullptr) !=
|
||||
|
|
@ -10104,8 +10097,8 @@ CSSParserImpl::ParseGridGap()
|
|||
if (result == CSSParseResult::Error) {
|
||||
return false;
|
||||
}
|
||||
AppendValue(eCSSProperty_grid_row_gap, first);
|
||||
AppendValue(eCSSProperty_grid_column_gap,
|
||||
AppendValue(eCSSProperty_row_gap, first);
|
||||
AppendValue(eCSSProperty_column_gap,
|
||||
result == CSSParseResult::NotFound ? first : second);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -12005,8 +11998,8 @@ CSSParserImpl::ParsePropertyByFunction(nsCSSPropertyID aPropID)
|
|||
eCSSProperty_grid_row_end);
|
||||
case eCSSProperty_grid_area:
|
||||
return ParseGridArea();
|
||||
case eCSSProperty_grid_gap:
|
||||
return ParseGridGap();
|
||||
case eCSSProperty_gap:
|
||||
return ParseGap();
|
||||
case eCSSProperty_image_region:
|
||||
return ParseRect(eCSSProperty_image_region);
|
||||
case eCSSProperty_align_content:
|
||||
|
|
|
|||
|
|
@ -34,6 +34,18 @@
|
|||
|
||||
******/
|
||||
|
||||
CSS_PROP_ALIAS(grid-gap,
|
||||
gap,
|
||||
GridGap,
|
||||
"")
|
||||
CSS_PROP_ALIAS(grid-column-gap,
|
||||
column_gap,
|
||||
GridColumnGap,
|
||||
"")
|
||||
CSS_PROP_ALIAS(grid-row-gap,
|
||||
row_gap,
|
||||
GridRowGap,
|
||||
"")
|
||||
CSS_PROP_ALIAS(word-wrap,
|
||||
overflow_wrap,
|
||||
WordWrap,
|
||||
|
|
|
|||
|
|
@ -1516,7 +1516,7 @@ CSS_PROP_COLUMN(
|
|||
kColumnFillKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_Discrete)
|
||||
CSS_PROP_COLUMN(
|
||||
CSS_PROP_POSITION(
|
||||
column-gap,
|
||||
column_gap,
|
||||
ColumnGap,
|
||||
|
|
@ -1525,7 +1525,7 @@ CSS_PROP_COLUMN(
|
|||
"",
|
||||
VARIANT_HLP | VARIANT_NORMAL | VARIANT_CALC,
|
||||
nullptr,
|
||||
offsetof(nsStyleColumn, mColumnGap),
|
||||
offsetof(nsStylePosition, mColumnGap),
|
||||
eStyleAnimType_Coord)
|
||||
CSS_PROP_SHORTHAND(
|
||||
column-rule,
|
||||
|
|
@ -1758,7 +1758,7 @@ CSS_PROP_POSITION(
|
|||
// its own code to parse each subproperty. It does not depend on the
|
||||
// longhand parsing defined here.
|
||||
VARIANT_AHKLP | VARIANT_CALC,
|
||||
kWidthKTable,
|
||||
kFlexBasisKTable,
|
||||
offsetof(nsStylePosition, mFlexBasis),
|
||||
eStyleAnimType_Coord)
|
||||
CSS_PROP_POSITION(
|
||||
|
|
@ -2099,26 +2099,31 @@ CSS_PROP_UIRESET(
|
|||
nullptr,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_Discrete) // bug 58646
|
||||
CSS_PROP_SHORTHAND(
|
||||
gap,
|
||||
gap,
|
||||
Gap,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"")
|
||||
CSS_PROP_SHORTHAND(
|
||||
grid,
|
||||
grid,
|
||||
Grid,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled")
|
||||
"")
|
||||
CSS_PROP_SHORTHAND(
|
||||
grid-area,
|
||||
grid_area,
|
||||
GridArea,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled")
|
||||
"")
|
||||
CSS_PROP_POSITION(
|
||||
grid-auto-columns,
|
||||
grid_auto_columns,
|
||||
GridAutoColumns,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_STORES_CALC |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
CSS_PROPERTY_STORES_CALC,
|
||||
"",
|
||||
0,
|
||||
kGridTrackBreadthKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -2127,9 +2132,8 @@ CSS_PROP_POSITION(
|
|||
grid-auto-flow,
|
||||
grid_auto_flow,
|
||||
GridAutoFlow,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"",
|
||||
0,
|
||||
kGridAutoFlowKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -2139,9 +2143,8 @@ CSS_PROP_POSITION(
|
|||
grid_auto_rows,
|
||||
GridAutoRows,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_STORES_CALC |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
CSS_PROPERTY_STORES_CALC,
|
||||
"",
|
||||
0,
|
||||
kGridTrackBreadthKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -2151,79 +2154,49 @@ CSS_PROP_SHORTHAND(
|
|||
grid_column,
|
||||
GridColumn,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled")
|
||||
"")
|
||||
CSS_PROP_POSITION(
|
||||
grid-column-end,
|
||||
grid_column_end,
|
||||
GridColumnEnd,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled",
|
||||
"",
|
||||
0,
|
||||
nullptr,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_Discrete)
|
||||
CSS_PROP_POSITION(
|
||||
grid-column-gap,
|
||||
grid_column_gap,
|
||||
GridColumnGap,
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_VALUE_NONNEGATIVE |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
VARIANT_HLP | VARIANT_CALC,
|
||||
nullptr,
|
||||
offsetof(nsStylePosition, mGridColumnGap),
|
||||
eStyleAnimType_Coord)
|
||||
CSS_PROP_POSITION(
|
||||
grid-column-start,
|
||||
grid_column_start,
|
||||
GridColumnStart,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled",
|
||||
"",
|
||||
0,
|
||||
nullptr,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_Discrete)
|
||||
CSS_PROP_SHORTHAND(
|
||||
grid-gap,
|
||||
grid_gap,
|
||||
GridGap,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled")
|
||||
CSS_PROP_SHORTHAND(
|
||||
grid-row,
|
||||
grid_row,
|
||||
GridRow,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled")
|
||||
"")
|
||||
CSS_PROP_POSITION(
|
||||
grid-row-end,
|
||||
grid_row_end,
|
||||
GridRowEnd,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled",
|
||||
"",
|
||||
0,
|
||||
nullptr,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_Discrete)
|
||||
CSS_PROP_POSITION(
|
||||
grid-row-gap,
|
||||
grid_row_gap,
|
||||
GridRowGap,
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_VALUE_NONNEGATIVE |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
VARIANT_HLP | VARIANT_CALC,
|
||||
nullptr,
|
||||
offsetof(nsStylePosition, mGridRowGap),
|
||||
eStyleAnimType_Coord)
|
||||
CSS_PROP_POSITION(
|
||||
grid-row-start,
|
||||
grid_row_start,
|
||||
GridRowStart,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled",
|
||||
"",
|
||||
0,
|
||||
nullptr,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -2233,14 +2206,13 @@ CSS_PROP_SHORTHAND(
|
|||
grid_template,
|
||||
GridTemplate,
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"layout.css.grid.enabled")
|
||||
"")
|
||||
CSS_PROP_POSITION(
|
||||
grid-template-areas,
|
||||
grid_template_areas,
|
||||
GridTemplateAreas,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
CSS_PROPERTY_PARSE_FUNCTION,
|
||||
"",
|
||||
0,
|
||||
nullptr,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -2251,9 +2223,8 @@ CSS_PROP_POSITION(
|
|||
GridTemplateColumns,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_STORES_CALC |
|
||||
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
|
||||
"",
|
||||
0,
|
||||
kGridTrackBreadthKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -2264,9 +2235,8 @@ CSS_PROP_POSITION(
|
|||
GridTemplateRows,
|
||||
CSS_PROPERTY_PARSE_FUNCTION |
|
||||
CSS_PROPERTY_STORES_CALC |
|
||||
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
|
||||
CSS_PROPERTY_ENABLED_IN_UA_SHEETS,
|
||||
"layout.css.grid.enabled",
|
||||
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
|
||||
"",
|
||||
0,
|
||||
kGridTrackBreadthKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
|
@ -3560,6 +3530,17 @@ CSS_PROP_POSITION(
|
|||
nullptr,
|
||||
offsetof(nsStylePosition, mOffset),
|
||||
eStyleAnimType_Sides_Right)
|
||||
CSS_PROP_POSITION(
|
||||
row-gap,
|
||||
row_gap,
|
||||
RowGap,
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_VALUE_NONNEGATIVE,
|
||||
"",
|
||||
VARIANT_HLP | VARIANT_NORMAL | VARIANT_CALC,
|
||||
nullptr,
|
||||
offsetof(nsStylePosition, mRowGap),
|
||||
eStyleAnimType_Coord)
|
||||
CSS_PROP_TEXT(
|
||||
ruby-align,
|
||||
ruby_align,
|
||||
|
|
|
|||
|
|
@ -1334,7 +1334,6 @@ KTableEntry nsCSSProps::kDisplayKTable[] = {
|
|||
{ eCSSKeyword_ruby_base_container, StyleDisplay::RubyBaseContainer },
|
||||
{ eCSSKeyword_ruby_text, StyleDisplay::RubyText },
|
||||
{ eCSSKeyword_ruby_text_container, StyleDisplay::RubyTextContainer },
|
||||
// The next two entries are controlled by the layout.css.grid.enabled pref.
|
||||
{ eCSSKeyword_grid, StyleDisplay::Grid },
|
||||
{ eCSSKeyword_inline_grid, StyleDisplay::InlineGrid },
|
||||
// The next 4 entries are controlled by the layout.css.prefixes.webkit pref.
|
||||
|
|
@ -2264,6 +2263,20 @@ const KTableEntry nsCSSProps::kWidthKTable[] = {
|
|||
{ eCSSKeyword_UNKNOWN, -1 }
|
||||
};
|
||||
|
||||
// This must be the same as kWidthKTable, but just with 'content' added:
|
||||
const KTableEntry nsCSSProps::kFlexBasisKTable[] = {
|
||||
{ eCSSKeyword__moz_max_content, NS_STYLE_WIDTH_MAX_CONTENT },
|
||||
{ eCSSKeyword__moz_min_content, NS_STYLE_WIDTH_MIN_CONTENT },
|
||||
{ eCSSKeyword__moz_fit_content, NS_STYLE_WIDTH_FIT_CONTENT },
|
||||
{ eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE },
|
||||
{ eCSSKeyword_content, NS_STYLE_FLEX_BASIS_CONTENT },
|
||||
{ eCSSKeyword_UNKNOWN, -1 }
|
||||
};
|
||||
static_assert(ArrayLength(nsCSSProps::kFlexBasisKTable) ==
|
||||
ArrayLength(nsCSSProps::kWidthKTable) + 1,
|
||||
"kFlexBasisKTable should have the same entries as "
|
||||
"kWidthKTable, plus one more for 'content'");
|
||||
|
||||
const KTableEntry nsCSSProps::kWindowDraggingKTable[] = {
|
||||
{ eCSSKeyword_default, StyleWindowDragging::Default },
|
||||
{ eCSSKeyword_drag, StyleWindowDragging::Drag },
|
||||
|
|
@ -2955,8 +2968,6 @@ static const nsCSSPropertyID gGridSubpropTable[] = {
|
|||
eCSSProperty_grid_auto_flow,
|
||||
eCSSProperty_grid_auto_rows,
|
||||
eCSSProperty_grid_auto_columns,
|
||||
eCSSProperty_grid_row_gap, // can only be reset, not get/set
|
||||
eCSSProperty_grid_column_gap, // can only be reset, not get/set
|
||||
eCSSProperty_UNKNOWN
|
||||
};
|
||||
|
||||
|
|
@ -2980,9 +2991,9 @@ static const nsCSSPropertyID gGridAreaSubpropTable[] = {
|
|||
eCSSProperty_UNKNOWN
|
||||
};
|
||||
|
||||
static const nsCSSPropertyID gGridGapSubpropTable[] = {
|
||||
eCSSProperty_grid_row_gap,
|
||||
eCSSProperty_grid_column_gap,
|
||||
static const nsCSSPropertyID gGapSubpropTable[] = {
|
||||
eCSSProperty_row_gap,
|
||||
eCSSProperty_column_gap,
|
||||
eCSSProperty_UNKNOWN
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -892,6 +892,7 @@ public:
|
|||
static const KTableEntry kVolumeKTable[];
|
||||
static const KTableEntry kWhitespaceKTable[];
|
||||
static const KTableEntry kWidthKTable[]; // also min-width, max-width
|
||||
static const KTableEntry kFlexBasisKTable[];
|
||||
static const KTableEntry kWindowDraggingKTable[];
|
||||
static const KTableEntry kWindowShadowKTable[];
|
||||
static const KTableEntry kWordBreakKTable[];
|
||||
|
|
|
|||
|
|
@ -1092,21 +1092,6 @@ nsComputedDOMStyle::DoGetColumnWidth()
|
|||
return val.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetColumnGap()
|
||||
{
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
|
||||
const nsStyleColumn* column = StyleColumn();
|
||||
if (column->mColumnGap.GetUnit() == eStyleUnit_Normal) {
|
||||
val->SetAppUnits(StyleFont()->mFont.size);
|
||||
} else {
|
||||
SetValueToCoord(val, StyleColumn()->mColumnGap, true);
|
||||
}
|
||||
|
||||
return val.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetColumnFill()
|
||||
{
|
||||
|
|
@ -3003,18 +2988,32 @@ nsComputedDOMStyle::DoGetGridRowEnd()
|
|||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetGridColumnGap()
|
||||
nsComputedDOMStyle::DoGetColumnGap()
|
||||
{
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
SetValueToCoord(val, StylePosition()->mGridColumnGap, true);
|
||||
|
||||
const nsStylePosition* positionData = StylePosition();
|
||||
if (positionData->mColumnGap.GetUnit() == eStyleUnit_Normal) {
|
||||
val->SetIdent(eCSSKeyword_normal);
|
||||
} else {
|
||||
SetValueToCoord(val, positionData->mColumnGap, true);
|
||||
}
|
||||
|
||||
return val.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetGridRowGap()
|
||||
nsComputedDOMStyle::DoGetRowGap()
|
||||
{
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
SetValueToCoord(val, StylePosition()->mGridRowGap, true);
|
||||
|
||||
const nsStylePosition* positionData = StylePosition();
|
||||
if (positionData->mRowGap.GetUnit() == eStyleUnit_Normal) {
|
||||
val->SetIdent(eCSSKeyword_normal);
|
||||
} else {
|
||||
SetValueToCoord(val, positionData->mRowGap, true);
|
||||
}
|
||||
|
||||
return val.forget();
|
||||
}
|
||||
|
||||
|
|
@ -4425,7 +4424,7 @@ nsComputedDOMStyle::DoGetFlexBasis()
|
|||
// }
|
||||
|
||||
SetValueToCoord(val, StylePosition()->mFlexBasis, true,
|
||||
nullptr, nsCSSProps::kWidthKTable);
|
||||
nullptr, nsCSSProps::kFlexBasisKTable);
|
||||
return val.forget();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -286,8 +286,6 @@ private:
|
|||
already_AddRefed<CSSValue> DoGetGridColumnEnd();
|
||||
already_AddRefed<CSSValue> DoGetGridRowStart();
|
||||
already_AddRefed<CSSValue> DoGetGridRowEnd();
|
||||
already_AddRefed<CSSValue> DoGetGridColumnGap();
|
||||
already_AddRefed<CSSValue> DoGetGridRowGap();
|
||||
|
||||
/* StyleImageLayer properties */
|
||||
already_AddRefed<CSSValue> DoGetImageLayerImage(const nsStyleImageLayers& aLayers);
|
||||
|
|
@ -503,7 +501,6 @@ private:
|
|||
already_AddRefed<CSSValue> DoGetColumnCount();
|
||||
already_AddRefed<CSSValue> DoGetColumnFill();
|
||||
already_AddRefed<CSSValue> DoGetColumnWidth();
|
||||
already_AddRefed<CSSValue> DoGetColumnGap();
|
||||
already_AddRefed<CSSValue> DoGetColumnRuleWidth();
|
||||
already_AddRefed<CSSValue> DoGetColumnRuleStyle();
|
||||
already_AddRefed<CSSValue> DoGetColumnRuleColor();
|
||||
|
|
@ -541,6 +538,8 @@ private:
|
|||
already_AddRefed<CSSValue> DoGetJustifyContent();
|
||||
already_AddRefed<CSSValue> DoGetJustifyItems();
|
||||
already_AddRefed<CSSValue> DoGetJustifySelf();
|
||||
already_AddRefed<CSSValue> DoGetColumnGap();
|
||||
already_AddRefed<CSSValue> DoGetRowGap();
|
||||
|
||||
/* SVG properties */
|
||||
already_AddRefed<CSSValue> DoGetFill();
|
||||
|
|
|
|||
|
|
@ -151,10 +151,8 @@ COMPUTED_STYLE_PROP(grid_auto_columns, GridAutoColumns)
|
|||
COMPUTED_STYLE_PROP(grid_auto_flow, GridAutoFlow)
|
||||
COMPUTED_STYLE_PROP(grid_auto_rows, GridAutoRows)
|
||||
COMPUTED_STYLE_PROP(grid_column_end, GridColumnEnd)
|
||||
COMPUTED_STYLE_PROP(grid_column_gap, GridColumnGap)
|
||||
COMPUTED_STYLE_PROP(grid_column_start, GridColumnStart)
|
||||
COMPUTED_STYLE_PROP(grid_row_end, GridRowEnd)
|
||||
COMPUTED_STYLE_PROP(grid_row_gap, GridRowGap)
|
||||
COMPUTED_STYLE_PROP(grid_row_start, GridRowStart)
|
||||
COMPUTED_STYLE_PROP(grid_template_areas, GridTemplateAreas)
|
||||
COMPUTED_STYLE_PROP(grid_template_columns, GridTemplateColumns)
|
||||
|
|
@ -217,6 +215,7 @@ COMPUTED_STYLE_PROP(position, Position)
|
|||
COMPUTED_STYLE_PROP(quotes, Quotes)
|
||||
COMPUTED_STYLE_PROP(resize, Resize)
|
||||
COMPUTED_STYLE_PROP(right, Right)
|
||||
COMPUTED_STYLE_PROP(row_gap, RowGap)
|
||||
COMPUTED_STYLE_PROP(ruby_align, RubyAlign)
|
||||
COMPUTED_STYLE_PROP(ruby_position, RubyPosition)
|
||||
COMPUTED_STYLE_PROP(scroll_behavior, ScrollBehavior)
|
||||
|
|
|
|||
|
|
@ -379,8 +379,6 @@ nsLayoutStylesheetCache::For(StyleBackendType aType)
|
|||
// style sheets will be re-parsed.
|
||||
// Preferences::RegisterCallback(&DependentPrefChanged,
|
||||
// "layout.css.example-pref.enabled");
|
||||
Preferences::RegisterCallback(&DependentPrefChanged,
|
||||
"layout.css.grid.enabled");
|
||||
Preferences::RegisterCallback(&DependentPrefChanged,
|
||||
"dom.details_element.enabled");
|
||||
}
|
||||
|
|
@ -553,7 +551,7 @@ nsLayoutStylesheetCache::DependentPrefChanged(const char* aPref, void* aData)
|
|||
InvalidateSheet(gStyleCache_Gecko ? &gStyleCache_Gecko->sheet_ : nullptr, \
|
||||
gStyleCache_Servo ? &gStyleCache_Servo->sheet_ : nullptr);
|
||||
|
||||
INVALIDATE(mUASheet); // for layout.css.grid.enabled
|
||||
// INVALIDATE(mUASheet); // for layout.css.example-pref.enabled
|
||||
INVALIDATE(mHTMLSheet); // for dom.details_element.enabled
|
||||
|
||||
#undef INVALIDATE
|
||||
|
|
|
|||
|
|
@ -8877,25 +8877,27 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
|
|||
parentPos->mGridRowEnd,
|
||||
conditions);
|
||||
|
||||
// grid-column-gap
|
||||
if (SetCoord(*aRuleData->ValueForGridColumnGap(),
|
||||
pos->mGridColumnGap, parentPos->mGridColumnGap,
|
||||
SETCOORD_LPH | SETCOORD_INITIAL_ZERO | SETCOORD_STORE_CALC |
|
||||
SETCOORD_CALC_CLAMP_NONNEGATIVE | SETCOORD_UNSET_INITIAL,
|
||||
// column-gap: normal, length, percent, calc, inherit, initial
|
||||
if (SetCoord(*aRuleData->ValueForColumnGap(),
|
||||
pos->mColumnGap, parentPos->mColumnGap,
|
||||
SETCOORD_LPH | SETCOORD_NORMAL | SETCOORD_INITIAL_NORMAL |
|
||||
SETCOORD_STORE_CALC | SETCOORD_CALC_CLAMP_NONNEGATIVE |
|
||||
SETCOORD_UNSET_INITIAL,
|
||||
aContext, mPresContext, conditions)) {
|
||||
} else {
|
||||
MOZ_ASSERT(aRuleData->ValueForGridColumnGap()->GetUnit() == eCSSUnit_Null,
|
||||
MOZ_ASSERT(aRuleData->ValueForColumnGap()->GetUnit() == eCSSUnit_Null,
|
||||
"unexpected unit");
|
||||
}
|
||||
|
||||
// grid-row-gap
|
||||
if (SetCoord(*aRuleData->ValueForGridRowGap(),
|
||||
pos->mGridRowGap, parentPos->mGridRowGap,
|
||||
SETCOORD_LPH | SETCOORD_INITIAL_ZERO | SETCOORD_STORE_CALC |
|
||||
SETCOORD_CALC_CLAMP_NONNEGATIVE | SETCOORD_UNSET_INITIAL,
|
||||
// row-gap: normal, length, percent, calc, inherit, initial
|
||||
if (SetCoord(*aRuleData->ValueForRowGap(),
|
||||
pos->mRowGap, parentPos->mRowGap,
|
||||
SETCOORD_LPH | SETCOORD_NORMAL | SETCOORD_INITIAL_NORMAL |
|
||||
SETCOORD_STORE_CALC | SETCOORD_CALC_CLAMP_NONNEGATIVE |
|
||||
SETCOORD_UNSET_INITIAL,
|
||||
aContext, mPresContext, conditions)) {
|
||||
} else {
|
||||
MOZ_ASSERT(aRuleData->ValueForGridRowGap()->GetUnit() == eCSSUnit_Null,
|
||||
MOZ_ASSERT(aRuleData->ValueForRowGap()->GetUnit() == eCSSUnit_Null,
|
||||
"unexpected unit");
|
||||
}
|
||||
|
||||
|
|
@ -9302,18 +9304,6 @@ nsRuleNode::ComputeColumnData(void* aStartStruct,
|
|||
SETCOORD_UNSET_INITIAL,
|
||||
aContext, mPresContext, conditions);
|
||||
|
||||
// column-gap: length, inherit, normal
|
||||
SetCoord(*aRuleData->ValueForColumnGap(),
|
||||
column->mColumnGap, parent->mColumnGap,
|
||||
SETCOORD_LH | SETCOORD_NORMAL | SETCOORD_INITIAL_NORMAL |
|
||||
SETCOORD_CALC_LENGTH_ONLY | SETCOORD_UNSET_INITIAL,
|
||||
aContext, mPresContext, conditions);
|
||||
// clamp negative calc() to 0
|
||||
if (column->mColumnGap.GetUnit() == eStyleUnit_Coord) {
|
||||
column->mColumnGap.SetCoordValue(
|
||||
std::max(column->mColumnGap.GetCoordValue(), 0));
|
||||
}
|
||||
|
||||
// column-count: auto, integer, inherit
|
||||
const nsCSSValue* columnCountValue = aRuleData->ValueForColumnCount();
|
||||
if (eCSSUnit_Auto == columnCountValue->GetUnit() ||
|
||||
|
|
|
|||
|
|
@ -778,6 +778,12 @@ enum class StyleDisplay : uint8_t {
|
|||
#define NS_STYLE_WIDTH_MIN_CONTENT 1
|
||||
#define NS_STYLE_WIDTH_FIT_CONTENT 2
|
||||
#define NS_STYLE_WIDTH_AVAILABLE 3
|
||||
// The 'content' keyword is only valid for 'flex-basis' (not for 'width').
|
||||
// Since the 'flex-basis' property accepts exactly the same values as 'width',
|
||||
// this 'flex-basis'-specific enumerated value is listed alongside the
|
||||
// 'width' ones, to be sure we don't accidentally overload this numeric
|
||||
// value with two different meanings if new 'width' keywords are added.
|
||||
#define NS_STYLE_FLEX_BASIS_CONTENT 4
|
||||
|
||||
// See nsStyleDisplay.mPosition
|
||||
#define NS_STYLE_POSITION_STATIC 0
|
||||
|
|
|
|||
|
|
@ -825,7 +825,6 @@ nsStyleXUL::CalcDifference(const nsStyleXUL& aNewData) const
|
|||
nsStyleColumn::nsStyleColumn(StyleStructContext aContext)
|
||||
: mColumnCount(NS_STYLE_COLUMN_COUNT_AUTO)
|
||||
, mColumnWidth(eStyleUnit_Auto)
|
||||
, mColumnGap(eStyleUnit_Normal)
|
||||
, mColumnRuleColor(StyleComplexColor::CurrentColor())
|
||||
, mColumnRuleStyle(NS_STYLE_BORDER_STYLE_NONE)
|
||||
, mColumnFill(NS_STYLE_COLUMN_FILL_BALANCE)
|
||||
|
|
@ -844,7 +843,6 @@ nsStyleColumn::~nsStyleColumn()
|
|||
nsStyleColumn::nsStyleColumn(const nsStyleColumn& aSource)
|
||||
: mColumnCount(aSource.mColumnCount)
|
||||
, mColumnWidth(aSource.mColumnWidth)
|
||||
, mColumnGap(aSource.mColumnGap)
|
||||
, mColumnRuleColor(aSource.mColumnRuleColor)
|
||||
, mColumnRuleStyle(aSource.mColumnRuleStyle)
|
||||
, mColumnFill(aSource.mColumnFill)
|
||||
|
|
@ -867,7 +865,6 @@ nsStyleColumn::CalcDifference(const nsStyleColumn& aNewData) const
|
|||
}
|
||||
|
||||
if (mColumnWidth != aNewData.mColumnWidth ||
|
||||
mColumnGap != aNewData.mColumnGap ||
|
||||
mColumnFill != aNewData.mColumnFill) {
|
||||
return NS_STYLE_HINT_REFLOW;
|
||||
}
|
||||
|
|
@ -1423,8 +1420,8 @@ nsStylePosition::nsStylePosition(StyleStructContext aContext)
|
|||
, mFlexGrow(0.0f)
|
||||
, mFlexShrink(1.0f)
|
||||
, mZIndex(eStyleUnit_Auto)
|
||||
, mGridColumnGap(nscoord(0), nsStyleCoord::CoordConstructor)
|
||||
, mGridRowGap(nscoord(0), nsStyleCoord::CoordConstructor)
|
||||
, mColumnGap(eStyleUnit_Normal)
|
||||
, mRowGap(eStyleUnit_Normal)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsStylePosition);
|
||||
|
||||
|
|
@ -1489,8 +1486,8 @@ nsStylePosition::nsStylePosition(const nsStylePosition& aSource)
|
|||
, mGridColumnEnd(aSource.mGridColumnEnd)
|
||||
, mGridRowStart(aSource.mGridRowStart)
|
||||
, mGridRowEnd(aSource.mGridRowEnd)
|
||||
, mGridColumnGap(aSource.mGridColumnGap)
|
||||
, mGridRowGap(aSource.mGridRowGap)
|
||||
, mColumnGap(aSource.mColumnGap)
|
||||
, mRowGap(aSource.mRowGap)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsStylePosition);
|
||||
}
|
||||
|
|
@ -1590,8 +1587,8 @@ nsStylePosition::CalcDifference(const nsStylePosition& aNewData,
|
|||
mGridColumnEnd != aNewData.mGridColumnEnd ||
|
||||
mGridRowStart != aNewData.mGridRowStart ||
|
||||
mGridRowEnd != aNewData.mGridRowEnd ||
|
||||
mGridColumnGap != aNewData.mGridColumnGap ||
|
||||
mGridRowGap != aNewData.mGridRowGap) {
|
||||
mColumnGap != aNewData.mColumnGap ||
|
||||
mRowGap != aNewData.mRowGap) {
|
||||
return hint |
|
||||
nsChangeHint_AllReflowHints;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1848,8 +1848,8 @@ public:
|
|||
nsStyleGridLine mGridColumnEnd;
|
||||
nsStyleGridLine mGridRowStart;
|
||||
nsStyleGridLine mGridRowEnd;
|
||||
nsStyleCoord mGridColumnGap; // [reset] coord, percent, calc
|
||||
nsStyleCoord mGridRowGap; // [reset] coord, percent, calc
|
||||
nsStyleCoord mColumnGap; // [reset] normal, coord, percent, calc
|
||||
nsStyleCoord mRowGap; // [reset] normal, coord, percent, calc
|
||||
|
||||
// FIXME: Logical-coordinate equivalents to these WidthDepends... and
|
||||
// HeightDepends... methods have been introduced (see below); we probably
|
||||
|
|
@ -3502,7 +3502,6 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleColumn
|
|||
|
||||
uint32_t mColumnCount; // [reset] see nsStyleConsts.h
|
||||
nsStyleCoord mColumnWidth; // [reset] coord, auto
|
||||
nsStyleCoord mColumnGap; // [reset] <length-percentage> | normal
|
||||
|
||||
mozilla::StyleComplexColor mColumnRuleColor; // [reset]
|
||||
uint8_t mColumnRuleStyle; // [reset]
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -69,8 +69,6 @@ var supported_properties = {
|
|||
"box-shadow": [ test_shadow_transition ],
|
||||
"column-count": [ test_pos_integer_or_auto_transition,
|
||||
test_integer_at_least_one_clamping ],
|
||||
"column-gap": [ test_length_transition,
|
||||
test_length_clamped ],
|
||||
"column-rule-color": [ test_color_transition,
|
||||
test_true_currentcolor_transition ],
|
||||
"column-rule-width": [ test_length_transition,
|
||||
|
|
@ -161,8 +159,8 @@ var supported_properties = {
|
|||
/* test_float_zeroToOne_clamped */ ],
|
||||
"font-stretch": [ test_font_stretch ],
|
||||
"font-weight": [ test_font_weight ],
|
||||
"grid-column-gap": [ test_grid_gap ],
|
||||
"grid-row-gap": [ test_grid_gap ],
|
||||
"column-gap": [ test_gap ],
|
||||
"row-gap": [ test_gap ],
|
||||
"height": [ test_length_transition, test_percent_transition,
|
||||
test_length_percent_calc_transition,
|
||||
test_length_clamped, test_percent_clamped ],
|
||||
|
|
@ -1922,10 +1920,7 @@ function test_font_weight(prop) {
|
|||
div.style.setProperty("transition-timing-function", "linear", "");
|
||||
}
|
||||
|
||||
function test_grid_gap(prop) {
|
||||
if (!SpecialPowers.getBoolPref("layout.css.grid.enabled")) {
|
||||
return;
|
||||
}
|
||||
function test_gap(prop) {
|
||||
test_length_transition(prop);
|
||||
test_length_clamped(prop);
|
||||
test_percent_transition(prop);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue