From b9bdadfef00a4a2ad3fde97fc24a70a3f12fd91e Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Thu, 5 Jul 2018 15:25:58 -0700 Subject: [PATCH] #508: unprefix -moz-columns (M1300895 plus additional work) --- layout/generic/nsColumnSetFrame.cpp | 2 +- layout/style/Declaration.cpp | 4 +- layout/style/StyleAnimationValue.cpp | 6 +-- layout/style/nsCSSParser.cpp | 14 ++--- layout/style/nsCSSPropAliasList.h | 36 +++++++++++++ layout/style/nsCSSPropList.h | 54 +++++++++---------- layout/style/nsCSSProps.cpp | 10 ++-- layout/style/nsComputedDOMStylePropertyList.h | 16 +++--- layout/style/nsStyleContext.cpp | 2 +- 9 files changed, 90 insertions(+), 54 deletions(-) diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index ed9c4e884..1ded81408 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -83,7 +83,7 @@ nsColumnSetFrame::PaintColumnRule(nsRenderingContext* aCtx, return; nscolor ruleColor = - GetVisitedDependentColor(eCSSProperty__moz_column_rule_color); + GetVisitedDependentColor(eCSSProperty_column_rule_color); // In order to re-use a large amount of code, we treat the column rule as a border. // We create a new border style object and fill in all the details of the column rule as diff --git a/layout/style/Declaration.cpp b/layout/style/Declaration.cpp index 0c6b85b77..422f9ef26 100644 --- a/layout/style/Declaration.cpp +++ b/layout/style/Declaration.cpp @@ -447,7 +447,7 @@ Declaration::GetValue(nsCSSProperty aProperty, nsAString& aValue, case eCSSProperty_border_inline_end: case eCSSProperty_border_block_start: case eCSSProperty_border_block_end: - case eCSSProperty__moz_column_rule: + case eCSSProperty_column_rule: case eCSSProperty_outline: { const nsCSSProperty* subprops = nsCSSProps::SubpropertyEntryFor(aProperty); @@ -952,7 +952,7 @@ Declaration::GetValue(nsCSSProperty aProperty, nsAString& aValue, AppendValueToString(eCSSProperty_marker_end, aValue, aSerialization); break; } - case eCSSProperty__moz_columns: { + case eCSSProperty_columns: { // Two values, column-count and column-width, separated by a space. const nsCSSProperty* subprops = nsCSSProps::SubpropertyEntryFor(aProperty); diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index e72fc9824..bee9df76a 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -3010,7 +3010,7 @@ StyleAnimationValue::ExtractComputedValue(nsCSSProperty aProperty, BORDER_WIDTH_CASE(eCSSProperty_border_top_width, top) #undef BORDER_WIDTH_CASE - case eCSSProperty__moz_column_rule_width: + case eCSSProperty_column_rule_width: aComputedValue.SetCoordValue( static_cast(styleStruct)-> GetComputedColumnRuleWidth()); @@ -3043,7 +3043,7 @@ StyleAnimationValue::ExtractComputedValue(nsCSSProperty aProperty, break; } - case eCSSProperty__moz_column_rule_color: { + case eCSSProperty_column_rule_color: { const nsStyleColumn *styleColumn = static_cast(styleStruct); nscolor color; @@ -3056,7 +3056,7 @@ StyleAnimationValue::ExtractComputedValue(nsCSSProperty aProperty, break; } - case eCSSProperty__moz_column_count: { + case eCSSProperty_column_count: { const nsStyleColumn *styleColumn = static_cast(styleStruct); if (styleColumn->mColumnCount == NS_STYLE_COLUMN_COUNT_AUTO) { diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 61b2b5444..b89c14294 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -7242,9 +7242,9 @@ static const nsCSSProperty kBorderBlockEndIDs[] = { eCSSProperty_border_block_end_color }; static const nsCSSProperty kColumnRuleIDs[] = { - eCSSProperty__moz_column_rule_width, - eCSSProperty__moz_column_rule_style, - eCSSProperty__moz_column_rule_color + eCSSProperty_column_rule_width, + eCSSProperty_column_rule_style, + eCSSProperty_column_rule_color }; bool @@ -11152,9 +11152,9 @@ CSSParserImpl::ParsePropertyByFunction(nsCSSProperty aPropID) case eCSSProperty_clip: return ParseRect(eCSSProperty_clip); - case eCSSProperty__moz_columns: + case eCSSProperty_columns: return ParseColumns(); - case eCSSProperty__moz_column_rule: + case eCSSProperty_column_rule: return ParseBorderSide(kColumnRuleIDs, false); case eCSSProperty_content: return ParseContent(); @@ -13007,8 +13007,8 @@ CSSParserImpl::ParseColumns() // find. static const nsCSSProperty columnIDs[] = { eCSSPropertyExtra_x_auto_value, - eCSSProperty__moz_column_count, - eCSSProperty__moz_column_width + eCSSProperty_column_count, + eCSSProperty_column_width }; const int32_t numProps = MOZ_ARRAY_LENGTH(columnIDs); diff --git a/layout/style/nsCSSPropAliasList.h b/layout/style/nsCSSPropAliasList.h index f982875dd..a9f7a6efe 100644 --- a/layout/style/nsCSSPropAliasList.h +++ b/layout/style/nsCSSPropAliasList.h @@ -179,6 +179,42 @@ CSS_PROP_ALIAS(-moz-hyphens, hyphens, MozHyphens, "") +CSS_PROP_ALIAS(-moz-column-count, + column_count, + MozColumnCount, + "") +CSS_PROP_ALIAS(-moz-column-fill, + column_fill, + MozColumnFill, + "") +CSS_PROP_ALIAS(-moz-column-gap, + column_gap, + MozColumnGap, + "") +CSS_PROP_ALIAS(-moz-column-rule, + column_rule, + MozColumnRule, + "") +CSS_PROP_ALIAS(-moz-column-rule-color, + column_rule_color, + MozColumnRuleColor, + "") +CSS_PROP_ALIAS(-moz-column-rule-style, + column_rule_style, + MozColumnRuleStyle, + "") +CSS_PROP_ALIAS(-moz-column-rule-width, + column_rule_width, + MozColumnRuleWidth, + "") +CSS_PROP_ALIAS(-moz-column-width, + column_width, + MozColumnWidth, + "") +CSS_PROP_ALIAS(-moz-columns, + columns, + MozColumns, + "") #define WEBKIT_PREFIX_PREF "layout.css.prefixes.webkit" diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h index fe99d9a21..719932ec3 100644 --- a/layout/style/nsCSSPropList.h +++ b/layout/style/nsCSSPropList.h @@ -1389,15 +1389,15 @@ CSS_PROP_COLOR( offsetof(nsStyleColor, mColor), eStyleAnimType_Color) CSS_PROP_SHORTHAND( - -moz-columns, - _moz_columns, - CSS_PROP_DOMPROP_PREFIXED(Columns), + columns, + columns, + Columns, CSS_PROPERTY_PARSE_FUNCTION, "") CSS_PROP_COLUMN( - -moz-column-count, - _moz_column_count, - CSS_PROP_DOMPROP_PREFIXED(ColumnCount), + column-count, + column_count, + ColumnCount, CSS_PROPERTY_PARSE_VALUE | // Need to reject 0 in addition to negatives. If we accept 0, we // need to change NS_STYLE_COLUMN_COUNT_AUTO to something else. @@ -1408,9 +1408,9 @@ CSS_PROP_COLUMN( offsetof(nsStyleColumn, mColumnCount), eStyleAnimType_Custom) CSS_PROP_COLUMN( - -moz-column-fill, - _moz_column_fill, - CSS_PROP_DOMPROP_PREFIXED(ColumnFill), + column-fill, + column_fill, + ColumnFill, CSS_PROPERTY_PARSE_VALUE, "", VARIANT_HK, @@ -1418,9 +1418,9 @@ CSS_PROP_COLUMN( CSS_PROP_NO_OFFSET, eStyleAnimType_None) CSS_PROP_COLUMN( - -moz-column-width, - _moz_column_width, - CSS_PROP_DOMPROP_PREFIXED(ColumnWidth), + column-width, + column_width, + ColumnWidth, CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_VALUE_NONNEGATIVE, "", @@ -1429,9 +1429,9 @@ CSS_PROP_COLUMN( offsetof(nsStyleColumn, mColumnWidth), eStyleAnimType_Coord) CSS_PROP_COLUMN( - -moz-column-gap, - _moz_column_gap, - CSS_PROP_DOMPROP_PREFIXED(ColumnGap), + column-gap, + column_gap, + ColumnGap, CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_VALUE_NONNEGATIVE, "", @@ -1440,15 +1440,15 @@ CSS_PROP_COLUMN( offsetof(nsStyleColumn, mColumnGap), eStyleAnimType_Coord) CSS_PROP_SHORTHAND( - -moz-column-rule, - _moz_column_rule, - CSS_PROP_DOMPROP_PREFIXED(ColumnRule), + column-rule, + column_rule, + ColumnRule, CSS_PROPERTY_PARSE_FUNCTION, "") CSS_PROP_COLUMN( - -moz-column-rule-color, - _moz_column_rule_color, - CSS_PROP_DOMPROP_PREFIXED(ColumnRuleColor), + column-rule-color, + column_rule_color, + ColumnRuleColor, CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, "", @@ -1457,9 +1457,9 @@ CSS_PROP_COLUMN( CSS_PROP_NO_OFFSET, eStyleAnimType_Custom) CSS_PROP_COLUMN( - -moz-column-rule-style, - _moz_column_rule_style, - CSS_PROP_DOMPROP_PREFIXED(ColumnRuleStyle), + column-rule-style, + column_rule_style, + ColumnRuleStyle, CSS_PROPERTY_PARSE_VALUE, "", VARIANT_HK, @@ -1467,9 +1467,9 @@ CSS_PROP_COLUMN( CSS_PROP_NO_OFFSET, eStyleAnimType_None) CSS_PROP_COLUMN( - -moz-column-rule-width, - _moz_column_rule_width, - CSS_PROP_DOMPROP_PREFIXED(ColumnRuleWidth), + column-rule-width, + column_rule_width, + ColumnRuleWidth, CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_VALUE_NONNEGATIVE, "", diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index 4188085aa..90968e295 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -2684,17 +2684,17 @@ static const nsCSSProperty gOutlineSubpropTable[] = { }; static const nsCSSProperty gColumnsSubpropTable[] = { - eCSSProperty__moz_column_count, - eCSSProperty__moz_column_width, + eCSSProperty_column_count, + eCSSProperty_column_width, eCSSProperty_UNKNOWN }; static const nsCSSProperty gColumnRuleSubpropTable[] = { // nsCSSDeclaration.cpp outputs the subproperties in this order. // It also depends on the color being third. - eCSSProperty__moz_column_rule_width, - eCSSProperty__moz_column_rule_style, - eCSSProperty__moz_column_rule_color, + eCSSProperty_column_rule_width, + eCSSProperty_column_rule_style, + eCSSProperty_column_rule_color, eCSSProperty_UNKNOWN }; diff --git a/layout/style/nsComputedDOMStylePropertyList.h b/layout/style/nsComputedDOMStylePropertyList.h index f31861c9c..4f3d6ebeb 100644 --- a/layout/style/nsComputedDOMStylePropertyList.h +++ b/layout/style/nsComputedDOMStylePropertyList.h @@ -102,6 +102,14 @@ COMPUTED_STYLE_PROP(caption_side, CaptionSide) COMPUTED_STYLE_PROP(clear, Clear) COMPUTED_STYLE_PROP(clip, Clip) COMPUTED_STYLE_PROP(color, Color) +COMPUTED_STYLE_PROP(column_count, ColumnCount) +COMPUTED_STYLE_PROP(column_fill, ColumnFill) +COMPUTED_STYLE_PROP(column_gap, ColumnGap) +//// COMPUTED_STYLE_PROP(column_rule, ColumnRule) +COMPUTED_STYLE_PROP(column_rule_color, ColumnRuleColor) +COMPUTED_STYLE_PROP(column_rule_style, ColumnRuleStyle) +COMPUTED_STYLE_PROP(column_rule_width, ColumnRuleWidth) +COMPUTED_STYLE_PROP(column_width, ColumnWidth) COMPUTED_STYLE_PROP(contain, Contain) COMPUTED_STYLE_PROP(content, Content) COMPUTED_STYLE_PROP(counter_increment, CounterIncrement) @@ -269,14 +277,6 @@ COMPUTED_STYLE_PROP(box_flex, BoxFlex) COMPUTED_STYLE_PROP(box_ordinal_group, BoxOrdinalGroup) COMPUTED_STYLE_PROP(box_orient, BoxOrient) COMPUTED_STYLE_PROP(box_pack, BoxPack) -COMPUTED_STYLE_PROP(_moz_column_count, ColumnCount) -COMPUTED_STYLE_PROP(_moz_column_fill, ColumnFill) -COMPUTED_STYLE_PROP(_moz_column_gap, ColumnGap) -//// COMPUTED_STYLE_PROP(_moz_column_rule, ColumnRule) -COMPUTED_STYLE_PROP(_moz_column_rule_color, ColumnRuleColor) -COMPUTED_STYLE_PROP(_moz_column_rule_style, ColumnRuleStyle) -COMPUTED_STYLE_PROP(_moz_column_rule_width, ColumnRuleWidth) -COMPUTED_STYLE_PROP(_moz_column_width, ColumnWidth) COMPUTED_STYLE_PROP(float_edge, FloatEdge) COMPUTED_STYLE_PROP(force_broken_image_icon, ForceBrokenImageIcon) COMPUTED_STYLE_PROP(image_region, ImageRegion) diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp index 4c08baea1..153e014c4 100644 --- a/layout/style/nsStyleContext.cpp +++ b/layout/style/nsStyleContext.cpp @@ -1268,7 +1268,7 @@ nsStyleContext::GetVisitedDependentColor(nsCSSProperty aProperty) aProperty == eCSSProperty_border_bottom_color || aProperty == eCSSProperty_border_left_color || aProperty == eCSSProperty_outline_color || - aProperty == eCSSProperty__moz_column_rule_color || + aProperty == eCSSProperty_column_rule_color || aProperty == eCSSProperty_text_decoration_color || aProperty == eCSSProperty_text_emphasis_color || aProperty == eCSSProperty_fill ||