Bug 1519958 - Drive by, remove unused CSS keywords. r=boris
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 27 Jun 2019 20:28:57 +0200
changeset 543426 3669b147ccc6d3c10f742e6b72efcf9dbda99374
parent 543425 2086a08e77feeeaddcff0399deef434ac2e8c17e
child 543427 97b7600d3c92a537ef29f7f25e3583de0fa90a10
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersboris
bugs1519958
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1519958 - Drive by, remove unused CSS keywords. r=boris While we're at it we may as well do this. Differential Revision: https://phabricator.services.mozilla.com/D36350
layout/style/nsCSSKeywordList.h
layout/style/nsCSSProps.cpp
layout/style/nsCSSProps.h
--- a/layout/style/nsCSSKeywordList.h
+++ b/layout/style/nsCSSKeywordList.h
@@ -47,188 +47,118 @@ CSS_KEY(-moz-grab, _moz_grab)
 CSS_KEY(-moz-grid-group, _moz_grid_group)
 CSS_KEY(-moz-grid-line, _moz_grid_line)
 CSS_KEY(-moz-grid, _moz_grid)
 CSS_KEY(-moz-groupbox, _moz_groupbox)
 CSS_KEY(-moz-inline-box, _moz_inline_box)
 CSS_KEY(-moz-inline-grid, _moz_inline_grid)
 CSS_KEY(-moz-inline-stack, _moz_inline_stack)
 CSS_KEY(-moz-left, _moz_left)
-CSS_KEY(-moz-middle-with-baseline, _moz_middle_with_baseline)
 CSS_KEY(-moz-none, _moz_none)
 CSS_KEY(-moz-popup, _moz_popup)
 CSS_KEY(-moz-right, _moz_right)
 CSS_KEY(-moz-stack, _moz_stack)
 CSS_KEY(-moz-zoom-in, _moz_zoom_in)
 CSS_KEY(-moz-zoom-out, _moz_zoom_out)
 CSS_KEY(-webkit-box, _webkit_box)
 CSS_KEY(-webkit-flex, _webkit_flex)
 CSS_KEY(-webkit-inline-box, _webkit_inline_box)
 CSS_KEY(-webkit-inline-flex, _webkit_inline_flex)
 CSS_KEY(alias, alias)
-CSS_KEY(all, all)
 CSS_KEY(all-scroll, all_scroll)
 CSS_KEY(auto, auto)
 CSS_KEY(baseline, baseline)
-CSS_KEY(blink, blink)
 CSS_KEY(block, block)
-CSS_KEY(blur, blur)
-CSS_KEY(bottom, bottom)
-CSS_KEY(brightness, brightness)
 CSS_KEY(cell, cell)
 CSS_KEY(center, center)
 CSS_KEY(circle, circle)
-CSS_KEY(clip, clip)
-CSS_KEY(closest-side, closest_side)
 CSS_KEY(col-resize, col_resize)
 CSS_KEY(column, column)
-CSS_KEY(content, content)
 CSS_KEY(contents, contents)
-CSS_KEY(context-fill, context_fill)
 CSS_KEY(context-menu, context_menu)
-CSS_KEY(context-stroke, context_stroke)
-CSS_KEY(contrast, contrast)
 CSS_KEY(copy, copy)
 CSS_KEY(crosshair, crosshair)
 CSS_KEY(dashed, dashed)
 CSS_KEY(dense, dense)
 CSS_KEY(default, default)
 CSS_KEY(dot, dot)
 CSS_KEY(dotted, dotted)
 CSS_KEY(double, double)
 CSS_KEY(double-circle, double_circle)
-CSS_KEY(drop-shadow, drop_shadow)
 CSS_KEY(e-resize, e_resize)
-CSS_KEY(ellipse, ellipse)
-CSS_KEY(ellipsis, ellipsis)
 CSS_KEY(end, end)
 CSS_KEY(ew-resize, ew_resize)
-CSS_KEY(farthest-side, farthest_side)
-CSS_KEY(fill, fill)
-CSS_KEY(filled, filled)
 CSS_KEY(flex, flex)
 CSS_KEY(flex-end, flex_end)
 CSS_KEY(flex-start, flex_start)
 CSS_KEY(flow-root, flow_root)
 CSS_KEY(grab, grab)
 CSS_KEY(grabbing, grabbing)
 CSS_KEY(grayscale, grayscale)
 CSS_KEY(grid, grid)
 CSS_KEY(help, help)
