Bug 1255401 - fix values allowed for "all" property; r=heycam
authorTom Tromey <tom@tromey.com>
Wed, 10 Jan 2018 11:48:28 -0700
changeset 453393 52fbf0d6c18c0eda95b107d73af577093e80f9da
parent 453392 dae0996220912b49d69d26759f6a1453abb7d530
child 453394 1572cddc9e46271f000627a6f0e259885bf069bc
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1255401
milestone59.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 1255401 - fix values allowed for "all" property; r=heycam The "all" property in the devtools CSS database included all possible property values; however only a few are truly appropriate. This patch adds a special case for "all" to InspectorUtils::GetCSSValuesForProperty to fix this. MozReview-Commit-ID: HEnrvCJylHI
devtools/shared/css/generated/properties-db.js
layout/inspector/InspectorUtils.cpp
layout/inspector/tests/test_bug877690.html
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -3165,569 +3165,19 @@ exports.CSS_PROPERTIES = {
       6,
       7,
       8,
       9,
       10,
       11
     ],
     "values": [
-      "COLOR",
-      "-moz-all",
-      "-moz-alt-content",
-      "-moz-available",
-      "-moz-block-height",
-      "-moz-box",
-      "-moz-button",
-      "-moz-center",
-      "-moz-crisp-edges",
-      "-moz-deck",
-      "-moz-desktop",
-      "-moz-dialog",
-      "-moz-document",
-      "-moz-element",
-      "-moz-field",
-      "-moz-fit-content",
-      "-moz-grid",
-      "-moz-grid-group",
-      "-moz-grid-line",
-      "-moz-groupbox",
-      "-moz-gtk-info-bar",
-      "-moz-hidden-unscrollable",
-      "-moz-image-rect",
-      "-moz-info",
-      "-moz-inline-box",
-      "-moz-inline-grid",
-      "-moz-inline-stack",
-      "-moz-left",
-      "-moz-linear-gradient",
-      "-moz-list",
-      "-moz-mac-active-source-list-selection",
-      "-moz-mac-disclosure-button-closed",
-      "-moz-mac-disclosure-button-open",
-      "-moz-mac-fullscreen-button",
-      "-moz-mac-help-button",
-      "-moz-mac-source-list",
-      "-moz-mac-source-list-selection",
-      "-moz-mac-vibrancy-dark",
-      "-moz-mac-vibrancy-light",
-      "-moz-mac-vibrant-titlebar-dark",
-      "-moz-mac-vibrant-titlebar-light",
-      "-moz-max-content",
-      "-moz-middle-with-baseline",
-      "-moz-min-content",
-      "-moz-none",
-      "-moz-popup",
-      "-moz-pre-space",
-      "-moz-pull-down-menu",
-      "-moz-radial-gradient",
-      "-moz-repeating-linear-gradient",
-      "-moz-repeating-radial-gradient",
-      "-moz-right",
-      "-moz-stack",
-      "-moz-text",
-      "-moz-win-borderless-glass",
-      "-moz-win-browsertabbar-toolbox",
-      "-moz-win-communications-toolbox",
-      "-moz-win-exclude-glass",
-      "-moz-win-glass",
-      "-moz-win-media-toolbox",
-      "-moz-window",
-      "-moz-window-button-box",
-      "-moz-window-button-box-maximized",
-      "-moz-window-button-close",
-      "-moz-window-button-maximize",
-      "-moz-window-button-minimize",
-      "-moz-window-button-restore",
-      "-moz-window-frame-bottom",
-      "-moz-window-frame-left",
-      "-moz-window-frame-right",
-      "-moz-window-titlebar",
-      "-moz-window-titlebar-maximized",
-      "-moz-workspace",
-      "-webkit-box",
-      "-webkit-flex",
-      "-webkit-inline-box",
-      "-webkit-inline-flex",
-      "absolute",
-      "active",
-      "add",
-      "alias",
-      "all",
-      "all-petite-caps",
-      "all-scroll",
-      "all-small-caps",
-      "alpha",
-      "alphabetic",
-      "alternate",
-      "alternate-reverse",
-      "always",
-      "auto",
-      "avoid",
-      "backwards",
-      "balance",
-      "baseline",
-      "bevel",
-      "blink",
-      "block",
-      "block-axis",
-      "bold",
-      "bolder",
-      "border-box",
-      "both",
-      "bottom",
-      "bottom-outside",
-      "break-all",
-      "break-word",
-      "butt",
-      "button",
-      "button-arrow-down",
-      "button-arrow-next",
-      "button-arrow-previous",
-      "button-arrow-up",
-      "button-bevel",
-      "button-focus",
-      "calc",
-      "capitalize",
-      "caption",
-      "caret",
-      "cell",
-      "center",
-      "central",
-      "checkbox",
-      "checkbox-container",
-      "checkbox-label",
-      "checkmenuitem",
-      "clip",
-      "clone",
-      "close-quote",
-      "col-resize",
-      "collapse",
-      "color",
-      "color-burn",
-      "color-dodge",
-      "column",
-      "column-reverse",
-      "common-ligatures",
-      "condensed",
-      "contain",
-      "content-box",
-      "contents",
-      "context-fill",
-      "context-fill-opacity",
-      "context-menu",
-      "context-stroke",
-      "context-stroke-opacity",
-      "context-value",
-      "contextual",
-      "copy",
-      "cover",
-      "crispedges",
-      "crosshair",
-      "cubic-bezier",
-      "currentColor",
-      "darken",
-      "dashed",
-      "default",
-      "dense",
-      "diagonal-fractions",
-      "dialog",
-      "difference",
-      "digits",
-      "disabled",
-      "discretionary-ligatures",
-      "distribute",
-      "dotted",
-      "double",
-      "drag",
-      "dualbutton",
-      "e-resize",
-      "ease",
-      "ease-in",
-      "ease-in-out",
-      "ease-out",
-      "economy",
-      "element",
-      "elements",
-      "ellipsis",
-      "enabled",
-      "end",
-      "evenodd",
-      "ew-resize",
-      "exact",
-      "exclude",
-      "exclusion",
-      "expanded",
-      "extra-condensed",
-      "extra-expanded",
-      "fill",
-      "fill-box",
-      "fixed",
-      "flat",
-      "flex",
-      "flex-end",
-      "flex-start",
-      "flip",
-      "flow-root",
-      "forwards",
-      "from-image",
-      "full-width",
-      "geometricprecision",
-      "grab",
-      "grabbing",
-      "grayscale",
-      "grid",
-      "groove",
-      "groupbox",
-      "hanging",
-      "hard-light",
-      "help",
-      "hidden",
-      "hide",
-      "historical-forms",
-      "historical-ligatures",
-      "horizontal",
-      "horizontal-tb",
-      "hsl",
-      "hsla",
-      "hue",
-      "icon",
-      "ideographic",
-      "ignore",
-      "ignore-horizontal",
-      "ignore-vertical",
-      "inactive",
-      "infinite",
-      "inherit",
-      "initial",
-      "inline",
-      "inline-axis",
-      "inline-block",
-      "inline-end",
-      "inline-flex",
-      "inline-grid",
-      "inline-start",
-      "inline-table",
-      "inner-spin-button",
-      "inset",
-      "inside",
-      "inter-character",
-      "inter-word",
-      "intersect",
-      "isolate",
-      "italic",
-      "jis04",
-      "jis78",
-      "jis83",
-      "jis90",
-      "justify",
-      "keep-all",
-      "large",
-      "larger",
-      "last baseline",
-      "left",
-      "lighten",
-      "lighter",
-      "line-through",
-      "linear",
-      "linear-gradient",
-      "linearrgb",
-      "lining-nums",
-      "list-item",
-      "listbox",
-      "listitem",
-      "local",
-      "lowercase",
-      "lr",
-      "lr-tb",
-      "luminance",
-      "luminosity",
-      "mandatory",
-      "manipulation",
-      "manual",
-      "margin-box",
-      "match-source",
-      "mathematical",
-      "max-content",
-      "medium",
-      "menu",
-      "menuarrow",
-      "menubar",
-      "menucheckbox",
-      "menuimage",
-      "menuitem",
-      "menuitemtext",
-      "menulist",
-      "menulist-button",
-      "menulist-text",
-      "menulist-textfield",
-      "menupopup",
-      "menuradio",
-      "menuseparator",
-      "message-box",
-      "meterbar",
-      "meterchunk",
-      "middle",
-      "min-content",
-      "miter",
-      "mixed",
-      "move",
-      "multiply",
-      "n-resize",
-      "ne-resize",
-      "nesw-resize",
-      "no-change",
-      "no-clip",
-      "no-close-quote",
-      "no-common-ligatures",
-      "no-contextual",
-      "no-discretionary-ligatures",
-      "no-drag",
-      "no-drop",
-      "no-historical-ligatures",
-      "no-open-quote",
-      "no-repeat",
-      "non-scaling-stroke",
-      "none",
-      "nonzero",
-      "normal",
-      "not-allowed",
-      "nowrap",
-      "ns-resize",
-      "number-input",
-      "nw-resize",
-      "nwse-resize",
-      "oblique",
-      "oldstyle-nums",
-      "open-quote",
-      "optimizelegibility",
-      "optimizequality",
-      "optimizespeed",
-      "ordinal",
-      "outset",
-      "outside",
-      "over",
-      "overlay",
-      "overline",
-      "padding-box",
-      "painted",
-      "pan-x",
-      "pan-y",
-      "paused",
-      "petite-caps",
-      "pointer",
-      "pre",
-      "pre-line",
-      "pre-wrap",
-      "preserve-3d",
-      "progress",
-      "progressbar",
-      "progressbar-vertical",
-      "progresschunk",
-      "progresschunk-vertical",
-      "proportional-nums",
-      "proportional-width",
-      "proximity",
-      "radial-gradient",
-      "radio",
-      "radio-container",
-      "radio-label",
-      "radiomenuitem",
-      "range",
-      "range-thumb",
-      "read-only",
-      "read-write",
-      "relative",
-      "repeat",
-      "repeat-x",
-      "repeat-y",
-      "repeating-linear-gradient",
-      "repeating-radial-gradient",
-      "reset-size",
-      "resizer",
-      "resizerpanel",
-      "reverse",
-      "rgb",
-      "rgba",
-      "ridge",
-      "right",
-      "rl",
-      "rl-tb",
-      "round",
-      "row",
-      "row-resize",
-      "row-reverse",
-      "ruby",
-      "ruby-base",
-      "ruby-base-container",
-      "ruby-text",
-      "ruby-text-container",
-      "running",
-      "s-resize",
-      "saturation",
-      "scale-down",
-      "scale-horizontal",
-      "scale-vertical",
-      "scalethumb-horizontal",
-      "scalethumb-vertical",
-      "scalethumbend",
-      "scalethumbstart",
-      "scalethumbtick",
-      "screen",
-      "scroll",
-      "scrollbar",
-      "scrollbar-horizontal",
-      "scrollbar-small",
-      "scrollbar-vertical",
-      "scrollbarbutton-down",
-      "scrollbarbutton-left",
-      "scrollbarbutton-right",
-      "scrollbarbutton-up",
-      "scrollbarthumb-horizontal",
-      "scrollbarthumb-vertical",
-      "scrollbartrack-horizontal",
-      "scrollbartrack-vertical",
-      "se-resize",
-      "searchfield",
-      "select-after",
-      "select-all",
-      "select-before",
-      "select-menu",
-      "select-same",
-      "self-end",
-      "self-start",
-      "semi-condensed",
-      "semi-expanded",
-      "separate",
-      "separator",
-      "show",
-      "sideways",
-      "sideways-lr",
-      "sideways-right",
-      "sideways-rl",
-      "simplified",
-      "slashed-zero",
-      "slice",
-      "small",
-      "small-caps",
-      "small-caption",
-      "smaller",
-      "smooth",
-      "soft-light",
-      "solid",
-      "space",
-      "space-around",
-      "space-between",
-      "space-evenly",
-      "spinner",
-      "spinner-downbutton",
-      "spinner-textfield",
-      "spinner-upbutton",
-      "splitter",
-      "square",
-      "srgb",
-      "stacked-fractions",
-      "start",
-      "static",
-      "status-bar",
-      "statusbar",
-      "statusbarpanel",
-      "step-end",
-      "step-start",
-      "steps",
-      "sticky",
-      "stretch",
-      "stretch-to-fit",
-      "stroke",
-      "stroke-box",
-      "style",
-      "sub",
-      "subtract",
-      "super",
-      "sw-resize",
-      "tab",
-      "tab-scroll-arrow-back",
-      "tab-scroll-arrow-forward",
-      "table",
-      "table-caption",
-      "table-cell",
-      "table-column",
-      "table-column-group",
-      "table-footer-group",
-      "table-header-group",
-      "table-row",
-      "table-row-group",
-      "tabpanel",
-      "tabpanels",
-      "tabular-nums",
-      "tb",
-      "tb-rl",
-      "text",
-      "text-after-edge",
-      "text-before-edge",
-      "text-bottom",
-      "text-top",
-      "textfield",
-      "textfield-multiline",
-      "thick",
-      "thin",
-      "titling-caps",
-      "toggle",
-      "toolbar",
-      "toolbarbutton",
-      "toolbarbutton-dropdown",
-      "toolbargripper",
-      "toolbox",
-      "tooltip",
-      "top",
-      "top-outside",
-      "traditional",
-      "transparent",
-      "treeheader",
-      "treeheadercell",
-      "treeheadersortarrow",
-      "treeitem",
-      "treeline",
-      "treetwisty",
-      "treetwistyopen",
-      "treeview",
-      "tri-state",
-      "ultra-condensed",
-      "ultra-expanded",
-      "under",
-      "underline",
-      "unicase",
-      "unset",
-      "uppercase",
-      "upright",
-      "url",
-      "use-script",
-      "vertical",
-      "vertical-lr",
-      "vertical-rl",
-      "vertical-text",
-      "view-box",
-      "visible",
-      "visiblefill",
-      "visiblepainted",
-      "visiblestroke",
-      "w-resize",
-      "wait",
-      "wavy",
-      "weight",
-      "window",
-      "wrap",
-      "wrap-reverse",
-      "write-only",
-      "x-large",
-      "x-small",
-      "xx-large",
-      "xx-small",
-      "zoom-in",
-      "zoom-out"
+      "inherit",
+      "initial",
+      "unset"
     ]
   },
   "animation": {
     "isInherited": false,
     "subproperties": [
       "animation-duration",
       "animation-timing-function",
       "animation-delay",
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -764,16 +764,19 @@ InspectorUtils::GetCSSValuesForProperty(
     // No other values we can report.
   } else if (!nsCSSProps::IsShorthand(propertyID)) {
     // Property is longhand.
     uint32_t propertyParserVariant = nsCSSProps::ParserVariant(propertyID);
     // Get colors first.
     GetColorsForProperty(propertyParserVariant, aResult);
     GetKeywordsForProperty(propertyID, aResult);
     GetOtherValuesForProperty(propertyParserVariant, aResult);
+  } else if (propertyID == eCSSProperty_all) {
+    // We don't want to pick up everything from gAllSubpropTable, so
+    // special-case this here.
   } else {
     // Property is shorthand.
     CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(subproperty, propertyID,
                                          CSSEnabledState::eForAllContent) {
       // Get colors (once) first.
       uint32_t propertyParserVariant = nsCSSProps::ParserVariant(*subproperty);
       if (propertyParserVariant & VARIANT_COLOR) {
         GetColorsForProperty(propertyParserVariant, aResult);
--- a/layout/inspector/tests/test_bug877690.html
+++ b/layout/inspector/tests/test_bug877690.html
@@ -206,16 +206,22 @@ function do_test() {
   var expected = [ "inherit", "initial", "unset", "repeat", "stretch", "-moz-element", "-moz-image-rect", "url",             "linear-gradient", "radial-gradient", "repeating-linear-gradient", "repeating-radial-gradient", "-moz-linear-gradient", "-moz-radial-gradient", "-moz-repeating-linear-gradient", "-moz-repeating-radial-gradient", "fill", "none", "round", "space" ];
   ok(testValues(values, expected), "property border-image's values.");
 
   var prop = "background-size"
   var values = InspectorUtils.getCSSValuesForProperty(prop);
   var expected = [ "inherit", "initial", "unset", "contain", "cover" ];
   ok(testValues(values, expected), "property background-size's values.");
 
+  // Regression test for bug 1255401.
+  var prop = "all"
+  var values = InspectorUtils.getCSSValuesForProperty(prop);
+  var expected = [ "inherit", "initial", "unset" ];
+  ok(testValues(values, expected), "property all's values.");
+
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(do_test);
 
 </script>
 </head>