-CSS_KEY(hue-rotate, hue_rotate)
-CSS_KEY(infinite, infinite)
 CSS_KEY(inline, inline)
 CSS_KEY(inline-block, inline_block)
 CSS_KEY(inline-flex, inline_flex)
 CSS_KEY(inline-grid, inline_grid)
 CSS_KEY(inline-table, inline_table)
 CSS_KEY(inset, inset)
-CSS_KEY(interpolatematrix, interpolatematrix)
-CSS_KEY(accumulatematrix, accumulatematrix)
-CSS_KEY(invert, invert)
 CSS_KEY(justify, justify)
 CSS_KEY(last baseline, last_baseline) // only used for DevTools auto-completion
-CSS_KEY(layout, layout)
 CSS_KEY(left, left)
-CSS_KEY(line-through, line_through)
 CSS_KEY(list-item, list_item)
-CSS_KEY(manipulation, manipulation)
-CSS_KEY(matrix, matrix)
-CSS_KEY(matrix3d, matrix3d)
 CSS_KEY(max-content, max_content)
-CSS_KEY(middle, middle)
 CSS_KEY(min-content, min_content)
 CSS_KEY(move, move)
 CSS_KEY(n-resize, n_resize)
 CSS_KEY(ne-resize, ne_resize)
 CSS_KEY(nesw-resize, nesw_resize)
 CSS_KEY(no-drop, no_drop)
 CSS_KEY(none, none)
 CSS_KEY(normal, normal)
 CSS_KEY(not-allowed, not_allowed)
 CSS_KEY(ns-resize, ns_resize)
 CSS_KEY(nw-resize, nw_resize)
 CSS_KEY(nwse-resize, nwse_resize)
-CSS_KEY(opacity, opacity)
-CSS_KEY(open, open)
-CSS_KEY(over, over)
-CSS_KEY(overline, overline)
-CSS_KEY(paint, paint)
-CSS_KEY(pan-x, pan_x)
-CSS_KEY(pan-y, pan_y)
-CSS_KEY(perspective, perspective)
 CSS_KEY(pointer, pointer)
-CSS_KEY(polygon, polygon)
 CSS_KEY(progress, progress)
 CSS_KEY(right, right)
-CSS_KEY(rotate, rotate)
-CSS_KEY(rotate3d, rotate3d)
-CSS_KEY(rotatex, rotatex)
-CSS_KEY(rotatey, rotatey)
-CSS_KEY(rotatez, rotatez)
 CSS_KEY(row, row)
 CSS_KEY(row-resize, row_resize)
 CSS_KEY(ruby, ruby)
 CSS_KEY(ruby-base, ruby_base)
 CSS_KEY(ruby-base-container, ruby_base_container)
 CSS_KEY(ruby-text, ruby_text)
 CSS_KEY(ruby-text-container, ruby_text_container)
 CSS_KEY(s-resize, s_resize)
-CSS_KEY(saturate, saturate)
-CSS_KEY(scale, scale)
-CSS_KEY(scale3d, scale3d)
-CSS_KEY(scalex, scalex)
-CSS_KEY(scaley, scaley)
-CSS_KEY(scalez, scalez)
 CSS_KEY(se-resize, se_resize)
 CSS_KEY(self-end, self_end)
 CSS_KEY(self-start, self_start)
-CSS_KEY(sepia, sepia)
 CSS_KEY(sesame, sesame)
-CSS_KEY(size, size)
-CSS_KEY(skew, skew)
-CSS_KEY(skewx, skewx)
-CSS_KEY(skewy, skewy)
 CSS_KEY(solid, solid)
 CSS_KEY(space-around, space_around)
 CSS_KEY(space-between, space_between)
 CSS_KEY(space-evenly, space_evenly)
-CSS_KEY(span, span)
 CSS_KEY(start, start)
 CSS_KEY(stretch, stretch)
-CSS_KEY(strict, strict)
-CSS_KEY(style, style)
-CSS_KEY(sub, sub)
 CSS_KEY(subgrid, subgrid)
-CSS_KEY(super, super)
 CSS_KEY(sw-resize, sw_resize)
 CSS_KEY(table, table)
 CSS_KEY(table-caption, table_caption)
 CSS_KEY(table-cell, table_cell)
 CSS_KEY(table-column, table_column)
 CSS_KEY(table-column-group, table_column_group)
 CSS_KEY(table-footer-group, table_footer_group)
 CSS_KEY(table-header-group, table_header_group)
 CSS_KEY(table-row, table_row)
 CSS_KEY(table-row-group, table_row_group)
 CSS_KEY(text, text)
-CSS_KEY(text-bottom, text_bottom)
-CSS_KEY(text-top, text_top)
-CSS_KEY(top, top)
-CSS_KEY(translate, translate)
-CSS_KEY(translate3d, translate3d)
-CSS_KEY(translatex, translatex)
-CSS_KEY(translatey, translatey)
-CSS_KEY(translatez, translatez)
 CSS_KEY(triangle, triangle)
-CSS_KEY(under, under)
-CSS_KEY(underline, underline)
 CSS_KEY(vertical-text, vertical_text)
 CSS_KEY(w-resize, w_resize)
 CSS_KEY(wait, wait)
 CSS_KEY(wavy, wavy)
 CSS_KEY(zoom-in, zoom_in)
 CSS_KEY(zoom-out, zoom_out)
 
 // Appearance keywords for widget styles
-//CSS_KEY(middle, middle)
 //CSS_KEY(start, start)
 
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -167,19 +167,16 @@ const nsCString& nsCSSProps::GetStringVa
   } else {
     static nsDependentCString sNullStr("");
     return sNullStr;
   }
 }
 
 /***************************************************************************/
 
-const KTableEntry nsCSSProps::kBoxShadowTypeKTable[] = {
-    {eCSSKeyword_inset, uint8_t(StyleBoxShadowType::Inset)},
-    {eCSSKeyword_UNKNOWN, -1}};
 
 const KTableEntry nsCSSProps::kCursorKTable[] = {
     // CSS 2.0
     {eCSSKeyword_auto, StyleCursorKind::Auto},
     {eCSSKeyword_crosshair, StyleCursorKind::Crosshair},
     {eCSSKeyword_default, StyleCursorKind::Default},
     {eCSSKeyword_pointer, StyleCursorKind::Pointer},
     {eCSSKeyword_move, StyleCursorKind::Move},
@@ -266,91 +263,21 @@ KTableEntry nsCSSProps::kDisplayKTable[]
     {eCSSKeyword__webkit_box, StyleDisplay::WebkitBox},
     {eCSSKeyword__webkit_inline_box, StyleDisplay::WebkitInlineBox},
     {eCSSKeyword__webkit_flex, StyleDisplay::Flex},
     {eCSSKeyword__webkit_inline_flex, StyleDisplay::InlineFlex},
     {eCSSKeyword_contents, StyleDisplay::Contents},
     {eCSSKeyword_flow_root, StyleDisplay::FlowRoot},
     {eCSSKeyword_UNKNOWN, -1}};
 
-// <NOTE> these are only used for auto-completion, not parsing:
-const KTableEntry nsCSSProps::kAutoCompletionAlignJustifySelf[] = {
-    {eCSSKeyword_auto, NS_STYLE_ALIGN_AUTO},
-    {eCSSKeyword_normal, NS_STYLE_ALIGN_NORMAL},
-    {eCSSKeyword_stretch, NS_STYLE_ALIGN_STRETCH},
-    {eCSSKeyword_baseline, NS_STYLE_ALIGN_BASELINE},
-    {eCSSKeyword_last_baseline, NS_STYLE_ALIGN_LAST_BASELINE},
-    {eCSSKeyword_start, NS_STYLE_ALIGN_START},
-    {eCSSKeyword_end, NS_STYLE_ALIGN_END},
-    {eCSSKeyword_flex_start, NS_STYLE_ALIGN_FLEX_START},
-    {eCSSKeyword_flex_end, NS_STYLE_ALIGN_FLEX_END},
-    {eCSSKeyword_center, NS_STYLE_ALIGN_CENTER},
-    {eCSSKeyword_left, NS_STYLE_ALIGN_LEFT},
-    {eCSSKeyword_right, NS_STYLE_ALIGN_RIGHT},
-    {eCSSKeyword_self_start, NS_STYLE_ALIGN_SELF_START},
-    {eCSSKeyword_self_end, NS_STYLE_ALIGN_SELF_END},
-    {eCSSKeyword_UNKNOWN, -1}};
-
-const KTableEntry nsCSSProps::kAutoCompletionAlignItems[] = {
-    // Intentionally no 'auto' here.
-    {eCSSKeyword_normal, NS_STYLE_ALIGN_NORMAL},
-    {eCSSKeyword_stretch, NS_STYLE_ALIGN_STRETCH},
-    {eCSSKeyword_baseline, NS_STYLE_ALIGN_BASELINE},
-    {eCSSKeyword_last_baseline, NS_STYLE_ALIGN_LAST_BASELINE},
-    {eCSSKeyword_start, NS_STYLE_ALIGN_START},
-    {eCSSKeyword_end, NS_STYLE_ALIGN_END},
-    {eCSSKeyword_flex_start, NS_STYLE_ALIGN_FLEX_START},
-    {eCSSKeyword_flex_end, NS_STYLE_ALIGN_FLEX_END},
-    {eCSSKeyword_center, NS_STYLE_ALIGN_CENTER},
-    {eCSSKeyword_left, NS_STYLE_ALIGN_LEFT},
-    {eCSSKeyword_right, NS_STYLE_ALIGN_RIGHT},
-    {eCSSKeyword_self_start, NS_STYLE_ALIGN_SELF_START},
-    {eCSSKeyword_self_end, NS_STYLE_ALIGN_SELF_END},
-    {eCSSKeyword_UNKNOWN, -1}};
-
-const KTableEntry nsCSSProps::kAutoCompletionAlignJustifyContent[] = {
-    // Intentionally no 'auto' here.
-    {eCSSKeyword_normal, NS_STYLE_ALIGN_NORMAL},
-    {eCSSKeyword_baseline, NS_STYLE_ALIGN_BASELINE},
-    {eCSSKeyword_last_baseline, NS_STYLE_ALIGN_LAST_BASELINE},
-    {eCSSKeyword_stretch, NS_STYLE_ALIGN_STRETCH},
-    {eCSSKeyword_space_between, NS_STYLE_ALIGN_SPACE_BETWEEN},
-    {eCSSKeyword_space_around, NS_STYLE_ALIGN_SPACE_AROUND},
-    {eCSSKeyword_space_evenly, NS_STYLE_ALIGN_SPACE_EVENLY},
-    {eCSSKeyword_start, NS_STYLE_ALIGN_START},
-    {eCSSKeyword_end, NS_STYLE_ALIGN_END},
-    {eCSSKeyword_flex_start, NS_STYLE_ALIGN_FLEX_START},
-    {eCSSKeyword_flex_end, NS_STYLE_ALIGN_FLEX_END},
-    {eCSSKeyword_center, NS_STYLE_ALIGN_CENTER},
-    {eCSSKeyword_left, NS_STYLE_ALIGN_LEFT},
-    {eCSSKeyword_right, NS_STYLE_ALIGN_RIGHT},
-    {eCSSKeyword_UNKNOWN, -1}};
-// </NOTE>
-
 const KTableEntry nsCSSProps::kFontSmoothingKTable[] = {
     {eCSSKeyword_auto, NS_FONT_SMOOTHING_AUTO},
     {eCSSKeyword_grayscale, NS_FONT_SMOOTHING_GRAYSCALE},
     {eCSSKeyword_UNKNOWN, -1}};
 
-const KTableEntry nsCSSProps::kGridAutoFlowKTable[] = {
-    {eCSSKeyword_row, NS_STYLE_GRID_AUTO_FLOW_ROW},
-    {eCSSKeyword_column, NS_STYLE_GRID_AUTO_FLOW_COLUMN},
-    {eCSSKeyword_dense, NS_STYLE_GRID_AUTO_FLOW_DENSE},
-    {eCSSKeyword_UNKNOWN, -1}};
-
-const KTableEntry nsCSSProps::kGridTrackBreadthKTable[] = {
-    {eCSSKeyword_min_content, StyleGridTrackBreadth::MinContent},
-    {eCSSKeyword_max_content, StyleGridTrackBreadth::MaxContent},
-    {eCSSKeyword_UNKNOWN, -1}};
-
-const KTableEntry nsCSSProps::kLineHeightKTable[] = {
-    // -moz- prefixed, intended for internal use for single-line controls
-    {eCSSKeyword__moz_block_height, NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT},
-    {eCSSKeyword_UNKNOWN, -1}};
-
 const KTableEntry nsCSSProps::kTextAlignKTable[] = {
     {eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT},
     {eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT},
     {eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER},
     {eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY},
     {eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER},
     {eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT},
     {eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT},
@@ -362,24 +289,16 @@ const KTableEntry nsCSSProps::kTextDecor
     {eCSSKeyword__moz_none, NS_STYLE_TEXT_DECORATION_STYLE_NONE},
     {eCSSKeyword_solid, NS_STYLE_TEXT_DECORATION_STYLE_SOLID},
     {eCSSKeyword_double, NS_STYLE_TEXT_DECORATION_STYLE_DOUBLE},
     {eCSSKeyword_dotted, NS_STYLE_TEXT_DECORATION_STYLE_DOTTED},
     {eCSSKeyword_dashed, NS_STYLE_TEXT_DECORATION_STYLE_DASHED},
     {eCSSKeyword_wavy, NS_STYLE_TEXT_DECORATION_STYLE_WAVY},
     {eCSSKeyword_UNKNOWN, -1}};
 
-const KTableEntry nsCSSProps::kTextEmphasisStyleShapeKTable[] = {
-    {eCSSKeyword_dot, NS_STYLE_TEXT_EMPHASIS_STYLE_DOT},
-    {eCSSKeyword_circle, NS_STYLE_TEXT_EMPHASIS_STYLE_CIRCLE},
-    {eCSSKeyword_double_circle, NS_STYLE_TEXT_EMPHASIS_STYLE_DOUBLE_CIRCLE},
-    {eCSSKeyword_triangle, NS_STYLE_TEXT_EMPHASIS_STYLE_TRIANGLE},
-    {eCSSKeyword_sesame, NS_STYLE_TEXT_EMPHASIS_STYLE_SESAME},
-    {eCSSKeyword_UNKNOWN, -1}};
-
 int32_t nsCSSProps::FindIndexOfKeyword(nsCSSKeyword aKeyword,
                                        const KTableEntry aTable[]) {
   if (eCSSKeyword_UNKNOWN == aKeyword) {
     // NOTE: we can have keyword tables where eCSSKeyword_UNKNOWN is used
     // not only for the sentinel, but also in the middle of the table to
     // knock out values that have been disabled by prefs, e.g. kDisplayKTable.
     // So we deal with eCSSKeyword_UNKNOWN up front to avoid returning a valid
     // index in the loop below.
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -282,38 +282,23 @@ class nsCSSProps {
 #define CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(it_, prop_, enabledstate_)  \
   for (const nsCSSPropertyID *                                           \
            it_ = nsCSSProps::SubpropertyEntryFor(prop_),                 \
           es_ = (nsCSSPropertyID)((enabledstate_) | CSSEnabledState(0)); \
        *it_ != eCSSProperty_UNKNOWN; ++it_)                              \
     if (nsCSSProps::IsEnabled(*it_, (mozilla::CSSEnabledState)es_))
 
   // Keyword/Enum value tables
-  // Not const because we modify its entries when the pref
-  // "layout.css.background-clip.text" changes:
-  static const KTableEntry kShapeRadiusKTable[];
-  static const KTableEntry kBoxShadowTypeKTable[];
   static const KTableEntry kCursorKTable[];
   // Not const because we modify its entries when various
   // "layout.css.*.enabled" prefs changes:
   static KTableEntry kDisplayKTable[];
-  // clang-format off
-  // -- tables for auto-completion of the {align,justify}-{content,items,self} properties --
-  static const KTableEntry kAutoCompletionAlignJustifySelf[];
-  static const KTableEntry kAutoCompletionAlignItems[];
-  static const KTableEntry kAutoCompletionAlignJustifyContent[];
-  // ------------------------------------------------------------------
-  // clang-format on
   static const KTableEntry kFontSmoothingKTable[];
-  static const KTableEntry kGridAutoFlowKTable[];
-  static const KTableEntry kGridTrackBreadthKTable[];
-  static const KTableEntry kLineHeightKTable[];
   static const KTableEntry kTextAlignKTable[];
   static const KTableEntry kTextDecorationStyleKTable[];
-  static const KTableEntry kTextEmphasisStyleShapeKTable[];
 };
 
 // MOZ_DBG support for nsCSSPropertyID
 
 inline std::ostream& operator<<(std::ostream& aOut, nsCSSPropertyID aProperty) {
   return aOut << nsCSSProps::GetStringValue(aProperty);
 }