diff --git a/devtools/client/inspector/shared/tooltips-overlay.js b/devtools/client/inspector/shared/tooltips-overlay.js index 55f7e25ab5..1860587ddd 100644 --- a/devtools/client/inspector/shared/tooltips-overlay.js +++ b/devtools/client/inspector/shared/tooltips-overlay.js @@ -151,7 +151,7 @@ TooltipsOverlay.prototype = { // Font preview tooltip if (type === VIEW_NODE_VALUE_TYPE && prop.property === "font-family") { let value = prop.value.toLowerCase(); - if (value !== "inherit" && value !== "unset" && value !== "initial") { + if (value !== "inherit" && value !== "unset" && value !== "initial" && value !== "revert") { tooltipType = TOOLTIP_FONTFAMILY_TYPE; } } diff --git a/devtools/client/shared/css-angle.js b/devtools/client/shared/css-angle.js index f3612ed843..aa01095e1d 100644 --- a/devtools/client/shared/css-angle.js +++ b/devtools/client/shared/css-angle.js @@ -9,7 +9,8 @@ const {CSS_ANGLEUNIT} = require("devtools/shared/css/properties-db"); const SPECIALVALUES = new Set([ "initial", "inherit", - "unset" + "unset", + "revert" ]); const {getCSSLexer} = require("devtools/shared/css/lexer"); diff --git a/devtools/client/shared/curl.js b/devtools/client/shared/curl.js index 53f24685bf..478d3f1ecd 100644 --- a/devtools/client/shared/curl.js +++ b/devtools/client/shared/curl.js @@ -395,9 +395,6 @@ const CurlUtils = { return "\\u" + ("0000" + code).substr(code.length, 4); } - // Escape & and |, which are special characters on Windows. - const winSpecialCharsRegEx = /([&\|])/g; - if (/[^\x20-\x7E]|\'/.test(str)) { // Use ANSI-C quoting syntax. return "$\'" + str.replace(/\\/g, "\\\\") @@ -405,58 +402,50 @@ const CurlUtils = { .replace(/\n/g, "\\n") .replace(/\r/g, "\\r") .replace(/!/g, "\\041") - .replace(winSpecialCharsRegEx, "^$1") .replace(/[^\x20-\x7E]/g, escapeCharacter) + "'"; } // Use single quote syntax. - return "'" + str.replace(winSpecialCharsRegEx, "^$1") + "'"; + return "'" + str + "'"; }, /** * Escape util function for Windows systems. */ escapeStringWin: function (str) { - /* - Because the cmd.exe parser and the MS Crt arguments parsers use some - of the same escape characters, they can interact with each other in - terrible ways, meaning the order of operations is critical here. - - 1. Replace \ with \\ first, because it is an escape character for - certain conditions in both parsers. - - 2. Escape double quotes with double backslashes. - - 3. Escape ` and $ so commands do not get executed, e.g $(calc.exe) or - `\$(calc.exe) - - 4. Escape all characters we are not sure about with ^, to ensure it - gets to the MS Crt arguments parser safely. - - 5. The % character is special because the MS Crt arguments parser will - try and look for environment variables and fill them in, in-place. We - cannot escape them with % and cannot escape them with ^ (because it's - cmd.exe's escape, not the MS Crt arguments parser). So, we can get the - cmd.exe parser to escape the character after it, if it is followed by - a valid starting character of an environment variable. - This ensures we do not try and double-escape another ^ if it was placed - by the previous replace. - - 6. Lastly, we replace new lines with ^ and TWO new lines, because the - first new line is there to enact the escape command, and the second is - the character to escape (in this case new line). - */ - const encapsChars = '^"'; + const encapsChars = '"'; return ( encapsChars + str + // Replace \ with \\ first because it is an escape character for certain + // conditions in both parsers. .replace(/\\/g, "\\\\") - .replace(/"/g, '\\"') + // Replace double quote chars with two double quotes (not by escaping with \") + // because it is recognized by both cmd.exe and MS CRT arguments parser. + .replace(/"/g, '""') + // Escape ` and $ so commands do not get executed e.g $(calc.exe) or `\$(calc.exe) .replace(/[`$]/g, "\\$&") + // Then escape all characters we are not sure about with ^ to ensure it + // gets to the MS CRT parser safely. .replace(/[^a-zA-Z0-9\s_\-:=+~\/.',?;()*\$&\\{}\"`]/g, "^$&") + // The % character is special because MS CRT parser will try and look for + // ENV variables and fill them in its place. We cannot escape them with % + // and cannot escape them with ^ (because it's cmd.exe's escape not MS CRT + // parser); So we can get cmd.exe parser to escape the character after it, + // if it is followed by a valid beginning character of an ENV variable. + // This ensures we do not try and double escape another ^ if it was placed + // by the previous replace. .replace(/%(?=[a-zA-Z0-9_])/g, "%^") - .replace(/\r?\n/g, "^\n\n") - + encapsChars); + // We replace \r and \r\n with \n, this allows to consistently escape all new + // lines in the next replace + .replace(/\r\n?/g, "\n") + // Lastly we replace new lines with ^ and TWO new lines because the first + // new line is there to enact the escape command the second is the character + // to escape (in this case new line). + // The extra " enables escaping new lines with ^ within quotes in cmd.exe. + .replace(/\n/g, '"^\r\n\r\n"') + + encapsChars + ); } }; diff --git a/devtools/client/shared/widgets/FilterWidget.js b/devtools/client/shared/widgets/FilterWidget.js index 9cdb27a5ab..b3392b3fa7 100644 --- a/devtools/client/shared/widgets/FilterWidget.js +++ b/devtools/client/shared/widgets/FilterWidget.js @@ -99,7 +99,7 @@ const filterList = [ ]; // Valid values that shouldn't be parsed for filters. -const SPECIAL_VALUES = new Set(["none", "unset", "initial", "inherit"]); +const SPECIAL_VALUES = new Set(["none", "unset", "initial", "inherit", "revert"]); /** * A CSS Filter editor widget used to add/remove/modify diff --git a/devtools/shared/css/color.js b/devtools/shared/css/color.js index 98ddeff195..6dfd3db31e 100644 --- a/devtools/shared/css/color.js +++ b/devtools/shared/css/color.js @@ -19,7 +19,8 @@ const SPECIALVALUES = new Set([ "initial", "inherit", "transparent", - "unset" + "unset", + "revert" ]); /** diff --git a/devtools/shared/css/generated/properties-db.js b/devtools/shared/css/generated/properties-db.js index 587f5704d1..f55e3111a2 100644 --- a/devtools/shared/css/generated/properties-db.js +++ b/devtools/shared/css/generated/properties-db.js @@ -51,6 +51,7 @@ exports.CSS_PROPERTIES = { "normal", "paused", "reverse", + "revert", "running", "step-end", "step-start", @@ -69,6 +70,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -85,6 +87,7 @@ exports.CSS_PROPERTIES = { "initial", "normal", "reverse", + "revert", "unset" ] }, @@ -99,6 +102,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -115,6 +119,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -130,6 +135,7 @@ exports.CSS_PROPERTIES = { "infinite", "inherit", "initial", + "revert", "unset" ] }, @@ -143,6 +149,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -156,6 +163,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "paused", + "revert", "running", "unset" ] @@ -177,6 +185,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "linear", + "revert", "step-end", "step-start", "steps", @@ -265,6 +274,7 @@ exports.CSS_PROPERTIES = { "range-thumb", "resizer", "resizerpanel", + "revert", "scale-horizontal", "scale-vertical", "scalethumb-horizontal", @@ -328,6 +338,7 @@ exports.CSS_PROPERTIES = { "hidden", "inherit", "initial", + "revert", "unset", "visible" ] @@ -344,6 +355,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset", "url" ] @@ -359,6 +371,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -391,6 +404,7 @@ exports.CSS_PROPERTIES = { "medium", "none", "outset", + "revert", "rgb", "rgba", "ridge", @@ -416,6 +430,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -439,6 +454,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -458,6 +474,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -494,6 +511,7 @@ exports.CSS_PROPERTIES = { "radial-gradient", "repeating-linear-gradient", "repeating-radial-gradient", + "revert", "unset", "url" ] @@ -509,6 +527,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -523,6 +542,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -555,6 +575,7 @@ exports.CSS_PROPERTIES = { "medium", "none", "outset", + "revert", "rgb", "rgba", "ridge", @@ -580,6 +601,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -603,6 +625,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -622,6 +645,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -638,6 +662,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -653,6 +678,7 @@ exports.CSS_PROPERTIES = { "end", "inherit", "initial", + "revert", "start", "stretch", "unset" @@ -669,6 +695,7 @@ exports.CSS_PROPERTIES = { "initial", "normal", "reverse", + "revert", "unset" ] }, @@ -683,6 +710,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -697,6 +725,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -712,6 +741,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "inline-axis", + "revert", "unset", "vertical" ] @@ -728,6 +758,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "justify", + "revert", "start", "unset" ] @@ -743,6 +774,7 @@ exports.CSS_PROPERTIES = { "content-box", "inherit", "initial", + "revert", "unset" ] }, @@ -758,6 +790,7 @@ exports.CSS_PROPERTIES = { "auto", "inherit", "initial", + "revert", "unset" ] }, @@ -772,6 +805,7 @@ exports.CSS_PROPERTIES = { "balance", "inherit", "initial", + "revert", "unset" ] }, @@ -790,6 +824,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -822,6 +857,7 @@ exports.CSS_PROPERTIES = { "medium", "none", "outset", + "revert", "rgb", "rgba", "ridge", @@ -847,6 +883,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -870,6 +907,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -889,6 +927,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -908,6 +947,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -927,6 +967,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -940,6 +981,7 @@ exports.CSS_PROPERTIES = { "hidden", "inherit", "initial", + "revert", "unset", "visible" ] @@ -955,6 +997,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "margin-box", + "revert", "unset" ] }, @@ -967,6 +1010,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -980,6 +1024,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -994,6 +1039,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1009,6 +1055,7 @@ exports.CSS_PROPERTIES = { "initial", "manual", "none", + "revert", "unset" ] }, @@ -1021,6 +1068,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1039,6 +1087,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -1057,6 +1106,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -1072,6 +1122,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "inline", + "revert", "unset", "vertical" ] @@ -1091,6 +1142,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1106,6 +1158,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1121,6 +1174,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1136,6 +1190,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1151,6 +1206,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1168,6 +1224,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -1185,6 +1242,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -1200,6 +1258,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -1215,6 +1274,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1228,6 +1288,7 @@ exports.CSS_PROPERTIES = { "ignore", "inherit", "initial", + "revert", "stretch-to-fit", "unset" ] @@ -1246,6 +1307,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -1263,6 +1325,7 @@ exports.CSS_PROPERTIES = { "initial", "justify", "left", + "revert", "right", "start", "unset" @@ -1279,6 +1342,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -1291,6 +1355,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1306,6 +1371,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1320,6 +1386,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "preserve-3d", + "revert", "unset" ] }, @@ -1346,6 +1413,7 @@ exports.CSS_PROPERTIES = { "initial", "linear", "none", + "revert", "step-end", "step-start", "steps", @@ -1363,6 +1431,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1377,6 +1446,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1391,6 +1461,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -1411,6 +1482,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "linear", + "revert", "step-end", "step-start", "steps", @@ -1429,6 +1501,7 @@ exports.CSS_PROPERTIES = { "initial", "none", "normal", + "revert", "select-after", "select-all", "select-before", @@ -1450,6 +1523,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -1464,6 +1538,7 @@ exports.CSS_PROPERTIES = { "initial", "read-only", "read-write", + "revert", "unset", "write-only" ] @@ -1485,6 +1560,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "text", "toggle", "tri-state", @@ -1503,6 +1579,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "no-drag", + "revert", "unset" ] }, @@ -1523,6 +1600,7 @@ exports.CSS_PROPERTIES = { "last baseline", "left", "normal", + "revert", "right", "space-around", "space-between", @@ -1549,6 +1627,7 @@ exports.CSS_PROPERTIES = { "last baseline", "left", "normal", + "revert", "right", "self-end", "self-start", @@ -1575,6 +1654,7 @@ exports.CSS_PROPERTIES = { "last baseline", "left", "normal", + "revert", "right", "self-end", "self-start", @@ -1619,6 +1699,7 @@ exports.CSS_PROPERTIES = { "normal", "paused", "reverse", + "revert", "running", "step-end", "step-start", @@ -1637,6 +1718,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1653,6 +1735,7 @@ exports.CSS_PROPERTIES = { "initial", "normal", "reverse", + "revert", "unset" ] }, @@ -1667,6 +1750,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1683,6 +1767,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -1698,6 +1783,7 @@ exports.CSS_PROPERTIES = { "infinite", "inherit", "initial", + "revert", "unset" ] }, @@ -1711,6 +1797,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -1724,6 +1811,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "paused", + "revert", "running", "unset" ] @@ -1745,6 +1833,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "linear", + "revert", "step-end", "step-start", "steps", @@ -1833,6 +1922,7 @@ exports.CSS_PROPERTIES = { "range-thumb", "resizer", "resizerpanel", + "revert", "scale-horizontal", "scale-vertical", "scalethumb-horizontal", @@ -1896,6 +1986,7 @@ exports.CSS_PROPERTIES = { "hidden", "inherit", "initial", + "revert", "unset", "visible" ] @@ -1912,6 +2003,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "padding-box", + "revert", "text", "unset" ] @@ -1928,6 +2020,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "padding-box", + "revert", "unset" ] }, @@ -1943,6 +2036,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1958,6 +2052,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -1973,6 +2068,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2007,6 +2103,7 @@ exports.CSS_PROPERTIES = { "radial-gradient", "repeating-linear-gradient", "repeating-radial-gradient", + "revert", "unset", "url" ] @@ -2026,6 +2123,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2041,6 +2139,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2056,6 +2155,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2071,6 +2171,7 @@ exports.CSS_PROPERTIES = { "end", "inherit", "initial", + "revert", "start", "stretch", "unset" @@ -2087,6 +2188,7 @@ exports.CSS_PROPERTIES = { "initial", "normal", "reverse", + "revert", "unset" ] }, @@ -2101,6 +2203,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2115,6 +2218,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2130,6 +2234,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "inline-axis", + "revert", "unset", "vertical" ] @@ -2146,6 +2251,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "justify", + "revert", "start", "unset" ] @@ -2162,6 +2268,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2176,6 +2283,7 @@ exports.CSS_PROPERTIES = { "content-box", "inherit", "initial", + "revert", "unset" ] }, @@ -2190,6 +2298,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2216,6 +2325,7 @@ exports.CSS_PROPERTIES = { "initial", "max-content", "min-content", + "revert", "unset" ] }, @@ -2239,6 +2349,7 @@ exports.CSS_PROPERTIES = { "initial", "max-content", "min-content", + "revert", "unset" ] }, @@ -2253,6 +2364,7 @@ exports.CSS_PROPERTIES = { "column-reverse", "inherit", "initial", + "revert", "row", "row-reverse", "unset" @@ -2271,6 +2383,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "nowrap", + "revert", "row", "row-reverse", "unset", @@ -2289,6 +2402,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2303,6 +2417,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2316,6 +2431,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "nowrap", + "revert", "unset", "wrap", "wrap-reverse" @@ -2338,6 +2454,7 @@ exports.CSS_PROPERTIES = { "last baseline", "left", "normal", + "revert", "right", "space-around", "space-between", @@ -2396,6 +2513,7 @@ exports.CSS_PROPERTIES = { "repeat-y", "repeating-linear-gradient", "repeating-radial-gradient", + "revert", "round", "space", "stroke-box", @@ -2419,6 +2537,7 @@ exports.CSS_PROPERTIES = { "initial", "no-clip", "padding-box", + "revert", "stroke-box", "unset", "view-box" @@ -2436,6 +2555,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "intersect", + "revert", "subtract", "unset" ] @@ -2464,6 +2584,7 @@ exports.CSS_PROPERTIES = { "radial-gradient", "repeating-linear-gradient", "repeating-radial-gradient", + "revert", "unset", "url" ] @@ -2481,6 +2602,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "padding-box", + "revert", "stroke-box", "unset", "view-box" @@ -2499,6 +2621,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2514,6 +2637,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2529,6 +2653,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2545,6 +2670,7 @@ exports.CSS_PROPERTIES = { "repeat", "repeat-x", "repeat-y", + "revert", "round", "space", "unset" @@ -2562,6 +2688,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2576,6 +2703,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2591,6 +2719,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -2606,6 +2735,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2624,6 +2754,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -2641,6 +2772,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -2664,6 +2796,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "rgb", "rgba", "thick", @@ -2687,6 +2820,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -2707,6 +2841,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -2721,6 +2856,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2736,6 +2872,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2750,6 +2887,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "preserve-3d", + "revert", "unset" ] }, @@ -2776,6 +2914,7 @@ exports.CSS_PROPERTIES = { "initial", "linear", "none", + "revert", "step-end", "step-start", "steps", @@ -2793,6 +2932,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2807,6 +2947,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -2821,6 +2962,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -2841,6 +2983,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "linear", + "revert", "step-end", "step-start", "steps", @@ -2864,6 +3007,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "text", "toggle", "tri-state", @@ -2887,6 +3031,7 @@ exports.CSS_PROPERTIES = { "last baseline", "left", "normal", + "revert", "right", "space-around", "space-between", @@ -2913,6 +3058,7 @@ exports.CSS_PROPERTIES = { "last baseline", "left", "normal", + "revert", "right", "self-end", "self-start", @@ -2939,6 +3085,7 @@ exports.CSS_PROPERTIES = { "last baseline", "left", "normal", + "revert", "right", "self-end", "self-start", @@ -3567,6 +3714,7 @@ exports.CSS_PROPERTIES = { "resizer", "resizerpanel", "reverse", + "revert", "rgb", "rgba", "ridge", @@ -3764,6 +3912,7 @@ exports.CSS_PROPERTIES = { "normal", "paused", "reverse", + "revert", "running", "step-end", "step-start", @@ -3782,6 +3931,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -3798,6 +3948,7 @@ exports.CSS_PROPERTIES = { "initial", "normal", "reverse", + "revert", "unset" ] }, @@ -3812,6 +3963,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -3828,6 +3980,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -3843,6 +3996,7 @@ exports.CSS_PROPERTIES = { "infinite", "inherit", "initial", + "revert", "unset" ] }, @@ -3856,6 +4010,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -3869,6 +4024,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "paused", + "revert", "running", "unset" ] @@ -3890,6 +4046,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "linear", + "revert", "step-end", "step-start", "steps", @@ -3906,6 +4063,7 @@ exports.CSS_PROPERTIES = { "hidden", "inherit", "initial", + "revert", "unset", "visible" ] @@ -3958,6 +4116,7 @@ exports.CSS_PROPERTIES = { "repeat-y", "repeating-linear-gradient", "repeating-radial-gradient", + "revert", "rgb", "rgba", "round", @@ -3980,6 +4139,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "local", + "revert", "scroll", "unset" ] @@ -4006,6 +4166,7 @@ exports.CSS_PROPERTIES = { "multiply", "normal", "overlay", + "revert", "saturation", "screen", "soft-light", @@ -4024,6 +4185,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "padding-box", + "revert", "text", "unset" ] @@ -4043,6 +4205,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -4073,6 +4236,7 @@ exports.CSS_PROPERTIES = { "radial-gradient", "repeating-linear-gradient", "repeating-radial-gradient", + "revert", "unset", "url" ] @@ -4089,6 +4253,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "padding-box", + "revert", "unset" ] }, @@ -4105,6 +4270,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -4120,6 +4286,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -4135,6 +4302,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -4151,6 +4319,7 @@ exports.CSS_PROPERTIES = { "repeat", "repeat-x", "repeat-y", + "revert", "round", "space", "unset" @@ -4168,6 +4337,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -4186,6 +4356,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -4246,6 +4417,7 @@ exports.CSS_PROPERTIES = { "radial-gradient", "repeating-linear-gradient", "repeating-radial-gradient", + "revert", "rgb", "rgba", "ridge", @@ -4286,6 +4458,7 @@ exports.CSS_PROPERTIES = { "medium", "none", "outset", + "revert", "rgb", "rgba", "ridge", @@ -4311,6 +4484,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -4334,6 +4508,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -4353,6 +4528,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -4387,6 +4563,7 @@ exports.CSS_PROPERTIES = { "medium", "none", "outset", + "revert", "rgb", "rgba", "ridge", @@ -4412,6 +4589,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -4435,6 +4613,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -4454,6 +4633,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -4488,6 +4668,7 @@ exports.CSS_PROPERTIES = { "medium", "none", "outset", + "revert", "rgb", "rgba", "ridge", @@ -4513,6 +4694,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -4531,6 +4713,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -4546,6 +4729,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -4566,6 +4750,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -4585,6 +4770,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -4600,6 +4786,7 @@ exports.CSS_PROPERTIES = { "collapse", "inherit", "initial", + "revert", "separate", "unset" ] @@ -4622,6 +4809,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -4659,6 +4847,7 @@ exports.CSS_PROPERTIES = { "radial-gradient", "repeating-linear-gradient", "repeating-radial-gradient", + "revert", "unset", "url" ] @@ -4675,6 +4864,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -4687,6 +4877,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -4702,6 +4893,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -4729,6 +4921,7 @@ exports.CSS_PROPERTIES = { "radial-gradient", "repeating-linear-gradient", "repeating-radial-gradient", + "revert", "unset", "url" ] @@ -4746,6 +4939,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -4778,6 +4972,7 @@ exports.CSS_PROPERTIES = { "medium", "none", "outset", + "revert", "rgb", "rgba", "ridge", @@ -4803,6 +4998,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -4826,6 +5022,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -4845,6 +5042,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -4879,6 +5077,7 @@ exports.CSS_PROPERTIES = { "medium", "none", "outset", + "revert", "rgb", "rgba", "ridge", @@ -4904,6 +5103,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -4927,6 +5127,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -4946,6 +5147,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -4980,6 +5182,7 @@ exports.CSS_PROPERTIES = { "medium", "none", "outset", + "revert", "rgb", "rgba", "ridge", @@ -5005,6 +5208,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -5028,6 +5232,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -5047,6 +5252,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -5067,6 +5273,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -5099,6 +5306,7 @@ exports.CSS_PROPERTIES = { "medium", "none", "outset", + "revert", "rgb", "rgba", "ridge", @@ -5124,6 +5332,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -5147,6 +5356,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -5166,6 +5376,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -5182,6 +5393,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -5205,6 +5417,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -5239,6 +5452,7 @@ exports.CSS_PROPERTIES = { "medium", "none", "outset", + "revert", "rgb", "rgba", "ridge", @@ -5264,6 +5478,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -5282,6 +5497,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -5297,6 +5513,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -5317,6 +5534,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -5336,6 +5554,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -5358,6 +5577,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -5378,6 +5598,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -5391,6 +5612,7 @@ exports.CSS_PROPERTIES = { "clone", "inherit", "initial", + "revert", "slice", "unset" ] @@ -5407,6 +5629,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -5421,6 +5644,7 @@ exports.CSS_PROPERTIES = { "content-box", "inherit", "initial", + "revert", "unset" ] }, @@ -5436,6 +5660,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "left", + "revert", "right", "top", "top-outside", @@ -5458,6 +5683,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -5478,6 +5704,7 @@ exports.CSS_PROPERTIES = { "inline-start", "left", "none", + "revert", "right", "unset" ] @@ -5491,6 +5718,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -5505,6 +5733,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -5519,6 +5748,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "nonzero", + "revert", "unset" ] }, @@ -5537,6 +5767,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -5554,6 +5785,7 @@ exports.CSS_PROPERTIES = { "exact", "inherit", "initial", + "revert", "unset" ] }, @@ -5568,6 +5800,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "linearrgb", + "revert", "srgb", "unset" ] @@ -5583,6 +5816,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "linearrgb", + "revert", "srgb", "unset" ] @@ -5599,6 +5833,7 @@ exports.CSS_PROPERTIES = { "auto", "inherit", "initial", + "revert", "unset" ] }, @@ -5613,6 +5848,7 @@ exports.CSS_PROPERTIES = { "balance", "inherit", "initial", + "revert", "unset" ] }, @@ -5631,6 +5867,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -5663,6 +5900,7 @@ exports.CSS_PROPERTIES = { "medium", "none", "outset", + "revert", "rgb", "rgba", "ridge", @@ -5688,6 +5926,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -5711,6 +5950,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -5730,6 +5970,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -5749,6 +5990,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -5768,6 +6010,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -5782,6 +6025,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -5794,6 +6038,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -5806,6 +6051,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -5820,6 +6066,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -5833,6 +6080,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "ltr", + "revert", "rtl", "unset" ] @@ -5873,6 +6121,7 @@ exports.CSS_PROPERTIES = { "inline-table", "list-item", "none", + "revert", "ruby", "ruby-base", "ruby-base-container", @@ -5908,6 +6157,7 @@ exports.CSS_PROPERTIES = { "middle", "no-change", "reset-size", + "revert", "text-after-edge", "text-before-edge", "unset", @@ -5924,6 +6174,7 @@ exports.CSS_PROPERTIES = { "hide", "inherit", "initial", + "revert", "show", "unset" ] @@ -5940,6 +6191,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -5954,6 +6206,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -5968,6 +6221,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "nonzero", + "revert", "unset" ] }, @@ -5982,6 +6236,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6008,6 +6263,7 @@ exports.CSS_PROPERTIES = { "initial", "max-content", "min-content", + "revert", "unset" ] }, @@ -6031,6 +6287,7 @@ exports.CSS_PROPERTIES = { "initial", "max-content", "min-content", + "revert", "unset" ] }, @@ -6045,6 +6302,7 @@ exports.CSS_PROPERTIES = { "column-reverse", "inherit", "initial", + "revert", "row", "row-reverse", "unset" @@ -6063,6 +6321,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "nowrap", + "revert", "row", "row-reverse", "unset", @@ -6081,6 +6340,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6095,6 +6355,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6108,6 +6369,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "nowrap", + "revert", "unset", "wrap", "wrap-reverse" @@ -6126,6 +6388,7 @@ exports.CSS_PROPERTIES = { "inline-start", "left", "none", + "revert", "right", "unset" ] @@ -6145,6 +6408,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -6162,6 +6426,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6213,6 +6478,7 @@ exports.CSS_PROPERTIES = { "normal", "oblique", "petite-caps", + "revert", "semi-condensed", "semi-expanded", "small", @@ -6240,6 +6506,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6252,6 +6519,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6267,6 +6535,7 @@ exports.CSS_PROPERTIES = { "initial", "none", "normal", + "revert", "unset" ] }, @@ -6280,6 +6549,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -6300,6 +6570,7 @@ exports.CSS_PROPERTIES = { "large", "larger", "medium", + "revert", "small", "smaller", "unset", @@ -6321,6 +6592,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -6338,6 +6610,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "semi-condensed", "semi-expanded", "ultra-condensed", @@ -6357,6 +6630,7 @@ exports.CSS_PROPERTIES = { "italic", "normal", "oblique", + "revert", "unset" ] }, @@ -6369,6 +6643,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6390,6 +6665,7 @@ exports.CSS_PROPERTIES = { "initial", "normal", "petite-caps", + "revert", "small-caps", "sub", "super", @@ -6407,6 +6683,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6423,6 +6700,7 @@ exports.CSS_PROPERTIES = { "initial", "normal", "petite-caps", + "revert", "small-caps", "titling-caps", "unicase", @@ -6438,6 +6716,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6450,6 +6729,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6462,6 +6742,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6475,6 +6756,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "sub", "super", "unset" @@ -6489,6 +6771,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6503,6 +6786,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6522,6 +6806,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -6542,6 +6827,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6559,6 +6845,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6574,6 +6861,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6586,6 +6874,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6601,6 +6890,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6616,6 +6906,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6630,6 +6921,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6648,6 +6940,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -6662,6 +6955,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6681,6 +6975,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -6696,6 +6991,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6710,6 +7006,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6728,6 +7025,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -6742,6 +7040,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6759,6 +7058,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6771,6 +7071,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6786,6 +7087,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6801,6 +7103,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6823,6 +7126,7 @@ exports.CSS_PROPERTIES = { "initial", "max-content", "min-content", + "revert", "unset" ] }, @@ -6838,6 +7142,7 @@ exports.CSS_PROPERTIES = { "initial", "manual", "none", + "revert", "unset" ] }, @@ -6852,6 +7157,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -6870,6 +7176,7 @@ exports.CSS_PROPERTIES = { "optimizequality", "optimizespeed", "pixelated", + "revert", "smooth", "unset" ] @@ -6888,6 +7195,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -6910,6 +7218,7 @@ exports.CSS_PROPERTIES = { "initial", "max-content", "min-content", + "revert", "unset" ] }, @@ -6931,6 +7240,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -6949,6 +7259,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -6967,6 +7278,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -6985,6 +7297,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7003,6 +7316,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7017,6 +7331,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "isolate", + "revert", "unset" ] }, @@ -7037,6 +7352,7 @@ exports.CSS_PROPERTIES = { "last baseline", "left", "normal", + "revert", "right", "space-around", "space-between", @@ -7064,6 +7380,7 @@ exports.CSS_PROPERTIES = { "last baseline", "left", "normal", + "revert", "right", "self-end", "self-start", @@ -7090,6 +7407,7 @@ exports.CSS_PROPERTIES = { "last baseline", "left", "normal", + "revert", "right", "self-end", "self-start", @@ -7113,6 +7431,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7130,6 +7449,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -7148,6 +7468,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -7171,6 +7492,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -7190,6 +7512,7 @@ exports.CSS_PROPERTIES = { "inside", "none", "outside", + "revert", "unset", "url" ] @@ -7206,6 +7529,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset", "url" ] @@ -7221,6 +7545,7 @@ exports.CSS_PROPERTIES = { "initial", "inside", "outside", + "revert", "unset" ] }, @@ -7233,6 +7558,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -7254,6 +7580,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7273,6 +7600,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7291,6 +7619,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7309,6 +7638,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7327,6 +7657,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7346,6 +7677,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7364,6 +7696,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7382,6 +7715,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7400,6 +7734,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7418,6 +7753,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7436,6 +7772,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7453,6 +7790,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset", "url" ] @@ -7469,6 +7807,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset", "url" ] @@ -7485,6 +7824,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset", "url" ] @@ -7501,6 +7841,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset", "url" ] @@ -7554,6 +7895,7 @@ exports.CSS_PROPERTIES = { "repeat-y", "repeating-linear-gradient", "repeating-radial-gradient", + "revert", "round", "space", "stroke-box", @@ -7577,6 +7919,7 @@ exports.CSS_PROPERTIES = { "initial", "no-clip", "padding-box", + "revert", "stroke-box", "unset", "view-box" @@ -7594,6 +7937,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "intersect", + "revert", "subtract", "unset" ] @@ -7622,6 +7966,7 @@ exports.CSS_PROPERTIES = { "radial-gradient", "repeating-linear-gradient", "repeating-radial-gradient", + "revert", "unset", "url" ] @@ -7638,6 +7983,7 @@ exports.CSS_PROPERTIES = { "initial", "luminance", "match-source", + "revert", "unset" ] }, @@ -7654,6 +8000,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "padding-box", + "revert", "stroke-box", "unset", "view-box" @@ -7672,6 +8019,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -7687,6 +8035,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -7702,6 +8051,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -7718,6 +8068,7 @@ exports.CSS_PROPERTIES = { "repeat", "repeat-x", "repeat-y", + "revert", "round", "space", "unset" @@ -7735,6 +8086,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -7749,6 +8101,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "luminance", + "revert", "unset" ] }, @@ -7767,6 +8120,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -7789,6 +8143,7 @@ exports.CSS_PROPERTIES = { "max-content", "min-content", "none", + "revert", "unset" ] }, @@ -7811,6 +8166,7 @@ exports.CSS_PROPERTIES = { "max-content", "min-content", "none", + "revert", "unset" ] }, @@ -7833,6 +8189,7 @@ exports.CSS_PROPERTIES = { "max-content", "min-content", "none", + "revert", "unset" ] }, @@ -7851,6 +8208,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -7873,6 +8231,7 @@ exports.CSS_PROPERTIES = { "initial", "max-content", "min-content", + "revert", "unset" ] }, @@ -7895,6 +8254,7 @@ exports.CSS_PROPERTIES = { "initial", "max-content", "min-content", + "revert", "unset" ] }, @@ -7917,6 +8277,7 @@ exports.CSS_PROPERTIES = { "initial", "max-content", "min-content", + "revert", "unset" ] }, @@ -7942,6 +8303,7 @@ exports.CSS_PROPERTIES = { "multiply", "normal", "overlay", + "revert", "saturation", "screen", "soft-light", @@ -7961,6 +8323,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "scale-down", "unset" ] @@ -7977,6 +8340,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -7995,6 +8359,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8013,6 +8378,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8031,6 +8397,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8049,6 +8416,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8063,6 +8431,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -8077,6 +8446,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -8109,6 +8479,7 @@ exports.CSS_PROPERTIES = { "medium", "none", "outset", + "revert", "rgb", "rgba", "ridge", @@ -8134,6 +8505,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -8153,6 +8525,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8173,6 +8546,7 @@ exports.CSS_PROPERTIES = { "inset", "none", "outset", + "revert", "ridge", "solid", "unset" @@ -8192,6 +8566,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "medium", + "revert", "thick", "thin", "unset" @@ -8210,6 +8585,7 @@ exports.CSS_PROPERTIES = { "hidden", "inherit", "initial", + "revert", "scroll", "unset", "visible" @@ -8227,6 +8603,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -8242,6 +8619,7 @@ exports.CSS_PROPERTIES = { "hidden", "inherit", "initial", + "revert", "scroll", "unset", "visible" @@ -8259,6 +8637,7 @@ exports.CSS_PROPERTIES = { "hidden", "inherit", "initial", + "revert", "scroll", "unset", "visible" @@ -8281,6 +8660,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8299,6 +8679,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8316,6 +8697,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8333,6 +8715,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8350,6 +8733,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8368,6 +8752,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8385,6 +8770,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8402,6 +8788,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8419,6 +8806,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8436,6 +8824,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8453,6 +8842,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8469,6 +8859,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "left", + "revert", "right", "unset" ] @@ -8486,6 +8877,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "left", + "revert", "right", "unset" ] @@ -8501,6 +8893,7 @@ exports.CSS_PROPERTIES = { "avoid", "inherit", "initial", + "revert", "unset" ] }, @@ -8513,6 +8906,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -8528,6 +8922,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -8543,6 +8938,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -8564,6 +8960,7 @@ exports.CSS_PROPERTIES = { "last baseline", "left", "normal", + "revert", "right", "space-around", "space-between", @@ -8592,6 +8989,7 @@ exports.CSS_PROPERTIES = { "last baseline", "left", "normal", + "revert", "right", "self-end", "self-start", @@ -8619,6 +9017,7 @@ exports.CSS_PROPERTIES = { "last baseline", "left", "normal", + "revert", "right", "self-end", "self-start", @@ -8641,6 +9040,7 @@ exports.CSS_PROPERTIES = { "initial", "none", "painted", + "revert", "stroke", "unset", "visible", @@ -8661,6 +9061,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "relative", + "revert", "static", "sticky", "unset" @@ -8675,6 +9076,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -8690,6 +9092,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset", "vertical" ] @@ -8709,6 +9112,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8727,6 +9131,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -8740,6 +9145,7 @@ exports.CSS_PROPERTIES = { "center", "inherit", "initial", + "revert", "space-around", "space-between", "start", @@ -8756,6 +9162,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "over", + "revert", "under", "unset" ] @@ -8770,6 +9177,7 @@ exports.CSS_PROPERTIES = { "auto", "inherit", "initial", + "revert", "smooth", "unset" ] @@ -8786,6 +9194,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -8801,6 +9210,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -8813,6 +9223,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -8825,6 +9236,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -8841,6 +9253,7 @@ exports.CSS_PROPERTIES = { "mandatory", "none", "proximity", + "revert", "unset" ] }, @@ -8856,6 +9269,7 @@ exports.CSS_PROPERTIES = { "mandatory", "none", "proximity", + "revert", "unset" ] }, @@ -8871,6 +9285,7 @@ exports.CSS_PROPERTIES = { "mandatory", "none", "proximity", + "revert", "unset" ] }, @@ -8885,6 +9300,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "thin", "unset" ] @@ -8902,6 +9318,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "optimizespeed", + "revert", "unset" ] }, @@ -8920,6 +9337,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -8937,6 +9355,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -8952,6 +9371,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -8968,6 +9388,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -8986,6 +9407,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -8999,6 +9421,7 @@ exports.CSS_PROPERTIES = { "butt", "inherit", "initial", + "revert", "round", "square", "unset" @@ -9015,6 +9438,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "miter", + "revert", "round", "unset" ] @@ -9030,6 +9454,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9044,6 +9469,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9060,6 +9486,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9077,6 +9504,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -9091,6 +9519,7 @@ exports.CSS_PROPERTIES = { "fixed", "inherit", "initial", + "revert", "unset" ] }, @@ -9110,6 +9539,7 @@ exports.CSS_PROPERTIES = { "initial", "justify", "left", + "revert", "right", "start", "unset" @@ -9129,6 +9559,7 @@ exports.CSS_PROPERTIES = { "initial", "justify", "left", + "revert", "right", "start", "unset" @@ -9145,6 +9576,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "middle", + "revert", "start", "unset" ] @@ -9158,6 +9590,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9182,6 +9615,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "solid", @@ -9205,6 +9639,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -9220,6 +9655,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9236,6 +9672,7 @@ exports.CSS_PROPERTIES = { "double", "inherit", "initial", + "revert", "solid", "unset", "wavy" @@ -9257,6 +9694,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -9278,6 +9716,7 @@ exports.CSS_PROPERTIES = { "hsla", "inherit", "initial", + "revert", "rgb", "rgba", "transparent", @@ -9293,6 +9732,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9305,6 +9745,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9322,6 +9763,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -9339,6 +9781,7 @@ exports.CSS_PROPERTIES = { "inter-character", "inter-word", "none", + "revert", "unset" ] }, @@ -9352,6 +9795,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "mixed", + "revert", "sideways", "sideways-right", "unset", @@ -9367,6 +9811,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9383,6 +9828,7 @@ exports.CSS_PROPERTIES = { "initial", "optimizelegibility", "optimizespeed", + "revert", "unset" ] }, @@ -9398,6 +9844,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9414,6 +9861,7 @@ exports.CSS_PROPERTIES = { "initial", "lowercase", "none", + "revert", "unset", "uppercase" ] @@ -9433,6 +9881,7 @@ exports.CSS_PROPERTIES = { "calc", "inherit", "initial", + "revert", "unset" ] }, @@ -9450,6 +9899,7 @@ exports.CSS_PROPERTIES = { "none", "pan-x", "pan-y", + "revert", "unset" ] }, @@ -9462,6 +9912,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9476,6 +9927,7 @@ exports.CSS_PROPERTIES = { "fill-box", "inherit", "initial", + "revert", "unset", "view-box" ] @@ -9492,6 +9944,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9506,6 +9959,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "preserve-3d", + "revert", "unset" ] }, @@ -9532,6 +9986,7 @@ exports.CSS_PROPERTIES = { "initial", "linear", "none", + "revert", "step-end", "step-start", "steps", @@ -9549,6 +10004,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9563,6 +10019,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9577,6 +10034,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "none", + "revert", "unset" ] }, @@ -9597,6 +10055,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "linear", + "revert", "step-end", "step-start", "steps", @@ -9621,6 +10080,7 @@ exports.CSS_PROPERTIES = { "isolate-override", "normal", "plaintext", + "revert", "unset" ] }, @@ -9635,6 +10095,7 @@ exports.CSS_PROPERTIES = { "initial", "non-scaling-stroke", "none", + "revert", "unset" ] }, @@ -9656,6 +10117,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "middle", + "revert", "sub", "super", "text-bottom", @@ -9675,6 +10137,7 @@ exports.CSS_PROPERTIES = { "hidden", "inherit", "initial", + "revert", "unset", "visible" ] @@ -9695,6 +10158,7 @@ exports.CSS_PROPERTIES = { "pre", "pre-line", "pre-wrap", + "revert", "unset" ] }, @@ -9717,6 +10181,7 @@ exports.CSS_PROPERTIES = { "initial", "max-content", "min-content", + "revert", "unset" ] }, @@ -9729,6 +10194,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "revert", "unset" ] }, @@ -9744,6 +10210,7 @@ exports.CSS_PROPERTIES = { "initial", "keep-all", "normal", + "revert", "unset" ] }, @@ -9762,6 +10229,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -9777,6 +10245,7 @@ exports.CSS_PROPERTIES = { "inherit", "initial", "normal", + "revert", "unset" ] }, @@ -9792,6 +10261,7 @@ exports.CSS_PROPERTIES = { "initial", "lr", "lr-tb", + "revert", "rl", "rl-tb", "sideways-lr", @@ -9815,6 +10285,7 @@ exports.CSS_PROPERTIES = { "auto", "inherit", "initial", + "revert", "unset" ] } diff --git a/dom/animation/TimingParams.cpp b/dom/animation/TimingParams.cpp index f387f460f8..a020fd83af 100644 --- a/dom/animation/TimingParams.cpp +++ b/dom/animation/TimingParams.cpp @@ -154,6 +154,7 @@ TimingParams::ParseEasing(const nsAString& aEasing, case eCSSUnit_Inherit: case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: case eCSSUnit_TokenStream: case eCSSUnit_Null: break; diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 5d5490206d..fe2b31f206 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -2731,6 +2731,7 @@ PropertyIsInheritOrInitial(Declaration* aDeclaration, const nsCSSPropertyID aPro const nsCSSValue* filterVal = aDeclaration->GetNormalBlock()->ValueFor(aProperty); return (!filterVal || (filterVal->GetUnit() == eCSSUnit_Unset || + filterVal->GetUnit() == eCSSUnit_Revert || filterVal->GetUnit() == eCSSUnit_Inherit || filterVal->GetUnit() == eCSSUnit_Initial)); } diff --git a/layout/inspector/inDOMUtils.cpp b/layout/inspector/inDOMUtils.cpp index fdae4543ed..793e973e3b 100644 --- a/layout/inspector/inDOMUtils.cpp +++ b/layout/inspector/inDOMUtils.cpp @@ -953,10 +953,11 @@ inDOMUtils::GetCSSValuesForProperty(const nsAString& aProperty, GetOtherValuesForProperty(propertyParserVariant, array); } } - // All CSS properties take initial, inherit and unset. + // All CSS properties take initial, inherit, unset, and revert. InsertNoDuplicates(array, NS_LITERAL_STRING("initial")); InsertNoDuplicates(array, NS_LITERAL_STRING("inherit")); InsertNoDuplicates(array, NS_LITERAL_STRING("unset")); + InsertNoDuplicates(array, NS_LITERAL_STRING("revert")); *aLength = array.Length(); char16_t** ret = diff --git a/layout/style/CSSVariableDeclarations.cpp b/layout/style/CSSVariableDeclarations.cpp index 34a2bb0357..70194892c3 100644 --- a/layout/style/CSSVariableDeclarations.cpp +++ b/layout/style/CSSVariableDeclarations.cpp @@ -11,12 +11,13 @@ #include "nsCSSScanner.h" #include "nsRuleData.h" -// These three special string values are used to represent specified values of -// 'initial', 'inherit' and 'unset'. (Note that none of these are valid -// variable values.) +// These four special string values are used to represent specified values of +// 'initial', 'inherit', 'unset', and 'revert'. (Note that none of these are +// valid variable values.) #define INITIAL_VALUE "!" #define INHERIT_VALUE ";" #define UNSET_VALUE ")" +#define REVERT_VALUE ">" namespace mozilla { @@ -83,6 +84,9 @@ CSSVariableDeclarations::Get(const nsAString& aName, } else if (value.EqualsLiteral(UNSET_VALUE)) { aType = eUnset; aTokenStream.Truncate(); + } else if (value.EqualsLiteral(REVERT_VALUE)) { + aType = eRevert; + aTokenStream.Truncate(); } else { aType = eTokenStream; aTokenStream = value; @@ -96,7 +100,8 @@ CSSVariableDeclarations::PutTokenStream(const nsAString& aName, { MOZ_ASSERT(!aTokenStream.EqualsLiteral(INITIAL_VALUE) && !aTokenStream.EqualsLiteral(INHERIT_VALUE) && - !aTokenStream.EqualsLiteral(UNSET_VALUE)); + !aTokenStream.EqualsLiteral(UNSET_VALUE) && + !aTokenStream.EqualsLiteral(REVERT_VALUE)); mVariables.Put(aName, aTokenStream); } @@ -118,6 +123,12 @@ CSSVariableDeclarations::PutUnset(const nsAString& aName) mVariables.Put(aName, NS_LITERAL_STRING(UNSET_VALUE)); } +void +CSSVariableDeclarations::PutRevert(const nsAString& aName) +{ + mVariables.Put(aName, NS_LITERAL_STRING(REVERT_VALUE)); +} + void CSSVariableDeclarations::Remove(const nsAString& aName) { @@ -160,12 +171,13 @@ CSSVariableDeclarations::AddVariablesToResolver( eCSSTokenSerialization_Nothing, false); } else if (value.EqualsLiteral(INHERIT_VALUE) || - value.EqualsLiteral(UNSET_VALUE)) { - // Values of 'inherit' and 'unset' don't need any handling, since it means - // we just need to keep whatever value is currently in the resolver. This - // is because the specified variable declarations already have only the - // winning declaration for the variable and no longer have any of the - // others. + value.EqualsLiteral(UNSET_VALUE) || + value.EqualsLiteral(REVERT_VALUE)) { + // Values of 'inherit', 'unset', and 'revert' don't need any handling, + // since it means we just need to keep whatever value is currently in + // the resolver. This is because the specified variable declarations + // already have only the winning declaration for the variable and no + // longer have any of the others. } else { // At this point, we don't know what token types are at the start and end // of the specified variable value. These will be determined later during diff --git a/layout/style/CSSVariableDeclarations.h b/layout/style/CSSVariableDeclarations.h index 294e71a004..833daa7639 100644 --- a/layout/style/CSSVariableDeclarations.h +++ b/layout/style/CSSVariableDeclarations.h @@ -42,7 +42,8 @@ public: eTokenStream, // a stream of CSS tokens (the usual type for variables) eInitial, // 'initial' eInherit, // 'inherit' - eUnset // 'unset' + eUnset, // 'unset' + eRevert // 'revert' }; /** @@ -53,8 +54,8 @@ public: * @param aType Out parameter into which the type of the variable value will * be stored. * @param aValue Out parameter into which the value of the variable will - * be stored. If the variable is 'initial', 'inherit' or 'unset', this will - * be the empty string. + * be stored. If the variable is 'initial', 'inherit', 'unset', or + * 'revert', this will be the empty string. * @return Whether a variable with the given name was found. When false * is returned, aType and aValue will not be modified. */ @@ -87,6 +88,15 @@ public: */ void PutUnset(const nsAString& aName); + /** + * Adds or modifies an existing entry in this set of variable declarations + * to have the value 'revert'. + * + * @param aName The variable name (not including any "--" prefix that would + * be part of the custom property name) whose value is to be set. + */ + void PutRevert(const nsAString& aName); + /** * Adds or modifies an existing entry in this set of variable declarations * to have a token stream value. diff --git a/layout/style/Declaration.cpp b/layout/style/Declaration.cpp index 5d88feee26..8638b91071 100644 --- a/layout/style/Declaration.cpp +++ b/layout/style/Declaration.cpp @@ -558,9 +558,9 @@ Declaration::GetPropertyValueInternal( // (1) Since a shorthand sets all sub-properties, if some of its // subproperties were not specified, we must return the empty // string. - // (2) Since 'inherit', 'initial' and 'unset' can only be specified - // as the values for entire properties, we need to return the - // empty string if some but not all of the subproperties have one + // (2) Since 'inherit', 'initial', 'unset', and 'revert' can only be + // specified as the values for entire properties, we need to return + // the empty string if some but not all of the subproperties have one // of those values. // (3) Since a single value only makes sense with or without // !important, we return the empty string if some values are @@ -575,7 +575,7 @@ Declaration::GetPropertyValueInternal( // assigned to the shorthand. const nsCSSValue* tokenStream = nullptr; uint32_t totalCount = 0, importantCount = 0, - initialCount = 0, inheritCount = 0, unsetCount = 0, + initialCount = 0, inheritCount = 0, unsetCount = 0, revertCount = 0, matchingTokenStreamCount = 0, nonMatchingTokenStreamCount = 0; CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aProperty, CSSEnabledState::eForAllContent) { @@ -601,6 +601,8 @@ Declaration::GetPropertyValueInternal( ++initialCount; } else if (val->GetUnit() == eCSSUnit_Unset) { ++unsetCount; + } else if (val->GetUnit() == eCSSUnit_Revert) { + ++revertCount; } else if (val->GetUnit() == eCSSUnit_TokenStream) { if (val->GetTokenStreamValue()->mShorthandPropertyID == aProperty) { tokenStream = val; @@ -632,9 +634,15 @@ Declaration::GetPropertyValueInternal( nsCSSValue::eNormalized); return; } - if (initialCount != 0 || inheritCount != 0 || - unsetCount != 0 || nonMatchingTokenStreamCount != 0) { - // Case (2): partially initial, inherit, unset or token stream. + if (revertCount == totalCount) { + // Simplify serialization below by serializing revert up-front. + nsCSSValue(eCSSUnit_Revert).AppendToString(eCSSProperty_UNKNOWN, aValue, + nsCSSValue::eNormalized); + return; + } + if (initialCount != 0 || inheritCount != 0 || unsetCount != 0 || + revertCount != 0 || nonMatchingTokenStreamCount != 0) { + // Case (2): partially initial, inherit, unset, revert, or token stream. return; } if (tokenStream) { @@ -794,18 +802,63 @@ Declaration::GetPropertyValueInternal( MOZ_ASSERT(StringEndsWith(nsCSSProps::GetStringValue(subprops[2]), NS_LITERAL_CSTRING("-color")), "third subprop must be the color property"); + + const nsCSSValue *widthValue = data->ValueFor(subprops[0]); + const nsCSSValue *styleValue = data->ValueFor(subprops[1]); const nsCSSValue *colorValue = data->ValueFor(subprops[2]); - bool isCurrentColor = + + bool isNoneStyle = + styleValue->GetUnit() == eCSSUnit_Enumerated && + styleValue->GetIntValue() == NS_STYLE_BORDER_STYLE_NONE; + + bool isMediumWidth = + widthValue->GetUnit() == eCSSUnit_Enumerated && + widthValue->GetIntValue() == NS_STYLE_BORDER_WIDTH_MEDIUM; + + bool isCurrentColor = colorValue->GetUnit() == eCSSUnit_EnumColor && + colorValue->GetIntValue() == NS_COLOR_CURRENTCOLOR; + + if (isNoneStyle && isCurrentColor) { + // Case (1) above: some subproperties not specified. + return; + } + + isCurrentColor = colorValue->GetUnit() == eCSSUnit_EnumColor && colorValue->GetIntValue() == NS_COLOR_CURRENTCOLOR; - if (!AppendValueToString(subprops[0], aValue, aSerialization) || - !(aValue.Append(char16_t(' ')), - AppendValueToString(subprops[1], aValue, aSerialization)) || - // Don't output a third value when it's currentcolor. - !(isCurrentColor || - (aValue.Append(char16_t(' ')), - AppendValueToString(subprops[2], aValue, aSerialization)))) { - aValue.Truncate(); + + // special case: if we have just color and all other values are default, + // output: color + if (!isCurrentColor && isNoneStyle && isMediumWidth) { + if (!AppendValueToString(subprops[2], aValue, aSerialization)) { + aValue.Truncate(); + } + break; + } + + // normal case: output width unless medium and only have color + if (!(isMediumWidth && isNoneStyle && !isCurrentColor)) { + if (!AppendValueToString(subprops[0], aValue, aSerialization)) { + aValue.Truncate(); + break; + } + } + + // if style is not none, append style + if (!isNoneStyle) { + aValue.Append(char16_t(' ')); + if (!AppendValueToString(subprops[1], aValue, aSerialization)) { + aValue.Truncate(); + break; + } + } + + if (!isCurrentColor) { + aValue.Append(char16_t(' ')); + if (!AppendValueToString(subprops[2], aValue, aSerialization)) { + aValue.Truncate(); + break; + } } break; } @@ -1022,12 +1075,21 @@ Declaration::GetPropertyValueInternal( aSerialization); break; case eCSSProperty_overflow: { - const nsCSSValue &xValue = - *data->ValueFor(eCSSProperty_overflow_x); - const nsCSSValue &yValue = - *data->ValueFor(eCSSProperty_overflow_y); - if (xValue == yValue) - xValue.AppendToString(eCSSProperty_overflow_x, aValue, aSerialization); + const nsCSSValue* xValue = data->ValueFor(eCSSProperty_overflow_x); + const nsCSSValue* yValue = data->ValueFor(eCSSProperty_overflow_y); + if (!xValue || !yValue || + xValue->GetUnit() != eCSSUnit_Enumerated || + yValue->GetUnit() != eCSSUnit_Enumerated) { + aValue.Truncate(); // don't serialize shorthand if not both present/enumerated + break; + } + if (*xValue == *yValue) { + xValue->AppendToString(eCSSProperty_overflow_x, aValue, aSerialization); + } else { + xValue->AppendToString(eCSSProperty_overflow_x, aValue, aSerialization); + aValue.Append(char16_t(' ')); + yValue->AppendToString(eCSSProperty_overflow_y, aValue, aSerialization); + } break; } case eCSSProperty_text_decoration: { @@ -1455,6 +1517,7 @@ Declaration::GetPropertyValueInternal( case eCSSUnit_Inherit: case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: return true; case eCSSUnit_Enumerated: // return false if there is a fallback value or @@ -1563,10 +1626,10 @@ Declaration::GetPropertyValueInternal( break; } case eCSSProperty_all: - // If we got here, then we didn't have all "inherit" or "initial" or - // "unset" values for all of the longhand property components of 'all'. - // There is no other possible value that is valid for all properties, - // so serialize as the empty string. + // If we got here, then we didn't have all "inherit", "initial", "unset", + // or "revert" values for all of the longhand property components of + // 'all'. There is no other possible value that is valid for all + // properties, so serialize as the empty string. break; default: MOZ_ASSERT(false, "no other shorthands"); @@ -1663,6 +1726,10 @@ Declaration::AppendVariableAndValueToString(const nsAString& aName, aResult.AppendLiteral("unset"); break; + case CSSVariableDeclarations::eRevert: + aResult.AppendLiteral("revert"); + break; + default: MOZ_ASSERT(false, "unexpected variable value type"); } @@ -1899,6 +1966,10 @@ Declaration::GetVariableValue(const nsAString& aName, nsAString& aValue) const aValue.AppendLiteral("unset"); break; + case CSSVariableDeclarations::eRevert: + aValue.AppendLiteral("revert"); + break; + default: MOZ_ASSERT(false, "unexpected variable value type"); } @@ -1964,6 +2035,11 @@ Declaration::AddVariable(const nsAString& aName, variables->PutUnset(aName); break; + case CSSVariableDeclarations::eRevert: + MOZ_ASSERT(aValue.IsEmpty()); + variables->PutRevert(aName); + break; + default: MOZ_ASSERT(false, "unexpected aType value"); } diff --git a/layout/style/FontFaceSet.cpp b/layout/style/FontFaceSet.cpp index 04c04fd372..9b94e8af9b 100644 --- a/layout/style/FontFaceSet.cpp +++ b/layout/style/FontFaceSet.cpp @@ -201,7 +201,7 @@ FontFaceSet::ParseFontShorthandForMatching( const nsCSSValue* family = data->ValueFor(eCSSProperty_font_family); if (family->GetUnit() != eCSSUnit_FontFamilyList) { - // We got inherit, initial, unset, a system font, or a token stream. + // We got inherit, initial, unset, revert, a system font, or a token stream. aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR); return; } diff --git a/layout/style/nsCSSDataBlock.cpp b/layout/style/nsCSSDataBlock.cpp index e6045451d8..09ac37550e 100644 --- a/layout/style/nsCSSDataBlock.cpp +++ b/layout/style/nsCSSDataBlock.cpp @@ -174,7 +174,8 @@ MapSinglePropertyInto(nsCSSPropertyID aTargetProp, // then records any resulting ImageValue objects in the // CSSVariableImageTable, to give them the appropriate lifetime. MOZ_ASSERT(aTargetValue->GetUnit() == eCSSUnit_TokenStream || - aTargetValue->GetUnit() == eCSSUnit_Null, + aTargetValue->GetUnit() == eCSSUnit_Null || + aTargetValue->GetUnit() == eCSSUnit_Revert, "aTargetValue must only be a token stream (when re-parsing " "properties with variable references) or null"); @@ -316,19 +317,26 @@ nsCSSCompressedDataBlock::MapRuleInfoInto(nsRuleData *aRuleData) const EnsurePhysicalProperty(iProp, aRuleData); } nsCSSValue* target = aRuleData->ValueFor(iProp); - if (target->GetUnit() == eCSSUnit_Null) { - const nsCSSValue *val = ValueAtIndex(i); - // In order for variable resolution to have the right information - // about the stylesheet level of a value, that level needs to be - // stored on the token stream. We can't do that at creation time - // because the CSS parser (which creates the object) has no idea - // about the stylesheet level, so we do it here instead, where - // the rule walking will have just updated aRuleData. - if (val->GetUnit() == eCSSUnit_TokenStream) { - val->GetTokenStreamValue()->mLevel = aRuleData->mLevel; + if (target->GetUnit() == eCSSUnit_Revert) { + if (aRuleData->mLevel >= target->GetCascadeOriginValue()) { + continue; } - MapSinglePropertyInto(iProp, val, target, aRuleData); + } else if (target->GetUnit() != eCSSUnit_Null) { + continue; } + const nsCSSValue* val = ValueAtIndex(i); + // In order for variable resolution to have the right information + // about the stylesheet level of a value, that level needs to be + // stored on the token stream. We can't do that at creation time + // because the CSS parser (which creates the object) has no idea + // about the stylesheet level, so we do it here instead, where + // the rule walking will have just updated aRuleData. + if (val->GetUnit() == eCSSUnit_TokenStream) { + val->GetTokenStreamValue()->mLevel = aRuleData->mLevel; + } else if (val->GetUnit() == eCSSUnit_Revert) { + aRuleData->mConditions.SetUncacheable(); + } + MapSinglePropertyInto(iProp, val, target, aRuleData); } } } diff --git a/layout/style/nsCSSKeywordList.h b/layout/style/nsCSSKeywordList.h index 033ca5db17..d389f4fe35 100644 --- a/layout/style/nsCSSKeywordList.h +++ b/layout/style/nsCSSKeywordList.h @@ -474,6 +474,7 @@ CSS_KEY(repeat, repeat) CSS_KEY(repeat-x, repeat_x) CSS_KEY(repeat-y, repeat_y) CSS_KEY(reverse, reverse) +CSS_KEY(revert, revert) CSS_KEY(ridge, ridge) CSS_KEY(right, right) CSS_KEY(rl, rl) diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 64397ff8ff..e691006790 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -1170,8 +1170,9 @@ protected: nsString& aValue); /** - * Parses a CSS variable value. This could be 'initial', 'inherit', 'unset' - * or a token stream, which may or may not include variable references. + * Parses a CSS variable value. This could be 'initial', 'inherit', 'unset', + * 'revert', or a token stream, which may or may not include variable + * references. * * @param aType Out parameter into which the type of the variable value * will be stored. @@ -1525,6 +1526,9 @@ protected: // enum type be signed. css::SheetParsingMode mParsingMode : 3; + // Indicates the cascade origin of the sheet. + mozilla::SheetType mLevel; + // True if we are in parsing rules for the chrome. bool mIsChrome : 1; @@ -1656,6 +1660,7 @@ CSSParserImpl::CSSParserImpl() mHashlessColorQuirk(false), mUnitlessLengthQuirk(false), mParsingMode(css::eAuthorSheetFeatures), + mLevel(mozilla::SheetType::Doc), mIsChrome(false), mViewportUnitsEnabled(true), mHTMLMediaMode(false), @@ -1799,6 +1804,22 @@ CSSParserImpl::ParseSheet(const nsAString& aInput, } mParsingMode = mSheet->ParsingMode(); + switch (mParsingMode) { + case css::eAgentSheetFeatures: + mLevel = mozilla::SheetType::Agent; + break; + + case css::eUserSheetFeatures: + mLevel = mozilla::SheetType::User; + break; + + case css::eAuthorSheetFeatures: + mLevel = mozilla::SheetType::Doc; + break; + + default: + MOZ_CRASH("impossible value for aType"); + } mIsChrome = dom::IsChromeURI(aSheetURI); mReusableSheets = aReusableSheets; @@ -1824,6 +1845,7 @@ CSSParserImpl::ParseSheet(const nsAString& aInput, ReleaseScanner(); mParsingMode = css::eAuthorSheetFeatures; + mLevel = mozilla::SheetType::Doc; mIsChrome = false; mReusableSheets = nullptr; @@ -8185,6 +8207,10 @@ CSSParserImpl::ParseVariant(nsCSSValue& aValue, aValue.SetUnsetValue(); return CSSParseResult::Ok; } + else if (eCSSKeyword_revert == keyword) { + aValue.SetRevertValue(mLevel); + return CSSParseResult::Ok; + } } if ((aVariantMask & VARIANT_NONE) != 0) { if (eCSSKeyword_none == keyword) { @@ -8384,7 +8410,8 @@ CSSParserImpl::ParseVariant(nsCSSValue& aValue, !(tk->mIdent.LowerCaseEqualsLiteral("inherit") || tk->mIdent.LowerCaseEqualsLiteral("initial") || (tk->mIdent.LowerCaseEqualsLiteral("unset") && - nsLayoutUtils::UnsetValueEnabled())))) { + nsLayoutUtils::UnsetValueEnabled()) || + tk->mIdent.LowerCaseEqualsLiteral("revert")))) { aValue.SetStringValue(tk->mIdent, eCSSUnit_Ident); return CSSParseResult::Ok; } @@ -8454,6 +8481,7 @@ CSSParserImpl::ParseCustomIdent(nsCSSValue& aValue, if (keyword == eCSSKeyword_inherit || keyword == eCSSKeyword_initial || keyword == eCSSKeyword_unset || + keyword == eCSSKeyword_revert || keyword == eCSSKeyword_default || (aPropertyKTable && nsCSSProps::FindIndexOfKeyword(keyword, aPropertyKTable) >= 0)) { @@ -8675,7 +8703,7 @@ bool CSSParserImpl::ParseImageOrientation(nsCSSValue& aValue) { if (ParseSingleTokenVariant(aValue, VARIANT_INHERIT, nullptr)) { - // 'inherit', 'initial' and 'unset' must be alone + // 'inherit', 'initial', 'unset', and 'revert' must be alone return true; } @@ -8789,7 +8817,7 @@ CSSParserImpl::ParseElement(nsCSSValue& aValue) bool CSSParserImpl::ParseFlex() { - // First check for inherit / initial / unset + // First check for inherit / initial / unset / revert nsCSSValue tmpVal; if (ParseSingleTokenVariant(tmpVal, VARIANT_INHERIT, nullptr)) { AppendValue(eCSSProperty_flex_grow, tmpVal); @@ -10297,7 +10325,8 @@ bool CSSParserImpl::ParseInitialLetter() { nsCSSValue value; - // 'inherit', 'initial', 'unset', 'none', and 'normal' must be alone + // 'inherit', 'initial', 'unset', 'revert', 'none', and 'normal' + // must be alone if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NORMAL, nullptr)) { nsCSSValue first, second; @@ -11551,8 +11580,14 @@ CSSParserImpl::ParseChoice(nsCSSValue aValues[], } found = ((1 << aNumIDs) - 1); } + else if (eCSSUnit_Revert == aValues[0].GetUnit()) { // one revert, all revert + for (loop = 1; loop < aNumIDs; loop++) { + aValues[loop].SetRevertValue(mLevel); + } + found = ((1 << aNumIDs) - 1); + } } - else { // more than one value, verify no inherits, initials or unsets + else { // more than one value, verify no inherits, initials, unsets, or reverts for (loop = 0; loop < aNumIDs; loop++) { if (eCSSUnit_Inherit == aValues[loop].GetUnit()) { found = -1; @@ -11566,6 +11601,10 @@ CSSParserImpl::ParseChoice(nsCSSValue aValues[], found = -1; break; } + else if (eCSSUnit_Revert == aValues[loop].GetUnit()) { + found = -1; + break; + } } } } @@ -11604,12 +11643,13 @@ CSSParserImpl::ParseBoxProperties(const nsCSSPropertyID aPropIDs[]) return false; } - if (1 < count) { // verify no more than single inherit, initial or unset + if (1 < count) { // verify no more than single inherit, initial, unset, or revert NS_FOR_CSS_SIDES (index) { nsCSSUnit unit = (result.*(nsCSSRect::sides[index])).GetUnit(); if (eCSSUnit_Inherit == unit || eCSSUnit_Initial == unit || - eCSSUnit_Unset == unit) { + eCSSUnit_Unset == unit || + eCSSUnit_Revert == unit) { return false; } } @@ -11713,10 +11753,11 @@ CSSParserImpl::ParseBoxCornerRadius(nsCSSPropertyID aPropID) return false; } - // optional second value (forbidden if first value is inherit/initial/unset) + // optional second value (forbidden if first value is inherit/initial/unset/revert) if (dimenX.GetUnit() != eCSSUnit_Inherit && dimenX.GetUnit() != eCSSUnit_Initial && - dimenX.GetUnit() != eCSSUnit_Unset) { + dimenX.GetUnit() != eCSSUnit_Unset && + dimenX.GetUnit() != eCSSUnit_Revert) { if (ParseNonNegativeVariant(dimenY, VARIANT_LP | VARIANT_CALC, nullptr) == CSSParseResult::Error) { return false; @@ -11774,12 +11815,14 @@ CSSParserImpl::ParseBoxCornerRadiiInternals(nsCSSValue array[]) return false; } - // if 'initial', 'inherit' or 'unset' was used, it must be the only value + // if 'initial', 'inherit', 'unset', or 'revert' was used, it + // must be the only value if (countX > 1 || countY > 0) { nsCSSUnit unit = dimenX.mTop.GetUnit(); if (eCSSUnit_Inherit == unit || eCSSUnit_Initial == unit || - eCSSUnit_Unset == unit) + eCSSUnit_Unset == unit || + eCSSUnit_Revert == unit) return false; } @@ -12526,6 +12569,7 @@ CSSParserImpl::ParseFontDescriptorValue(nsCSSFontDesc aDescID, aValue.GetUnit() != eCSSUnit_Inherit && aValue.GetUnit() != eCSSUnit_Initial && aValue.GetUnit() != eCSSUnit_Unset && + aValue.GetUnit() != eCSSUnit_Revert && (aValue.GetUnit() != eCSSUnit_Enumerated || (aValue.GetIntValue() != NS_STYLE_FONT_WEIGHT_BOLDER && aValue.GetIntValue() != NS_STYLE_FONT_WEIGHT_LIGHTER))); @@ -12590,7 +12634,7 @@ CSSParserImpl::ParseImageLayers(const nsCSSPropertyID aTable[]) // background-color can only be set once, so it's not a list. nsCSSValue color; - // Check first for inherit/initial/unset. + // Check first for inherit/initial/unset/revert. if (ParseSingleTokenVariant(color, VARIANT_INHERIT, nullptr)) { // must be alone for (const nsCSSPropertyID* subprops = @@ -12787,7 +12831,8 @@ CSSParserImpl::ParseImageLayersItem( int32_t dummy; if (keyword == eCSSKeyword_inherit || keyword == eCSSKeyword_initial || - keyword == eCSSKeyword_unset) { + keyword == eCSSKeyword_unset || + keyword == eCSSKeyword_revert) { return false; } else if (keyword == eCSSKeyword_none) { if (haveImage) @@ -12950,7 +12995,7 @@ CSSParserImpl::ParseImageLayersItem( if (haveColor) return false; haveColor = true; - // Note: This parses 'inherit', 'initial' and 'unset', but + // Note: This parses 'inherit', 'initial', 'unset', and 'revert', but // we've already checked for them, so it's ok. if (ParseSingleValueProperty(aState.mColor, aTable[nsStyleImageLayers::color]) != @@ -12974,7 +13019,7 @@ CSSParserImpl::ParseValueList(nsCSSPropertyID aPropID) { // aPropID is a single value prop-id nsCSSValue value; - // 'initial', 'inherit' and 'unset' stand alone, no list permitted. + // 'initial', 'inherit', 'unset', and 'revert' stand alone, no list permitted. if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) { nsCSSValueList* item = value.SetListValue(); for (;;) { @@ -12997,7 +13042,7 @@ bool CSSParserImpl::ParseImageLayerRepeat(nsCSSPropertyID aPropID) { nsCSSValue value; - // 'initial', 'inherit' and 'unset' stand alone, no list permitted. + // 'initial', 'inherit', 'unset', and 'revert' stand alone, no list permitted. if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) { nsCSSValuePair valuePair; if (!ParseImageLayerRepeatValues(valuePair)) { @@ -13047,7 +13092,7 @@ CSSParserImpl::ParseImageLayerRepeatValues(nsCSSValuePair& aValue) bool CSSParserImpl::ParseImageLayerPosition(const nsCSSPropertyID aTable[]) { - // 'initial', 'inherit' and 'unset' stand alone, no list permitted. + // 'initial', 'inherit', 'unset', and 'revert' stand alone, no list permitted. nsCSSValue position; if (ParseSingleTokenVariant(position, VARIANT_INHERIT, nullptr)) { AppendValue(aTable[nsStyleImageLayers::positionX], position); @@ -13088,7 +13133,7 @@ bool CSSParserImpl::ParseImageLayerPositionCoord(nsCSSPropertyID aPropID, bool aIsHorizontal) { nsCSSValue value; - // 'initial', 'inherit' and 'unset' stand alone, no list permitted. + // 'initial', 'inherit', 'unset', and 'revert' stand alone, no list permitted. if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) { nsCSSValue itemValue; if (!ParseImageLayerPositionCoordItem(itemValue, aIsHorizontal)) { @@ -13123,8 +13168,8 @@ CSSParserImpl::ParseImageLayerPositionCoord(nsCSSPropertyID aPropID, bool aIsHor * like "top," "left center," etc. * * @param aOut The nsCSSValuePair in which to place the result. - * @param aAcceptsInherit If true, 'inherit', 'initial' and 'unset' are - * legal values + * @param aAcceptsInherit If true, 'inherit', 'initial', 'unset', and 'revert' + * are legal values * @param aAllowExplicitCenter If true, 'center' is a legal value * @return Whether or not the operation succeeded. */ @@ -13143,7 +13188,8 @@ bool CSSParserImpl::ParseBoxPositionValues(nsCSSValuePair &aOut, } else if (result == CSSParseResult::Ok) { if (eCSSUnit_Inherit == xValue.GetUnit() || eCSSUnit_Initial == xValue.GetUnit() || - eCSSUnit_Unset == xValue.GetUnit()) { // both are inherit, initial or unset + eCSSUnit_Unset == xValue.GetUnit() || + eCSSUnit_Revert == xValue.GetUnit()) { // both are inherit, initial, unset, or revert yValue = xValue; return true; } @@ -13557,7 +13603,7 @@ bool CSSParserImpl::ParseImageLayerSize(nsCSSPropertyID aPropID) { nsCSSValue value; - // 'initial', 'inherit' and 'unset' stand alone, no list permitted. + // 'initial', 'inherit', 'unset', and 'revert' stand alone, no list permitted. if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) { nsCSSValuePair valuePair; if (!ParseImageLayerSizeValues(valuePair)) { @@ -13585,8 +13631,8 @@ CSSParserImpl::ParseImageLayerSize(nsCSSPropertyID aPropID) * Parses two values that correspond to lengths for the background-size * property. These can be one or two lengths (or the 'auto' keyword) or * percentages corresponding to the element's dimensions or the single keywords - * 'contain' or 'cover'. 'initial', 'inherit' and 'unset' must be handled by - * the caller if desired. + * 'contain' or 'cover'. 'initial', 'inherit', 'unset', and 'revert' must be + * handled by the caller if desired. * * @param aOut The nsCSSValuePair in which to place the result. * @return Whether or not the operation succeeded. @@ -13684,8 +13730,8 @@ CSSParserImpl::ParseBorderImageSlice(bool aAcceptsInherit, if (aAcceptsInherit && ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) { - // Keywords "inherit", "initial" and "unset" can not be mixed, so we - // are done. + // Keywords "inherit", "initial", "unset", and "revert" can not be + // mixed, so we are done. AppendValue(eCSSProperty_border_image_slice, value); return true; } @@ -13735,8 +13781,8 @@ CSSParserImpl::ParseBorderImageWidth(bool aAcceptsInherit) if (aAcceptsInherit && ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) { - // Keywords "inherit", "initial" and "unset" can not be mixed, so we - // are done. + // Keywords "inherit", "initial", "unset", and "revert" can not be + // mixed, so we are done. AppendValue(eCSSProperty_border_image_width, value); return true; } @@ -13758,8 +13804,8 @@ CSSParserImpl::ParseBorderImageOutset(bool aAcceptsInherit) if (aAcceptsInherit && ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) { - // Keywords "inherit", "initial" and "unset" can not be mixed, so we - // are done. + // Keywords "inherit", "initial", "unset", and "revert" can not be + // mixed, so we are done. AppendValue(eCSSProperty_border_image_outset, value); return true; } @@ -13779,8 +13825,8 @@ CSSParserImpl::ParseBorderImageRepeat(bool aAcceptsInherit) nsCSSValue value; if (aAcceptsInherit && ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) { - // Keywords "inherit", "initial" and "unset" can not be mixed, so we - // are done. + // Keywords "inherit", "initial", "unset", and "revert" can not be + // mixed, so we are done. AppendValue(eCSSProperty_border_image_repeat, value); return true; } @@ -13819,7 +13865,8 @@ CSSParserImpl::ParseBorderImage() AppendValue(eCSSProperty_border_image_width, value); AppendValue(eCSSProperty_border_image_outset, value); AppendValue(eCSSProperty_border_image_repeat, value); - // Keywords "inherit", "initial" and "unset" can't be mixed, so we are done. + // Keywords "inherit", "initial", "unset", and "revert" can not be + // mixed, so we are done. return true; } @@ -13973,8 +14020,9 @@ CSSParserImpl::ParseBorderSide(const nsCSSPropertyID aPropIDs[], case eCSSUnit_Inherit: case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: extraValue = values[0]; - // Set value of border-image properties to initial/inherit/unset + // Set value of border-image properties to initial/inherit/unset/revert AppendValue(eCSSProperty_border_image_source, extraValue); AppendValue(eCSSProperty_border_image_slice, extraValue); AppendValue(eCSSProperty_border_image_width, extraValue); @@ -14015,7 +14063,8 @@ bool CSSParserImpl::ParseBorderColors(nsCSSPropertyID aProperty) { nsCSSValue value; - // 'inherit', 'initial', 'unset' and 'none' are only allowed on their own + // 'inherit', 'initial', 'unset', 'revert', and 'none' are only allowed + // on their own if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE, nullptr)) { nsCSSValueList *cur = value.SetListValue(); @@ -14402,8 +14451,8 @@ CSSParserImpl::ParseContent() "content keyword tables out of sync"); nsCSSValue value; - // 'inherit', 'initial', 'unset', 'normal', 'none', and 'alt-content' must - // be alone + // 'inherit', 'initial', 'unset', 'revert', 'normal', 'none', and + // 'alt-content' must be alone if (!ParseSingleTokenVariant(value, VARIANT_HMK | VARIANT_NONE, kContentSolitaryKWs)) { nsCSSValueList* cur = value.SetListValue(); @@ -14473,7 +14522,7 @@ bool CSSParserImpl::ParseCursor() { nsCSSValue value; - // 'inherit', 'initial' and 'unset' must be alone + // 'inherit', 'initial', 'unset', and 'revert' must be alone if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr)) { nsCSSValueList* cur = value.SetListValue(); for (;;) { @@ -14517,7 +14566,8 @@ CSSParserImpl::ParseFont() if (ParseSingleTokenVariant(family, VARIANT_HK, nsCSSProps::kFontKTable)) { if (eCSSUnit_Inherit == family.GetUnit() || eCSSUnit_Initial == family.GetUnit() || - eCSSUnit_Unset == family.GetUnit()) { + eCSSUnit_Unset == family.GetUnit() || + eCSSUnit_Revert == family.GetUnit()) { AppendValue(eCSSProperty__x_system_font, nsCSSValue(eCSSUnit_None)); AppendValue(eCSSProperty_font_family, family); AppendValue(eCSSProperty_font_style, family); @@ -14585,7 +14635,8 @@ CSSParserImpl::ParseFont() if (found < 0 || eCSSUnit_Inherit == values[kFontStyleIndex].GetUnit() || eCSSUnit_Initial == values[kFontStyleIndex].GetUnit() || - eCSSUnit_Unset == values[kFontStyleIndex].GetUnit()) { // illegal data + eCSSUnit_Unset == values[kFontStyleIndex].GetUnit() || + eCSSUnit_Revert == values[kFontStyleIndex].GetUnit() ) { // illegal data return false; } if ((found & (1 << kFontStyleIndex)) == 0) { @@ -14643,7 +14694,8 @@ CSSParserImpl::ParseFont() if (ParseFamily(family)) { if (eCSSUnit_Inherit != family.GetUnit() && eCSSUnit_Initial != family.GetUnit() && - eCSSUnit_Unset != family.GetUnit()) { + eCSSUnit_Unset != family.GetUnit() && + eCSSUnit_Revert != family.GetUnit()) { AppendValue(eCSSProperty__x_system_font, nsCSSValue(eCSSUnit_None)); AppendValue(eCSSProperty_font_family, family); AppendValue(eCSSProperty_font_style, values[kFontStyleIndex]); @@ -14688,7 +14740,8 @@ CSSParserImpl::ParseFontSynthesis(nsCSSValue& aValue) if (eCSSUnit_None == aValue.GetUnit() || eCSSUnit_Initial == aValue.GetUnit() || eCSSUnit_Inherit == aValue.GetUnit() || - eCSSUnit_Unset == aValue.GetUnit()) + eCSSUnit_Unset == aValue.GetUnit() || + eCSSUnit_Revert == aValue.GetUnit() ) { return true; } @@ -15308,6 +15361,9 @@ CSSParserImpl::ParseFamily(nsCSSValue& aValue) return true; } break; + case eCSSKeyword_revert: + aValue.SetRevertValue(mLevel); + return true; case eCSSKeyword__moz_use_system_font: if (!IsParsingCompoundProperty()) { aValue.SetSystemFontValue(); @@ -15341,6 +15397,7 @@ CSSParserImpl::ParseFamily(nsCSSValue& aValue) case eCSSKeyword_inherit: case eCSSKeyword_initial: case eCSSKeyword_default: + case eCSSKeyword_revert: case eCSSKeyword__moz_use_system_font: return false; case eCSSKeyword_unset: @@ -15790,25 +15847,41 @@ CSSParserImpl::ParseOutline() bool CSSParserImpl::ParseOverflow() { - nsCSSValue overflow; - if (!ParseSingleTokenVariant(overflow, VARIANT_HK, - nsCSSProps::kOverflowKTable)) { + nsCSSValue overflowX, overflowY; + // Parse the first value + if (!ParseSingleTokenVariant(overflowX, VARIANT_HK, nsCSSProps::kOverflowKTable)) { return false; } - nsCSSValue overflowX(overflow); - nsCSSValue overflowY(overflow); - if (eCSSUnit_Enumerated == overflow.GetUnit()) - switch(overflow.GetIntValue()) { - case NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL: - overflowX.SetIntValue(NS_STYLE_OVERFLOW_SCROLL, eCSSUnit_Enumerated); - overflowY.SetIntValue(NS_STYLE_OVERFLOW_HIDDEN, eCSSUnit_Enumerated); - break; - case NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL: - overflowX.SetIntValue(NS_STYLE_OVERFLOW_HIDDEN, eCSSUnit_Enumerated); - overflowY.SetIntValue(NS_STYLE_OVERFLOW_SCROLL, eCSSUnit_Enumerated); - break; + // Try to parse a second value (optional) + bool haveSecond = ParseSingleTokenVariant(overflowY, VARIANT_HK, nsCSSProps::kOverflowKTable); + if (!haveSecond) { + overflowY = overflowX; + } + + // Handle legacy scrollbars keywords for each axis + auto fix_legacy = [](nsCSSValue& v, bool isX) { + if (v.GetUnit() == eCSSUnit_Enumerated) { + switch (v.GetIntValue()) { + case NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL: + if (isX) { + v.SetIntValue(NS_STYLE_OVERFLOW_SCROLL, eCSSUnit_Enumerated); + } else { + v.SetIntValue(NS_STYLE_OVERFLOW_HIDDEN, eCSSUnit_Enumerated); + } + break; + case NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL: + if (isX) { + v.SetIntValue(NS_STYLE_OVERFLOW_HIDDEN, eCSSUnit_Enumerated); + } else { + v.SetIntValue(NS_STYLE_OVERFLOW_SCROLL, eCSSUnit_Enumerated); + } + break; + } } + }; + fix_legacy(overflowX, true); + fix_legacy(overflowY, false); AppendValue(eCSSProperty_overflow_x, overflowX); AppendValue(eCSSProperty_overflow_y, overflowY); return true; @@ -16013,7 +16086,7 @@ bool CSSParserImpl::ParseTextAlign(nsCSSValue& aValue, const KTableEntry aTable[]) { if (ParseSingleTokenVariant(aValue, VARIANT_INHERIT, nullptr)) { - // 'inherit', 'initial' and 'unset' must be alone + // 'inherit', 'initial', 'unset', and 'revert' must be alone return true; } @@ -16108,7 +16181,7 @@ bool CSSParserImpl::ParseTextOverflow(nsCSSValue& aValue) { if (ParseSingleTokenVariant(aValue, VARIANT_INHERIT, nullptr)) { - // 'inherit', 'initial' and 'unset' must be alone + // 'inherit', 'initial', 'unset', and 'revert' must be alone return true; } @@ -16139,7 +16212,7 @@ CSSParserImpl::ParseTouchAction(nsCSSValue& aValue) } // Auto and None keywords aren't allowed in conjunction with others. - // Also inherit, initial and unset values are available. + // Also inherit, initial, unset, and revert values are available. if (eCSSUnit_Enumerated != aValue.GetUnit()) { return true; } @@ -16644,7 +16717,7 @@ bool CSSParserImpl::ParseTransform(bool aIsPrefixed, bool aDisallowRelativeValues) { nsCSSValue value; - // 'inherit', 'initial', 'unset' and 'none' must be alone + // 'inherit', 'initial', 'unset', 'revert', and 'none' must be alone if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE, nullptr)) { nsCSSValueSharedList* list = new nsCSSValueSharedList; @@ -16930,7 +17003,8 @@ bool CSSParserImpl::ParseShapeOutside(nsCSSValue& aValue) { if (ParseSingleTokenVariant(aValue, VARIANT_HUO, nullptr)) { - // 'inherit', 'initial', 'unset', 'none', and url must be alone. + // 'inherit', 'initial', 'unset', 'revert', 'none', and + // url must be alone. return true; } @@ -16954,9 +17028,10 @@ bool CSSParserImpl::ParseTransformOrigin(bool aPerspective) // a pair, and to keep the computation code simple. if (position.mXValue.GetUnit() == eCSSUnit_Inherit || position.mXValue.GetUnit() == eCSSUnit_Initial || - position.mXValue.GetUnit() == eCSSUnit_Unset) { + position.mXValue.GetUnit() == eCSSUnit_Unset || + position.mXValue.GetUnit() == eCSSUnit_Revert) { MOZ_ASSERT(position.mXValue == position.mYValue, - "inherit/initial/unset only half?"); + "inherit/initial/unset/revert only half?"); AppendValue(prop, position.mXValue); } else { nsCSSValue value; @@ -17133,7 +17208,7 @@ bool CSSParserImpl::ParseFilter() { nsCSSValue value; - // 'inherit', 'initial', 'unset' and 'none' must be alone + // 'inherit', 'initial', 'unset', 'revert', and 'none' must be alone if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE, nullptr)) { nsCSSValueList* cur = value.SetListValue(); @@ -17162,7 +17237,7 @@ bool CSSParserImpl::ParseTransitionProperty() { nsCSSValue value; - // 'inherit', 'initial', 'unset' and 'none' must be alone + // 'inherit', 'initial', 'unset', 'revert', and 'none' must be alone if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE, nullptr)) { // Accept a list of arbitrary identifiers. They should be @@ -17178,13 +17253,14 @@ CSSParserImpl::ParseTransitionProperty() } if (cur->mValue.GetUnit() == eCSSUnit_Ident) { nsDependentString str(cur->mValue.GetStringBufferValue()); - // Exclude 'none', 'inherit', 'initial' and 'unset' according to the - // same rules as for 'counter-reset' in CSS 2.1. + // Exclude 'none', 'inherit', 'initial', 'unset', and 'revert' + // according to the same rules as for 'counter-reset' in CSS 2.1. if (str.LowerCaseEqualsLiteral("none") || str.LowerCaseEqualsLiteral("inherit") || str.LowerCaseEqualsLiteral("initial") || (str.LowerCaseEqualsLiteral("unset") && - nsLayoutUtils::UnsetValueEnabled())) { + nsLayoutUtils::UnsetValueEnabled()) || + str.LowerCaseEqualsLiteral("revert")) { return false; } } @@ -17325,9 +17401,9 @@ CSSParserImpl::ParseAnimationOrTransitionShorthand( size_t aNumProperties) { nsCSSValue tempValue; - // first see if 'inherit', 'initial' or 'unset' is specified. If one is, - // it can be the only thing specified, so don't attempt to parse any - // additional properties + // first see if 'inherit', 'initial', 'unset', or 'revert' is specified. + // If one is, it can be the only thing specified, so don't attempt to + // parse any additional properties if (ParseSingleTokenVariant(tempValue, VARIANT_INHERIT, nullptr)) { for (uint32_t i = 0; i < aNumProperties; ++i) { AppendValue(aProperties[i], tempValue); @@ -17452,7 +17528,7 @@ CSSParserImpl::ParseTransition() // Make two checks on the list for 'transition-property': // + If there is more than one item, then none of the items can be // 'none'. - // + None of the items can be 'inherit', 'initial' or 'unset'. + // + None of the items can be 'inherit', 'initial', 'unset', or 'revert'. { MOZ_ASSERT(kTransitionProperties[3] == eCSSProperty_transition_property, "array index mismatch"); @@ -17475,7 +17551,8 @@ CSSParserImpl::ParseTransition() if (str.EqualsLiteral("inherit") || str.EqualsLiteral("initial") || (str.EqualsLiteral("unset") && - nsLayoutUtils::UnsetValueEnabled())) { + nsLayoutUtils::UnsetValueEnabled()) || + str.EqualsLiteral("revert")) { return false; } } @@ -17644,7 +17721,7 @@ CSSParserImpl::ParseShadowList(nsCSSPropertyID aProperty) bool isBoxShadow = aProperty == eCSSProperty_box_shadow; nsCSSValue value; - // 'inherit', 'initial', 'unset' and 'none' must be alone + // 'inherit', 'initial', 'unset', 'revert', and 'none' must be alone if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE, nullptr)) { nsCSSValueList* cur = value.SetListValue(); @@ -17731,7 +17808,8 @@ CSSParserImpl::ParseDasharray() { nsCSSValue value; - // 'inherit', 'initial', 'unset' and 'none' are only allowed on their own + // 'inherit', 'initial', 'unset', 'revert' and 'none' are only allowed + // on their own if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE | VARIANT_OPENTYPE_SVG_KEYWORD, nsCSSProps::kStrokeContextValueKTable)) { @@ -18095,8 +18173,8 @@ CSSParserImpl::ParseValueWithVariables(CSSVariableDeclarations::Type* aType, } } - // Look for 'initial', 'inherit' or 'unset' as the first non-white space - // token. + // Look for 'initial', 'inherit', 'unset', or 'revert' as the first + // non-white space token. CSSVariableDeclarations::Type type = CSSVariableDeclarations::eTokenStream; if (mToken.mType == eCSSToken_Ident) { if (mToken.mIdent.LowerCaseEqualsLiteral("initial")) { @@ -18105,6 +18183,8 @@ CSSParserImpl::ParseValueWithVariables(CSSVariableDeclarations::Type* aType, type = CSSVariableDeclarations::eInherit; } else if (mToken.mIdent.LowerCaseEqualsLiteral("unset")) { type = CSSVariableDeclarations::eUnset; + } else if (mToken.mIdent.LowerCaseEqualsLiteral("revert")) { + type = CSSVariableDeclarations::eRevert; } } diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h index d8920a1c75..f66b194eda 100644 --- a/layout/style/nsCSSPropList.h +++ b/layout/style/nsCSSPropList.h @@ -4391,9 +4391,9 @@ CSS_PROP_USERINTERFACE( CSS_PROP_NO_OFFSET, eStyleAnimType_Discrete) // XXX bug 3935 CSS_PROP_UIRESET( - -moz-user-select, + user-select, user_select, - CSS_PROP_DOMPROP_PREFIXED(UserSelect), + UserSelect, CSS_PROPERTY_PARSE_VALUE, "", VARIANT_HK, diff --git a/layout/style/nsCSSPropLogicalGroupList.h b/layout/style/nsCSSPropLogicalGroupList.h index 3d8a52bc90..81dbee641d 100644 --- a/layout/style/nsCSSPropLogicalGroupList.h +++ b/layout/style/nsCSSPropLogicalGroupList.h @@ -54,3 +54,4 @@ CSS_PROP_LOGICAL_GROUP_BOX(Offset) CSS_PROP_LOGICAL_GROUP_SHORTHAND(Padding) CSS_PROP_LOGICAL_GROUP_AXIS(MinSize) CSS_PROP_LOGICAL_GROUP_AXIS(Size) +CSS_PROP_LOGICAL_GROUP_AXIS(Overflow) \ No newline at end of file diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index 73a8d5dd29..3b4eeac49f 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -2216,6 +2216,7 @@ const KTableEntry nsCSSProps::kUserSelectKTable[] = { { eCSSKeyword_auto, StyleUserSelect::Auto }, { eCSSKeyword_text, StyleUserSelect::Text }, { eCSSKeyword_element, StyleUserSelect::Element }, + { eCSSKeyword_contain, StyleUserSelect::Contain }, { eCSSKeyword_elements, StyleUserSelect::Elements }, { eCSSKeyword_all, StyleUserSelect::All }, { eCSSKeyword_toggle, StyleUserSelect::Toggle }, @@ -3180,6 +3181,13 @@ static const nsCSSPropertyID gSizeLogicalGroupTable[] = { eCSSProperty_UNKNOWN }; + +static const nsCSSPropertyID gOverflowLogicalGroupTable[] = { + eCSSProperty_overflow_y, + eCSSProperty_overflow_x, + eCSSProperty_UNKNOWN +}; + const nsCSSPropertyID* const nsCSSProps::kLogicalGroupTable[eCSSPropertyLogicalGroup_COUNT] = { #define CSS_PROP_LOGICAL_GROUP_SHORTHAND(id_) g##id_##SubpropTable, diff --git a/layout/style/nsCSSProps.h b/layout/style/nsCSSProps.h index 567f7f7bfa..0995fba61b 100644 --- a/layout/style/nsCSSProps.h +++ b/layout/style/nsCSSProps.h @@ -44,7 +44,7 @@ // 'inherit' and 'initial' #define VARIANT_OPACITY 0x008000 // Take floats and percents as input, output float. #define VARIANT_AUTO 0x010000 // A -#define VARIANT_INHERIT 0x020000 // H eCSSUnit_Initial, eCSSUnit_Inherit, eCSSUnit_Unset +#define VARIANT_INHERIT 0x020000 // H eCSSUnit_Initial, eCSSUnit_Inherit, eCSSUnit_Unset, eCSSUnit_Revert #define VARIANT_NONE 0x040000 // O #define VARIANT_NORMAL 0x080000 // M #define VARIANT_SYSFONT 0x100000 // eCSSUnit_System_Font diff --git a/layout/style/nsCSSValue.cpp b/layout/style/nsCSSValue.cpp index 6553ebaf33..24e804d800 100644 --- a/layout/style/nsCSSValue.cpp +++ b/layout/style/nsCSSValue.cpp @@ -166,6 +166,9 @@ nsCSSValue::nsCSSValue(const nsCSSValue& aCopy) mValue.mComplexColor = aCopy.mValue.mComplexColor; mValue.mComplexColor->AddRef(); } + else if (eCSSUnit_Revert == mUnit) { + mValue.mCascadeOrigin = aCopy.mValue.mCascadeOrigin; + } else if (UnitHasArrayValue()) { mValue.mArray = aCopy.mValue.mArray; mValue.mArray->AddRef(); @@ -279,6 +282,9 @@ bool nsCSSValue::operator==(const nsCSSValue& aOther) const else if (eCSSUnit_ComplexColor == mUnit) { return *mValue.mComplexColor == *aOther.mValue.mComplexColor; } + else if (eCSSUnit_Revert == mUnit) { + return mValue.mCascadeOrigin == aOther.mValue.mCascadeOrigin; + } else if (UnitHasArrayValue()) { return *mValue.mArray == *aOther.mValue.mArray; } @@ -539,6 +545,15 @@ nsCSSValue::SetComplexColorValue(already_AddRefed aValue) mValue.mComplexColor = aValue.take(); } +void +nsCSSValue::SetCascadeOriginValue(mozilla::SheetType aValue, nsCSSUnit aUnit) +{ + MOZ_ASSERT(aUnit == eCSSUnit_Revert, "bad unit"); + Reset(); + mUnit = aUnit; + mValue.mCascadeOrigin = aValue; +} + void nsCSSValue::SetArrayValue(nsCSSValue::Array* aValue, nsCSSUnit aUnit) { Reset(); @@ -598,7 +613,7 @@ void nsCSSValue::SetFontFamilyListValue(css::FontFamilyListRefCnt* aValue) void nsCSSValue::SetPairValue(const nsCSSValuePair* aValue) { - // pairs should not be used for null/inherit/initial values + // pairs should not be used for null/inherit/initial/unset/revert values MOZ_ASSERT(aValue && aValue->mXValue.GetUnit() != eCSSUnit_Null && aValue->mYValue.GetUnit() != eCSSUnit_Null && @@ -607,7 +622,9 @@ void nsCSSValue::SetPairValue(const nsCSSValuePair* aValue) aValue->mXValue.GetUnit() != eCSSUnit_Initial && aValue->mYValue.GetUnit() != eCSSUnit_Initial && aValue->mXValue.GetUnit() != eCSSUnit_Unset && - aValue->mYValue.GetUnit() != eCSSUnit_Unset, + aValue->mYValue.GetUnit() != eCSSUnit_Unset && + aValue->mXValue.GetUnit() != eCSSUnit_Revert && + aValue->mYValue.GetUnit() != eCSSUnit_Revert, "missing or inappropriate pair value"); Reset(); mUnit = eCSSUnit_Pair; @@ -625,7 +642,9 @@ void nsCSSValue::SetPairValue(const nsCSSValue& xValue, xValue.GetUnit() != eCSSUnit_Initial && yValue.GetUnit() != eCSSUnit_Initial && xValue.GetUnit() != eCSSUnit_Unset && - yValue.GetUnit() != eCSSUnit_Unset, + yValue.GetUnit() != eCSSUnit_Unset && + xValue.GetUnit() != eCSSUnit_Revert && + yValue.GetUnit() != eCSSUnit_Revert, "inappropriate pair value"); Reset(); mUnit = eCSSUnit_Pair; @@ -635,7 +654,7 @@ void nsCSSValue::SetPairValue(const nsCSSValue& xValue, void nsCSSValue::SetTripletValue(const nsCSSValueTriplet* aValue) { - // triplet should not be used for null/inherit/initial values + // triplet should not be used for null/inherit/initial/unset/revert values MOZ_ASSERT(aValue && aValue->mXValue.GetUnit() != eCSSUnit_Null && aValue->mYValue.GetUnit() != eCSSUnit_Null && @@ -648,7 +667,10 @@ void nsCSSValue::SetTripletValue(const nsCSSValueTriplet* aValue) aValue->mZValue.GetUnit() != eCSSUnit_Initial && aValue->mXValue.GetUnit() != eCSSUnit_Unset && aValue->mYValue.GetUnit() != eCSSUnit_Unset && - aValue->mZValue.GetUnit() != eCSSUnit_Unset, + aValue->mZValue.GetUnit() != eCSSUnit_Unset && + aValue->mXValue.GetUnit() != eCSSUnit_Revert && + aValue->mYValue.GetUnit() != eCSSUnit_Revert && + aValue->mZValue.GetUnit() != eCSSUnit_Revert, "missing or inappropriate triplet value"); Reset(); mUnit = eCSSUnit_Triplet; @@ -671,7 +693,10 @@ void nsCSSValue::SetTripletValue(const nsCSSValue& xValue, zValue.GetUnit() != eCSSUnit_Initial && xValue.GetUnit() != eCSSUnit_Unset && yValue.GetUnit() != eCSSUnit_Unset && - zValue.GetUnit() != eCSSUnit_Unset, + zValue.GetUnit() != eCSSUnit_Unset && + xValue.GetUnit() != eCSSUnit_Revert && + yValue.GetUnit() != eCSSUnit_Revert && + zValue.GetUnit() != eCSSUnit_Revert, "inappropriate triplet value"); Reset(); mUnit = eCSSUnit_Triplet; @@ -781,6 +806,12 @@ void nsCSSValue::SetUnsetValue() mUnit = eCSSUnit_Unset; } +void +nsCSSValue::SetRevertValue(mozilla::SheetType aValue) +{ + SetCascadeOriginValue(aValue, eCSSUnit_Revert); +} + void nsCSSValue::SetNoneValue() { Reset(); @@ -1930,6 +1961,7 @@ nsCSSValue::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult, case eCSSUnit_Inherit: aResult.AppendLiteral("inherit"); break; case eCSSUnit_Initial: aResult.AppendLiteral("initial"); break; case eCSSUnit_Unset: aResult.AppendLiteral("unset"); break; + case eCSSUnit_Revert: aResult.AppendLiteral("revert"); break; case eCSSUnit_None: aResult.AppendLiteral("none"); break; case eCSSUnit_Normal: aResult.AppendLiteral("normal"); break; case eCSSUnit_System_Font: aResult.AppendLiteral("-moz-use-system-font"); break; @@ -2189,6 +2221,10 @@ nsCSSValue::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const n += mValue.mComplexColor->SizeOfIncludingThis(aMallocSizeOf); break; + // Cascade Origin: nothing extra to measure. + case eCSSUnit_Revert: + break; + // Float: nothing extra to measure. case eCSSUnit_Percent: case eCSSUnit_Number: @@ -2511,7 +2547,8 @@ nsCSSRect::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult, MOZ_ASSERT(mTop.GetUnit() != eCSSUnit_Null && mTop.GetUnit() != eCSSUnit_Inherit && mTop.GetUnit() != eCSSUnit_Initial && - mTop.GetUnit() != eCSSUnit_Unset, + mTop.GetUnit() != eCSSUnit_Unset && + mTop.GetUnit() != eCSSUnit_Revert, "parser should have used a bare value"); if (eCSSProperty_border_image_slice == aProperty || @@ -2681,6 +2718,7 @@ nsCSSValuePairList::AppendToString(nsCSSPropertyID aProperty, if (item->mXValue.GetUnit() != eCSSUnit_Inherit && item->mXValue.GetUnit() != eCSSUnit_Initial && item->mXValue.GetUnit() != eCSSUnit_Unset && + item->mXValue.GetUnit() != eCSSUnit_Revert && item->mYValue.GetUnit() != eCSSUnit_Null) { aResult.Append(char16_t(' ')); item->mYValue.AppendToString(aProperty, aResult, aSerialization); diff --git a/layout/style/nsCSSValue.h b/layout/style/nsCSSValue.h index 7d0556046b..680e26732a 100644 --- a/layout/style/nsCSSValue.h +++ b/layout/style/nsCSSValue.h @@ -484,6 +484,7 @@ enum nsCSSUnit { eCSSUnit_TokenStream = 43, // (nsCSSValueTokenStream*) value eCSSUnit_GridTemplateAreas = 44, // (GridTemplateAreasValue*) // for grid-template-areas + eCSSUnit_Revert = 45, // (SheetType) value is the current cascade origin eCSSUnit_Pair = 50, // (nsCSSValuePair*) pair of values eCSSUnit_Triplet = 51, // (nsCSSValueTriplet*) triplet of values @@ -911,6 +912,12 @@ public: return mValue.mFloatColor; } + mozilla::SheetType GetCascadeOriginValue() const + { + MOZ_ASSERT(mUnit == eCSSUnit_Revert, "not a cascade origin value"); + return mValue.mCascadeOrigin; + } + void Reset() // sets to null { if (mUnit != eCSSUnit_Null) @@ -943,6 +950,7 @@ public: void SetRGBAColorValue(const mozilla::css::RGBAColorData& aValue); void SetComplexColorValue( already_AddRefed aValue); + void SetCascadeOriginValue(mozilla::SheetType aValue, nsCSSUnit aUnit); void SetArrayValue(nsCSSValue::Array* aArray, nsCSSUnit aUnit); void SetURLValue(mozilla::css::URLValue* aURI); void SetImageValue(mozilla::css::ImageValue* aImage); @@ -961,6 +969,7 @@ public: void SetInheritValue(); void SetInitialValue(); void SetUnsetValue(); + void SetRevertValue(mozilla::SheetType aValue); void SetNoneValue(); void SetAllValue(); void SetNormalValue(); @@ -1054,6 +1063,7 @@ protected: nsCSSValueFloatColor* MOZ_OWNING_REF mFloatColor; mozilla::css::FontFamilyListRefCnt* MOZ_OWNING_REF mFontFamilyList; mozilla::css::ComplexColorValue* MOZ_OWNING_REF mComplexColor; + mozilla::SheetType mCascadeOrigin; } mValue; }; diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 357df17662..38b61379dc 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -4750,15 +4750,26 @@ nsComputedDOMStyle::DoGetOverflow() { const nsStyleDisplay* display = StyleDisplay(); - if (display->mOverflowX != display->mOverflowY) { - // No value to return. We can't express this combination of - // values as a shorthand. - return nullptr; + if (display->mOverflowX == display->mOverflowY) { + RefPtr val = new nsROCSSPrimitiveValue; + val->SetIdent(nsCSSProps::ValueToKeywordEnum(display->mOverflowX, + nsCSSProps::kOverflowKTable)); + return val.forget(); } RefPtr val = new nsROCSSPrimitiveValue; - val->SetIdent(nsCSSProps::ValueToKeywordEnum(display->mOverflowX, - nsCSSProps::kOverflowKTable)); + nsAutoString result; + + nsCSSKeyword xKeyword = nsCSSProps::ValueToKeywordEnum(display->mOverflowX, + nsCSSProps::kOverflowKTable); + nsCSSKeyword yKeyword = nsCSSProps::ValueToKeywordEnum(display->mOverflowY, + nsCSSProps::kOverflowKTable); + + result.AppendASCII(nsCSSKeywords::GetStringValue(xKeyword).get()); + result.Append(char16_t(' ')); + result.AppendASCII(nsCSSKeywords::GetStringValue(yKeyword).get()); + + val->SetString(result); return val.forget(); } diff --git a/layout/style/nsHTMLStyleSheet.cpp b/layout/style/nsHTMLStyleSheet.cpp index 94b727bcc9..4d7de7293f 100644 --- a/layout/style/nsHTMLStyleSheet.cpp +++ b/layout/style/nsHTMLStyleSheet.cpp @@ -46,9 +46,11 @@ nsHTMLStyleSheet::HTMLColorRule::MapRuleInfoInto(nsRuleData* aRuleData) { if (aRuleData->mSIDs & NS_STYLE_INHERIT_BIT(Color)) { nsCSSValue* color = aRuleData->ValueForColor(); - if (color->GetUnit() == eCSSUnit_Null && - aRuleData->mPresContext->UseDocumentColors()) + if ((color->GetUnit() == eCSSUnit_Null || + color->GetUnit() == eCSSUnit_Revert) && + aRuleData->mPresContext->UseDocumentColors()) { color->SetColorValue(mColor); + } } } @@ -98,7 +100,8 @@ nsHTMLStyleSheet::TableTHRule::MapRuleInfoInto(nsRuleData* aRuleData) { if (aRuleData->mSIDs & NS_STYLE_INHERIT_BIT(Text)) { nsCSSValue* textAlign = aRuleData->ValueForTextAlign(); - if (textAlign->GetUnit() == eCSSUnit_Null) { + if (textAlign->GetUnit() == eCSSUnit_Null || + textAlign->GetUnit() == eCSSUnit_Revert) { textAlign->SetIntValue(NS_STYLE_TEXT_ALIGN_MOZ_CENTER_OR_INHERIT, eCSSUnit_Enumerated); } @@ -126,9 +129,11 @@ nsHTMLStyleSheet::TableQuirkColorRule::MapRuleInfoInto(nsRuleData* aRuleData) nsCSSValue* color = aRuleData->ValueForColor(); // We do not check UseDocumentColors() here, because we want to // use the body color no matter what. - if (color->GetUnit() == eCSSUnit_Null) + if (color->GetUnit() == eCSSUnit_Null || + color->GetUnit() == eCSSUnit_Revert) { color->SetIntValue(NS_STYLE_COLOR_INHERIT_FROM_BODY, eCSSUnit_Enumerated); + } } } @@ -153,7 +158,8 @@ nsHTMLStyleSheet::LangRule::MapRuleInfoInto(nsRuleData* aRuleData) { if (aRuleData->mSIDs & NS_STYLE_INHERIT_BIT(Font)) { nsCSSValue* lang = aRuleData->ValueForLang(); - if (lang->GetUnit() == eCSSUnit_Null) { + if (lang->GetUnit() == eCSSUnit_Null || + lang->GetUnit() == eCSSUnit_Revert) { lang->SetStringValue(mLang, eCSSUnit_Ident); } } diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 21af533726..27f3e6f5f5 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -945,7 +945,9 @@ static bool SetCoord(const nsCSSValue& aValue, nsStyleCoord& aCoord, } else if ((((aMask & SETCOORD_INHERIT) != 0) && aValue.GetUnit() == eCSSUnit_Inherit) || (((aMask & SETCOORD_UNSET_INHERIT) != 0) && - aValue.GetUnit() == eCSSUnit_Unset)) { + aValue.GetUnit() == eCSSUnit_Unset) || + (((aMask & SETCOORD_UNSET_INHERIT) != 0) && + aValue.GetUnit() == eCSSUnit_Revert)) { aCoord = aParentCoord; // just inherit value from parent aConditions.SetUncacheable(); } else if (((aMask & SETCOORD_NORMAL) != 0) && @@ -963,6 +965,8 @@ static bool SetCoord(const nsCSSValue& aValue, nsStyleCoord& aCoord, aConditions); } else if (aValue.GetUnit() == eCSSUnit_Initial || (aValue.GetUnit() == eCSSUnit_Unset && + ((aMask & SETCOORD_UNSET_INITIAL) != 0)) || + (aValue.GetUnit() == eCSSUnit_Revert && ((aMask & SETCOORD_UNSET_INITIAL) != 0))) { if ((aMask & SETCOORD_INITIAL_AUTO) != 0) { aCoord.SetAutoValue(); @@ -1161,10 +1165,12 @@ SetComplexColor(const nsCSSValue& aValue, return; } if (unit == eCSSUnit_Initial || - (UnsetTo == eUnsetInitial && unit == eCSSUnit_Unset)) { + (UnsetTo == eUnsetInitial && unit == eCSSUnit_Unset) || + (UnsetTo == eUnsetInitial && unit == eCSSUnit_Revert)) { aResult = aInitialColor; } else if (unit == eCSSUnit_Inherit || - (UnsetTo == eUnsetInherit && unit == eCSSUnit_Unset)) { + (UnsetTo == eUnsetInherit && unit == eCSSUnit_Unset) || + (UnsetTo == eUnsetInherit && unit == eCSSUnit_Revert)) { aConditions.SetUncacheable(); aResult = aParentColor; } else if (unit == eCSSUnit_EnumColor && @@ -1369,6 +1375,7 @@ static void SetStyleImage(nsStyleContext* aStyleContext, break; case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: case eCSSUnit_None: break; case eCSSUnit_URL: @@ -1560,6 +1567,7 @@ SetValue(const nsCSSValue& aValue, FieldT& aField, return; case eCSSUnit_Unset: + case eCSSUnit_Revert: if (aMask & SETVAL_UNSET_INHERIT) { aConditions.SetUncacheable(); aField = aParentValue; @@ -1610,7 +1618,7 @@ SetFactor(const nsCSSValue& aValue, float& aField, RuleNodeCacheConditions& aCon if (aField < 0.0f) { aField = 0.0f; } - } + } if (aFlags & SETFCT_OPACITY) { if (aField < 0.0f) { aField = 0.0f; @@ -1638,6 +1646,7 @@ SetFactor(const nsCSSValue& aValue, float& aField, RuleNodeCacheConditions& aCon break; case eCSSUnit_Unset: + case eCSSUnit_Revert: if (aFlags & SETFCT_UNSET_INHERIT) { aConditions.SetUncacheable(); aField = aParentValue; @@ -1940,12 +1949,14 @@ typedef nsRuleNode::RuleDetail * @param aSpecifiedCount to be incremented by one if the value is specified * @param aInheritedCount to be incremented by one if the value is set to inherit * @param aUnsetCount to be incremented by one if the value is set to unset + * @param aRevertCount to be incremented by one if the value is set to revert */ inline void ExamineCSSValue(const nsCSSValue& aValue, uint32_t& aSpecifiedCount, uint32_t& aInheritedCount, - uint32_t& aUnsetCount) + uint32_t& aUnsetCount, + uint32_t& aRevertCount) { if (aValue.GetUnit() != eCSSUnit_Null) { ++aSpecifiedCount; @@ -1953,6 +1964,8 @@ ExamineCSSValue(const nsCSSValue& aValue, ++aInheritedCount; } else if (aValue.GetUnit() == eCSSUnit_Unset) { ++aUnsetCount; + } else if (aValue.GetUnit() == eCSSUnit_Revert) { + ++aRevertCount; } } } @@ -2235,14 +2248,16 @@ AreAllMathMLPropertiesUndefined(const nsRuleData* aRuleData) inline nsRuleNode::RuleDetail nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, - const nsRuleData* aRuleData) + const nsRuleData* aRuleData, + bool& ignoreRuleCache) { // Build a count of the: uint32_t total = 0, // total number of props in the struct specified = 0, // number that were specified for this node inherited = 0, // number that were 'inherit' (and not // eCSSUnit_Inherit) for this node - unset = 0; // number that were 'unset' + unset = 0, // number that were 'unset' + revert = 0; // number that were 'revert' // See comment in nsRuleData.h above mValueOffsets. MOZ_ASSERT(aRuleData->mValueOffsets[aSID] == 0, @@ -2251,7 +2266,7 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, *values_end = values + nsCSSProps::PropertyCountInStruct(aSID); values != values_end; ++values) { ++total; - ExamineCSSValue(*values, specified, inherited, unset); + ExamineCSSValue(*values, specified, inherited, unset, revert); } if (!nsCachedStyleData::IsReset(aSID)) { @@ -2309,6 +2324,8 @@ nsRuleNode::CheckSpecifiedProperties(const nsStyleStructID aSID, result = (*cb)(aRuleData, result); } + ignoreRuleCache = revert > 0; + return result; } @@ -2477,6 +2494,7 @@ nsRuleNode::WalkRuleTree(const nsStyleStructID aSID, // will be the root. (XXX misnamed) RuleDetail detail = eRuleNone; uint32_t bit = nsCachedStyleData::GetBitForSID(aSID); + bool ignoreRuleCache = false; while (ruleNode) { // See if this rule node has cached the fact that the remaining @@ -2503,9 +2521,16 @@ nsRuleNode::WalkRuleTree(const nsStyleStructID aSID, // we'll miss it. startStruct = ruleNode->mStyleData.GetStyleData(aSID); if (startStruct) { - break; // We found a rule with fully specified data. We don't - } // need to go up the tree any further, since the remainder - // of this branch has already been computed. + // XXX: Ignore cached data if the previous rule node has revert values. + if (ignoreRuleCache) { + startStruct = nullptr; + } else { + // We found a rule with fully specified data. We don't + // need to go up the tree any further, since the remainder + // of this branch has already been computed. + break; + } + } // Ask the rule to fill in the properties that it specifies. nsIStyleRule *rule = ruleNode->mRule; @@ -2518,15 +2543,15 @@ nsRuleNode::WalkRuleTree(const nsStyleStructID aSID, // Now we check to see how many properties have been specified by // the rules we've examined so far. RuleDetail oldDetail = detail; - detail = CheckSpecifiedProperties(aSID, &ruleData); + detail = CheckSpecifiedProperties(aSID, &ruleData, ignoreRuleCache); - if (oldDetail == eRuleNone && detail != eRuleNone) { + if (oldDetail == eRuleNone && (detail != eRuleNone || ignoreRuleCache)) { highestNode = ruleNode; } - if (detail == eRuleFullReset || - detail == eRuleFullMixed || - detail == eRuleFullInherited) { + if (!ignoreRuleCache && (detail == eRuleFullReset || + detail == eRuleFullMixed || + detail == eRuleFullInherited)) { break; // We don't need to examine any more rules. All properties } // have been fully specified. @@ -2562,7 +2587,7 @@ nsRuleNode::WalkRuleTree(const nsStyleStructID aSID, } if (recomputeDetail) { - detail = CheckSpecifiedProperties(aSID, &ruleData); + detail = CheckSpecifiedProperties(aSID, &ruleData, ignoreRuleCache); } NS_ASSERTION(!startStruct || (detail != eRuleFullReset && @@ -2938,7 +2963,7 @@ nsRuleNode::SetDefaultOnRoot(const nsStyleStructID aSID, nsStyleContext* aContex } \ } else { \ data_ = new (mPresContext) nsStyle##type_(mPresContext); \ - } \ + } \ } \ \ if (!parentdata_) { \ @@ -3313,7 +3338,7 @@ nsRuleNode::FindNextSmallerFontSize(nscoord aFontSize, int32_t aBasePointSize, indexFontSize = CalcFontPointSize(index, aBasePointSize, aPresContext, aFontSizeType); if (indexFontSize < aFontSize) { break; - } + } } // set up points beyond table for interpolation purposes if (indexFontSize == smallestIndexFontSize) { @@ -3379,7 +3404,7 @@ nsRuleNode::FindNextLargerFontSize(nscoord aFontSize, int32_t aBasePointSize, indexFontSize = CalcFontPointSize(index, aBasePointSize, aPresContext, aFontSizeType); if (indexFontSize > aFontSize) { break; - } + } } // set up points beyond table for interpolation purposes if (indexFontSize == smallestIndexFontSize) { @@ -3542,7 +3567,8 @@ nsRuleNode::SetFontSize(nsPresContext* aPresContext, // this becomes our cascading size *aSize = aSystemFont.size; } else if (eCSSUnit_Inherit == sizeValue->GetUnit() || - eCSSUnit_Unset == sizeValue->GetUnit()) { + eCSSUnit_Unset == sizeValue->GetUnit() || + eCSSUnit_Revert == sizeValue->GetUnit()) { aConditions.SetUncacheable(); // We apply scriptlevel change for this case, because the default is // to inherit and we don't want explicit "inherit" to differ from the @@ -3753,7 +3779,8 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext, aFont->mFont.systemFont = true; aFont->mGenericID = kGenericFont_NONE; } else if (eCSSUnit_Inherit == familyValue->GetUnit() || - eCSSUnit_Unset == familyValue->GetUnit()) { + eCSSUnit_Unset == familyValue->GetUnit() || + eCSSUnit_Revert == familyValue->GetUnit()) { aConditions.SetUncacheable(); aFont->mFont.fontlist = aParentFont->mFont.fontlist; aFont->mFont.systemFont = aParentFont->mFont.systemFont; @@ -3842,12 +3869,13 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext, break; } } - } else + } else { SetValue(*weightValue, aFont->mFont.weight, aConditions, SETVAL_INTEGER | SETVAL_UNSET_INHERIT, aParentFont->mFont.weight, defaultVariableFont->weight, Unused, Unused, Unused, systemFont.weight); + } // font-stretch: enum, inherit, initial, -moz-system-font SetValue(*aRuleData->ValueForFontStretch(), @@ -3896,7 +3924,8 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext, (aParentFont->mMathDisplay == NS_MATHML_DISPLAYSTYLE_INLINE ? 1 : 0)); } else if (eCSSUnit_Inherit == scriptLevelValue->GetUnit() || - eCSSUnit_Unset == scriptLevelValue->GetUnit()) { + eCSSUnit_Unset == scriptLevelValue->GetUnit() || + eCSSUnit_Revert == scriptLevelValue->GetUnit()) { aConditions.SetUncacheable(); aFont->mScriptLevel = aParentFont->mScriptLevel; } else if (eCSSUnit_Initial == scriptLevelValue->GetUnit()) { @@ -3928,6 +3957,7 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext, switch (variantAlternatesValue->GetUnit()) { case eCSSUnit_Inherit: case eCSSUnit_Unset: + case eCSSUnit_Revert: aFont->mFont.CopyAlternates(aParentFont->mFont); aConditions.SetUncacheable(); break; @@ -4023,6 +4053,7 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext, case eCSSUnit_Inherit: case eCSSUnit_Unset: + case eCSSUnit_Revert: aConditions.SetUncacheable(); aFont->mFont.fontFeatureSettings = aParentFont->mFont.fontFeatureSettings; break; @@ -4046,7 +4077,8 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext, const nsCSSValue* languageOverrideValue = aRuleData->ValueForFontLanguageOverride(); if (eCSSUnit_Inherit == languageOverrideValue->GetUnit() || - eCSSUnit_Unset == languageOverrideValue->GetUnit()) { + eCSSUnit_Unset == languageOverrideValue->GetUnit() || + eCSSUnit_Revert == languageOverrideValue->GetUnit()) { aConditions.SetUncacheable(); aFont->mFont.languageOverride = aParentFont->mFont.languageOverride; } else if (eCSSUnit_Normal == languageOverrideValue->GetUnit() || @@ -4063,8 +4095,9 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext, switch (minFontSizeRatio->GetUnit()) { case eCSSUnit_Null: break; - case eCSSUnit_Unset: case eCSSUnit_Inherit: + case eCSSUnit_Unset: + case eCSSUnit_Revert: aFont->mMinFontSizeRatio = aParentFont->mMinFontSizeRatio; aConditions.SetUncacheable(); break; @@ -4909,7 +4942,8 @@ nsRuleNode::ComputeTextData(void* aStartStruct, NS_NOTYETIMPLEMENTED("align string"); } } else if (eCSSUnit_Inherit == textAlignValue->GetUnit() || - eCSSUnit_Unset == textAlignValue->GetUnit()) { + eCSSUnit_Unset == textAlignValue->GetUnit() || + eCSSUnit_Revert == textAlignValue->GetUnit()) { text->mTextAlignTrue = parentText->mTextAlignTrue; } SetValue(*textAlignValue, text->mTextAlign, conditions, @@ -4932,7 +4966,8 @@ nsRuleNode::ComputeTextData(void* aStartStruct, } } } else if (eCSSUnit_Inherit == textAlignLastValue->GetUnit() || - eCSSUnit_Unset == textAlignLastValue->GetUnit()) { + eCSSUnit_Unset == textAlignLastValue->GetUnit() || + eCSSUnit_Revert == textAlignLastValue->GetUnit()) { text->mTextAlignLastTrue = parentText->mTextAlignLastTrue; } SetValue(*textAlignLastValue, text->mTextAlignLast, @@ -5052,7 +5087,8 @@ nsRuleNode::ComputeTextData(void* aStartStruct, break; } case eCSSUnit_Inherit: - case eCSSUnit_Unset: { + case eCSSUnit_Unset: + case eCSSUnit_Revert: { conditions.SetUncacheable(); text->mTextEmphasisStyle = parentText->mTextEmphasisStyle; text->mTextEmphasisStyleString = parentText->mTextEmphasisStyleString; @@ -5168,7 +5204,8 @@ nsRuleNode::ComputeTextResetData(void* aStartStruct, conditions.SetUncacheable(); text->mTextDecorationLine = parentText->mTextDecorationLine; } else if (eCSSUnit_Initial == decorationLineValue->GetUnit() || - eCSSUnit_Unset == decorationLineValue->GetUnit()) { + eCSSUnit_Unset == decorationLineValue->GetUnit() || + eCSSUnit_Revert == decorationLineValue->GetUnit()) { text->mTextDecorationLine = NS_STYLE_TEXT_DECORATION_LINE_NONE; } @@ -5188,7 +5225,8 @@ nsRuleNode::ComputeTextResetData(void* aStartStruct, text->mTextDecorationStyle = parentText->mTextDecorationStyle; conditions.SetUncacheable(); } else if (eCSSUnit_Initial == decorationStyleValue->GetUnit() || - eCSSUnit_Unset == decorationStyleValue->GetUnit()) { + eCSSUnit_Unset == decorationStyleValue->GetUnit() || + eCSSUnit_Revert == decorationStyleValue->GetUnit()) { text->mTextDecorationStyle = NS_STYLE_TEXT_DECORATION_STYLE_SOLID; } @@ -5196,7 +5234,8 @@ nsRuleNode::ComputeTextResetData(void* aStartStruct, const nsCSSValue* textOverflowValue = aRuleData->ValueForTextOverflow(); if (eCSSUnit_Initial == textOverflowValue->GetUnit() || - eCSSUnit_Unset == textOverflowValue->GetUnit()) { + eCSSUnit_Unset == textOverflowValue->GetUnit() || + eCSSUnit_Revert == textOverflowValue->GetUnit()) { text->mTextOverflow = nsStyleTextOverflow(); } else if (eCSSUnit_Inherit == textOverflowValue->GetUnit()) { conditions.SetUncacheable(); @@ -5265,6 +5304,7 @@ nsRuleNode::ComputeTextResetData(void* aStartStruct, text->mInitialLetterSize = parentText->mInitialLetterSize; } else if (initialLetterValue->GetUnit() == eCSSUnit_Initial || initialLetterValue->GetUnit() == eCSSUnit_Unset || + initialLetterValue->GetUnit() == eCSSUnit_Revert || initialLetterValue->GetUnit() == eCSSUnit_Normal) { // Use invalid values in initial-letter property to mean normal. So we can // determine whether it is normal by checking mInitialLetterSink == 0. @@ -5312,7 +5352,8 @@ nsRuleNode::ComputeUserInterfaceData(void* aStartStruct, ui->mCursorImages.Clear(); if (cursorUnit == eCSSUnit_Inherit || - cursorUnit == eCSSUnit_Unset) { + cursorUnit == eCSSUnit_Unset || + cursorUnit == eCSSUnit_Revert) { conditions.SetUncacheable(); ui->mCursor = parentUI->mCursor; ui->mCursorImages = parentUI->mCursorImages; @@ -5694,7 +5735,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, "should have made conditions.Cacheable() false above"); transition->SetDelay(parentDisplay->mTransitions[i].GetDelay()); } else if (delay.unit == eCSSUnit_Initial || - delay.unit == eCSSUnit_Unset) { + delay.unit == eCSSUnit_Unset || + delay.unit == eCSSUnit_Revert) { transition->SetDelay(0.0); } else if (delay.list) { switch (delay.list->mValue.GetUnit()) { @@ -5721,7 +5763,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, "should have made conditions.Cacheable() false above"); transition->SetDuration(parentDisplay->mTransitions[i].GetDuration()); } else if (duration.unit == eCSSUnit_Initial || - duration.unit == eCSSUnit_Unset) { + duration.unit == eCSSUnit_Unset || + duration.unit == eCSSUnit_Revert) { transition->SetDuration(0.0); } else if (duration.list) { switch (duration.list->mValue.GetUnit()) { @@ -5747,7 +5790,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, "should have made conditions.Cacheable() false above"); transition->CopyPropertyFrom(parentDisplay->mTransitions[i]); } else if (property.unit == eCSSUnit_Initial || - property.unit == eCSSUnit_Unset) { + property.unit == eCSSUnit_Unset || + property.unit == eCSSUnit_Revert) { transition->SetProperty(eCSSPropertyExtra_all_properties); } else if (property.unit == eCSSUnit_None) { transition->SetProperty(eCSSPropertyExtra_no_properties); @@ -5786,7 +5830,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, transition->SetTimingFunction( parentDisplay->mTransitions[i].GetTimingFunction()); } else if (timingFunction.unit == eCSSUnit_Initial || - timingFunction.unit == eCSSUnit_Unset) { + timingFunction.unit == eCSSUnit_Unset || + timingFunction.unit == eCSSUnit_Revert) { transition->SetTimingFunction( nsTimingFunction(NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE)); } else if (timingFunction.list) { @@ -5856,7 +5901,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, "should have made conditions.Cacheable() false above"); animation->SetDelay(parentDisplay->mAnimations[i].GetDelay()); } else if (animDelay.unit == eCSSUnit_Initial || - animDelay.unit == eCSSUnit_Unset) { + animDelay.unit == eCSSUnit_Unset || + animDelay.unit == eCSSUnit_Revert) { animation->SetDelay(0.0); } else if (animDelay.list) { switch (animDelay.list->mValue.GetUnit()) { @@ -5883,7 +5929,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, "should have made conditions.Cacheable() false above"); animation->SetDuration(parentDisplay->mAnimations[i].GetDuration()); } else if (animDuration.unit == eCSSUnit_Initial || - animDuration.unit == eCSSUnit_Unset) { + animDuration.unit == eCSSUnit_Unset || + animDuration.unit == eCSSUnit_Revert) { animation->SetDuration(0.0); } else if (animDuration.list) { switch (animDuration.list->mValue.GetUnit()) { @@ -5909,7 +5956,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, "should have made conditions.Cacheable() false above"); animation->SetName(parentDisplay->mAnimations[i].GetName()); } else if (animName.unit == eCSSUnit_Initial || - animName.unit == eCSSUnit_Unset) { + animName.unit == eCSSUnit_Unset || + animName.unit == eCSSUnit_Revert) { animation->SetName(EmptyString()); } else if (animName.list) { switch (animName.list->mValue.GetUnit()) { @@ -5941,7 +5989,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, animation->SetTimingFunction( parentDisplay->mAnimations[i].GetTimingFunction()); } else if (animTimingFunction.unit == eCSSUnit_Initial || - animTimingFunction.unit == eCSSUnit_Unset) { + animTimingFunction.unit == eCSSUnit_Unset || + animTimingFunction.unit == eCSSUnit_Revert) { animation->SetTimingFunction( nsTimingFunction(NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE)); } else if (animTimingFunction.list) { @@ -5960,7 +6009,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, "should have made conditions.Cacheable() false above"); animation->SetDirection(parentDisplay->mAnimations[i].GetDirection()); } else if (animDirection.unit == eCSSUnit_Initial || - animDirection.unit == eCSSUnit_Unset) { + animDirection.unit == eCSSUnit_Unset || + animDirection.unit == eCSSUnit_Revert) { animation->SetDirection(dom::PlaybackDirection::Normal); } else if (animDirection.list) { MOZ_ASSERT(animDirection.list->mValue.GetUnit() == eCSSUnit_Enumerated, @@ -5980,7 +6030,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, "should have made conditions.Cacheable() false above"); animation->SetFillMode(parentDisplay->mAnimations[i].GetFillMode()); } else if (animFillMode.unit == eCSSUnit_Initial || - animFillMode.unit == eCSSUnit_Unset) { + animFillMode.unit == eCSSUnit_Unset || + animFillMode.unit == eCSSUnit_Revert) { animation->SetFillMode(dom::FillMode::None); } else if (animFillMode.list) { MOZ_ASSERT(animFillMode.list->mValue.GetUnit() == eCSSUnit_Enumerated, @@ -6001,7 +6052,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, "should have made conditions.Cacheable() false above"); animation->SetPlayState(parentDisplay->mAnimations[i].GetPlayState()); } else if (animPlayState.unit == eCSSUnit_Initial || - animPlayState.unit == eCSSUnit_Unset) { + animPlayState.unit == eCSSUnit_Unset || + animPlayState.unit == eCSSUnit_Revert) { animation->SetPlayState(NS_STYLE_ANIMATION_PLAY_STATE_RUNNING); } else if (animPlayState.list) { MOZ_ASSERT(animPlayState.list->mValue.GetUnit() == eCSSUnit_Enumerated, @@ -6021,7 +6073,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, "should have made conditions.Cacheable() false above"); animation->SetIterationCount(parentDisplay->mAnimations[i].GetIterationCount()); } else if (animIterationCount.unit == eCSSUnit_Initial || - animIterationCount.unit == eCSSUnit_Unset) { + animIterationCount.unit == eCSSUnit_Unset || + animIterationCount.unit == eCSSUnit_Revert) { animation->SetIterationCount(1.0f); } else if (animIterationCount.list) { switch (animIterationCount.list->mValue.GetUnit()) { @@ -6092,6 +6145,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, break; case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: case eCSSUnit_None: display->mScrollSnapPointsX.SetNoneValue(); break; @@ -6127,6 +6181,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, break; case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: case eCSSUnit_None: display->mScrollSnapPointsY.SetNoneValue(); break; @@ -6162,6 +6217,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, break; case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: display->mScrollSnapDestination.SetInitialZeroValues(); break; case eCSSUnit_Inherit: @@ -6181,8 +6237,9 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, break; case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: case eCSSUnit_None: - // Unset and Initial is none, indicated by an empty array + // Initial, Unset, and Revert are none, indicated by an empty array display->mScrollSnapCoordinate.Clear(); break; case eCSSUnit_Inherit: @@ -6196,7 +6253,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, NS_ASSERTION(item->mValue.GetUnit() != eCSSUnit_Null && item->mValue.GetUnit() != eCSSUnit_Inherit && item->mValue.GetUnit() != eCSSUnit_Initial && - item->mValue.GetUnit() != eCSSUnit_Unset, + item->mValue.GetUnit() != eCSSUnit_Unset && + item->mValue.GetUnit() != eCSSUnit_Revert, "unexpected unit"); Position* pos = display->mScrollSnapCoordinate.AppendElement(); ComputePositionValue(aContext, item->mValue, *pos, conditions); @@ -6244,8 +6302,9 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, display->mBinding = nullptr; } } else if (eCSSUnit_None == bindingValue->GetUnit() || - eCSSUnit_Initial == bindingValue->GetUnit() || - eCSSUnit_Unset == bindingValue->GetUnit()) { + eCSSUnit_Initial == bindingValue->GetUnit() || + eCSSUnit_Unset == bindingValue->GetUnit() || + eCSSUnit_Revert == bindingValue->GetUnit()) { display->mBinding = nullptr; } else if (eCSSUnit_Inherit == bindingValue->GetUnit()) { conditions.SetUncacheable(); @@ -6285,7 +6344,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, (NS_STYLE_PAGE_BREAK_AVOID != breakBeforeValue->GetIntValue() && NS_STYLE_PAGE_BREAK_AUTO != breakBeforeValue->GetIntValue()); } else if (eCSSUnit_Initial == breakBeforeValue->GetUnit() || - eCSSUnit_Unset == breakBeforeValue->GetUnit()) { + eCSSUnit_Unset == breakBeforeValue->GetUnit() || + eCSSUnit_Revert == breakBeforeValue->GetUnit()) { display->mBreakBefore = false; } else if (eCSSUnit_Inherit == breakBeforeValue->GetUnit()) { conditions.SetUncacheable(); @@ -6298,7 +6358,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, (NS_STYLE_PAGE_BREAK_AVOID != breakAfterValue->GetIntValue() && NS_STYLE_PAGE_BREAK_AUTO != breakAfterValue->GetIntValue()); } else if (eCSSUnit_Initial == breakAfterValue->GetUnit() || - eCSSUnit_Unset == breakAfterValue->GetUnit()) { + eCSSUnit_Unset == breakAfterValue->GetUnit() || + eCSSUnit_Revert == breakAfterValue->GetUnit()) { display->mBreakAfter = false; } else if (eCSSUnit_Inherit == breakAfterValue->GetUnit()) { conditions.SetUncacheable(); @@ -6366,14 +6427,6 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, display->mOverflowY = NS_STYLE_OVERFLOW_HIDDEN; } - // If 'visible' is specified but doesn't match the other dimension, it - // turns into 'auto'. - if (display->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE) { - display->mOverflowX = NS_STYLE_OVERFLOW_AUTO; - } - if (display->mOverflowY == NS_STYLE_OVERFLOW_VISIBLE) { - display->mOverflowY = NS_STYLE_OVERFLOW_AUTO; - } } // When 'contain: paint', update overflow from 'visible' to 'clip'. @@ -6500,6 +6553,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: case eCSSUnit_None: display->mSpecifiedTransform = nullptr; break; @@ -6584,6 +6638,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: case eCSSUnit_Auto: display->mWillChange.Clear(); display->mWillChangeBitField = 0; @@ -6600,7 +6655,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, SETCOORD_LPH | SETCOORD_ENUMERATED | SETCOORD_STORE_CALC, aContext, mPresContext, conditions)) { if (eCSSUnit_Initial == verticalAlignValue->GetUnit() || - eCSSUnit_Unset == verticalAlignValue->GetUnit()) { + eCSSUnit_Unset == verticalAlignValue->GetUnit() || + eCSSUnit_Revert == verticalAlignValue->GetUnit()) { display->mVerticalAlign.SetIntValue(NS_STYLE_VERTICAL_ALIGN_BASELINE, eStyleUnit_Enumerated); } @@ -6711,6 +6767,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct, case eCSSUnit_None: case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: display->mShapeOutside = StyleShapeOutside(); break; case eCSSUnit_Inherit: @@ -6789,7 +6846,8 @@ nsRuleNode::ComputeVisibilityData(void* aStartStruct, // image-orientation: enum, inherit, initial const nsCSSValue* orientation = aRuleData->ValueForImageOrientation(); if (orientation->GetUnit() == eCSSUnit_Inherit || - orientation->GetUnit() == eCSSUnit_Unset) { + orientation->GetUnit() == eCSSUnit_Unset || + orientation->GetUnit() == eCSSUnit_Revert) { conditions.SetUncacheable(); visibility->mImageOrientation = parentVisibility->mImageOrientation; } else if (orientation->GetUnit() == eCSSUnit_Initial) { @@ -6849,7 +6907,8 @@ nsRuleNode::ComputeColorData(void* aStartStruct, const nsCSSValue* colorValue = aRuleData->ValueForColor(); if ((colorValue->GetUnit() == eCSSUnit_EnumColor && colorValue->GetIntValue() == NS_COLOR_CURRENTCOLOR) || - colorValue->GetUnit() == eCSSUnit_Unset) { + colorValue->GetUnit() == eCSSUnit_Unset || + colorValue->GetUnit() == eCSSUnit_Revert) { color->mColor = parentColor->mColor; conditions.SetUncacheable(); } else if (colorValue->GetUnit() == eCSSUnit_Initial) { @@ -7158,7 +7217,8 @@ struct BackgroundItemComputer const nsCSSValue &widthValue = aSpecifiedValue->mXValue; MOZ_ASSERT(widthValue.GetUnit() != eCSSUnit_Inherit && widthValue.GetUnit() != eCSSUnit_Initial && - widthValue.GetUnit() != eCSSUnit_Unset, + widthValue.GetUnit() != eCSSUnit_Unset && + widthValue.GetUnit() != eCSSUnit_Revert, "initial/inherit/unset should already have been handled"); MOZ_ASSERT(widthValue.GetUnit() == eCSSUnit_Enumerated && (widthValue.GetIntValue() == NS_STYLE_IMAGELAYER_SIZE_CONTAIN || @@ -7234,6 +7294,7 @@ SetImageLayerList(nsStyleContext* aStyleContext, case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: aRebuild = true; aItemCount = 1; aLayers[0].*aResultLocation = aInitialValue; @@ -7248,7 +7309,8 @@ SetImageLayerList(nsStyleContext* aStyleContext, NS_ASSERTION(item->mValue.GetUnit() != eCSSUnit_Null && item->mValue.GetUnit() != eCSSUnit_Inherit && item->mValue.GetUnit() != eCSSUnit_Initial && - item->mValue.GetUnit() != eCSSUnit_Unset, + item->mValue.GetUnit() != eCSSUnit_Unset && + item->mValue.GetUnit() != eCSSUnit_Revert, "unexpected unit"); ++aItemCount; aLayers.EnsureLengthAtLeast(aItemCount); @@ -7305,6 +7367,7 @@ SetImageLayerPositionCoordList( case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: aRebuild = true; aItemCount = 1; aLayers[0].mPosition.*aResultLocation = aInitialValue; @@ -7319,7 +7382,8 @@ SetImageLayerPositionCoordList( NS_ASSERTION(item->mValue.GetUnit() != eCSSUnit_Null && item->mValue.GetUnit() != eCSSUnit_Inherit && item->mValue.GetUnit() != eCSSUnit_Initial && - item->mValue.GetUnit() != eCSSUnit_Unset, + item->mValue.GetUnit() != eCSSUnit_Unset && + item->mValue.GetUnit() != eCSSUnit_Revert, "unexpected unit"); ++aItemCount; aLayers.EnsureLengthAtLeast(aItemCount); @@ -7372,6 +7436,7 @@ SetImageLayerPairList(nsStyleContext* aStyleContext, case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: aRebuild = true; aItemCount = 1; aLayers[0].*aResultLocation = aInitialValue; @@ -7386,9 +7451,11 @@ SetImageLayerPairList(nsStyleContext* aStyleContext, NS_ASSERTION(item->mXValue.GetUnit() != eCSSUnit_Inherit && item->mXValue.GetUnit() != eCSSUnit_Initial && item->mXValue.GetUnit() != eCSSUnit_Unset && + item->mXValue.GetUnit() != eCSSUnit_Revert && item->mYValue.GetUnit() != eCSSUnit_Inherit && item->mYValue.GetUnit() != eCSSUnit_Initial && - item->mYValue.GetUnit() != eCSSUnit_Unset, + item->mYValue.GetUnit() != eCSSUnit_Unset && + item->mYValue.GetUnit() != eCSSUnit_Revert, "unexpected unit"); ++aItemCount; aLayers.EnsureLengthAtLeast(aItemCount); @@ -7496,7 +7563,8 @@ nsRuleNode::ComputeBackgroundData(void* aStartStruct, // background-color: color, string, inherit const nsCSSValue* backColorValue = aRuleData->ValueForBackgroundColor(); if (eCSSUnit_Initial == backColorValue->GetUnit() || - eCSSUnit_Unset == backColorValue->GetUnit()) { + eCSSUnit_Unset == backColorValue->GetUnit() || + eCSSUnit_Revert == backColorValue->GetUnit()) { bg->mBackgroundColor = NS_RGBA(0, 0, 0, 0); } else if (!SetColor(*backColorValue, parentBG->mBackgroundColor, mPresContext, aContext, bg->mBackgroundColor, @@ -7650,6 +7718,7 @@ SetBorderImageRect(const nsCSSValue& aValue, case eCSSUnit_Inherit: case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: aRect.SetAllSidesTo(aValue); break; default: @@ -7671,6 +7740,7 @@ SetBorderImagePair(const nsCSSValue& aValue, case eCSSUnit_Inherit: case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: aPair.SetBothValuesTo(aValue); break; default: @@ -7705,6 +7775,7 @@ SetBorderImageSlice(const nsCSSValue& aValue, case eCSSUnit_Inherit: case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: aSlice = aValue; aFill = aValue; break; @@ -7764,7 +7835,8 @@ nsRuleNode::ComputeBorderData(void* aStartStruct, border->SetBorderWidth(side, parentBorder->GetComputedBorder().Side(side)); } else if (eCSSUnit_Initial == value.GetUnit() || - eCSSUnit_Unset == value.GetUnit()) { + eCSSUnit_Unset == value.GetUnit() || + eCSSUnit_Revert == value.GetUnit()) { border->SetBorderWidth(side, (mPresContext->GetBorderWidthTable())[NS_STYLE_BORDER_WIDTH_MEDIUM]); } else { @@ -7786,7 +7858,8 @@ nsRuleNode::ComputeBorderData(void* aStartStruct, if (eCSSUnit_Enumerated == unit) { border->SetBorderStyle(side, value.GetIntValue()); } else if (eCSSUnit_Initial == unit || - eCSSUnit_Unset == unit) { + eCSSUnit_Unset == unit || + eCSSUnit_Revert == unit) { border->SetBorderStyle(side, NS_STYLE_BORDER_STYLE_NONE); } else if (eCSSUnit_Inherit == unit) { conditions.SetUncacheable(); @@ -7814,6 +7887,7 @@ nsRuleNode::ComputeBorderData(void* aStartStruct, case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: case eCSSUnit_None: border->ClearBorderColors(side); break; @@ -7843,7 +7917,7 @@ nsRuleNode::ComputeBorderData(void* aStartStruct, if (SetColor(list->mValue, unused, mPresContext, aContext, borderColor, conditions)) { border->AppendBorderColor(side, borderColor); - } else { + } else { NS_NOTREACHED("unexpected item in -moz-border-*-colors list"); } list = list->mNext; @@ -8029,7 +8103,8 @@ nsRuleNode::ComputeOutlineData(void* aStartStruct, // outline-width: length, enum, inherit const nsCSSValue* outlineWidthValue = aRuleData->ValueForOutlineWidth(); if (eCSSUnit_Initial == outlineWidthValue->GetUnit() || - eCSSUnit_Unset == outlineWidthValue->GetUnit()) { + eCSSUnit_Unset == outlineWidthValue->GetUnit() || + eCSSUnit_Revert == outlineWidthValue->GetUnit()) { outline->mOutlineWidth = nsStyleCoord(NS_STYLE_BORDER_WIDTH_MEDIUM, eStyleUnit_Enumerated); } else { @@ -8092,7 +8167,8 @@ nsRuleNode::ComputeOutlineData(void* aStartStruct, if (eCSSUnit_Enumerated == unit) { outline->mOutlineStyle = outlineStyleValue->GetIntValue(); } else if (eCSSUnit_Initial == unit || - eCSSUnit_Unset == unit) { + eCSSUnit_Unset == unit || + eCSSUnit_Revert == unit) { outline->mOutlineStyle = NS_STYLE_BORDER_STYLE_NONE; } else if (eCSSUnit_Inherit == unit) { conditions.SetUncacheable(); @@ -8120,6 +8196,7 @@ nsRuleNode::ComputeListData(void* aStartStruct, break; case eCSSUnit_Inherit: case eCSSUnit_Unset: + case eCSSUnit_Revert: conditions.SetUncacheable(); list->SetQuotesInherit(parentList); break; @@ -8157,8 +8234,9 @@ nsRuleNode::ComputeListData(void* aStartStruct, // list-style-type: string, none, inherit, initial const nsCSSValue* typeValue = aRuleData->ValueForListStyleType(); switch (typeValue->GetUnit()) { + case eCSSUnit_Inherit: case eCSSUnit_Unset: - case eCSSUnit_Inherit: { + case eCSSUnit_Revert: { conditions.SetUncacheable(); list->SetCounterStyle(parentList->GetCounterStyle()); break; @@ -8223,7 +8301,8 @@ nsRuleNode::ComputeListData(void* aStartStruct, eCSSUnit_Initial == imageValue->GetUnit()) { list->mListStyleImage = nullptr; } else if (eCSSUnit_Inherit == imageValue->GetUnit() || - eCSSUnit_Unset == imageValue->GetUnit()) { + eCSSUnit_Unset == imageValue->GetUnit() || + eCSSUnit_Revert == imageValue->GetUnit()) { conditions.SetUncacheable(); list->mListStyleImage = parentList->mListStyleImage; } @@ -8240,6 +8319,7 @@ nsRuleNode::ComputeListData(void* aStartStruct, switch (imageRegionValue->GetUnit()) { case eCSSUnit_Inherit: case eCSSUnit_Unset: + case eCSSUnit_Revert: conditions.SetUncacheable(); list->mImageRegion = parentList->mImageRegion; break; @@ -8310,7 +8390,9 @@ SetGridTrackBreadth(const nsCSSValue& aValue, // For fit-content(). aResult.SetNoneValue(); } else { - MOZ_ASSERT(unit != eCSSUnit_Inherit && unit != eCSSUnit_Unset, + MOZ_ASSERT(unit != eCSSUnit_Inherit && + unit != eCSSUnit_Unset && + unit != eCSSUnit_Revert, "Unexpected value that would use dummyParentCoord"); const nsStyleCoord dummyParentCoord; DebugOnly stored = @@ -8378,6 +8460,7 @@ SetGridAutoColumnsRows(const nsCSSValue& aValue, case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: // The initial value is 'auto', // which computes to 'minmax(auto, auto)'. // (Explicitly-specified 'auto' values are handled in SetGridTrackSize.) @@ -8434,6 +8517,7 @@ SetGridTrackList(const nsCSSValue& aValue, case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: case eCSSUnit_None: aResult.mIsSubgrid = false; aResult.mLineNameLists.Clear(); @@ -8554,6 +8638,7 @@ SetGridTemplateAreas(const nsCSSValue& aValue, case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: case eCSSUnit_None: *aResult = nullptr; break; @@ -8581,6 +8666,7 @@ SetGridLine(const nsCSSValue& aValue, case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: case eCSSUnit_Auto: aResult.SetAuto(); break; @@ -8837,6 +8923,7 @@ nsRuleNode::ComputePositionData(void* aStartStruct, break; case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: pos->mObjectPosition.SetInitialPercentValues(0.5f); break; default: @@ -8855,6 +8942,7 @@ nsRuleNode::ComputePositionData(void* aStartStruct, break; case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: pos->mGridAutoFlow = NS_STYLE_GRID_AUTO_FLOW_ROW; break; default: @@ -9065,6 +9153,7 @@ nsRuleNode::ComputeContentData(void* aStartStruct, case eCSSUnit_None: case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: // "normal", "none", "initial" and "unset" all mean no content content->AllocateContents(0); break; @@ -9163,6 +9252,7 @@ nsRuleNode::ComputeContentData(void* aStartStruct, case eCSSUnit_None: case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: content->AllocateCounterIncrements(0); break; @@ -9212,6 +9302,7 @@ nsRuleNode::ComputeContentData(void* aStartStruct, case eCSSUnit_None: case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: content->AllocateCounterResets(0); break; @@ -9318,7 +9409,8 @@ nsRuleNode::ComputeXULData(void* aStartStruct, conditions.SetUncacheable(); xul->mStretchStack = parentXUL->mStretchStack; } else if (eCSSUnit_Initial == stackSizingValue->GetUnit() || - eCSSUnit_Unset == stackSizingValue->GetUnit()) { + eCSSUnit_Unset == stackSizingValue->GetUnit() || + eCSSUnit_Revert == stackSizingValue->GetUnit()) { xul->mStretchStack = true; } else if (eCSSUnit_Enumerated == stackSizingValue->GetUnit()) { xul->mStretchStack = stackSizingValue->GetIntValue() == @@ -9350,7 +9442,8 @@ nsRuleNode::ComputeColumnData(void* aStartStruct, const nsCSSValue* columnCountValue = aRuleData->ValueForColumnCount(); if (eCSSUnit_Auto == columnCountValue->GetUnit() || eCSSUnit_Initial == columnCountValue->GetUnit() || - eCSSUnit_Unset == columnCountValue->GetUnit()) { + eCSSUnit_Unset == columnCountValue->GetUnit() || + eCSSUnit_Revert == columnCountValue->GetUnit()) { column->mColumnCount = NS_STYLE_COLUMN_COUNT_AUTO; } else if (eCSSUnit_Integer == columnCountValue->GetUnit()) { column->mColumnCount = columnCountValue->GetIntValue(); @@ -9365,7 +9458,8 @@ nsRuleNode::ComputeColumnData(void* aStartStruct, // column-rule-width: length, enum, inherit const nsCSSValue& widthValue = *aRuleData->ValueForColumnRuleWidth(); if (eCSSUnit_Initial == widthValue.GetUnit() || - eCSSUnit_Unset == widthValue.GetUnit()) { + eCSSUnit_Unset == widthValue.GetUnit() || + eCSSUnit_Revert == widthValue.GetUnit()) { column->SetColumnRuleWidth( (mPresContext->GetBorderWidthTable())[NS_STYLE_BORDER_WIDTH_MEDIUM]); } else if (eCSSUnit_Enumerated == widthValue.GetUnit()) { @@ -9399,7 +9493,8 @@ nsRuleNode::ComputeColumnData(void* aStartStruct, if (eCSSUnit_Enumerated == styleValue.GetUnit()) { column->mColumnRuleStyle = styleValue.GetIntValue(); } else if (eCSSUnit_Initial == styleValue.GetUnit() || - eCSSUnit_Unset == styleValue.GetUnit()) { + eCSSUnit_Unset == styleValue.GetUnit() || + eCSSUnit_Revert == styleValue.GetUnit()) { column->mColumnRuleStyle = NS_STYLE_BORDER_STYLE_NONE; } else if (eCSSUnit_Inherit == styleValue.GetUnit()) { conditions.SetUncacheable(); @@ -9438,7 +9533,8 @@ SetSVGPaint(const nsCSSValue& aValue, const nsStyleSVGPaint& parentPaint, nscolor color; if (aValue.GetUnit() == eCSSUnit_Inherit || - aValue.GetUnit() == eCSSUnit_Unset) { + aValue.GetUnit() == eCSSUnit_Unset || + aValue.GetUnit() == eCSSUnit_Revert) { aResult = parentPaint; aConditions.SetUncacheable(); } else if (aValue.GetUnit() == eCSSUnit_None) { @@ -9510,7 +9606,8 @@ SetSVGOpacity(const nsCSSValue& aValue, // Fall back on fully opaque aOpacityField = 1.0f; } else if (eCSSUnit_Inherit == aValue.GetUnit() || - eCSSUnit_Unset == aValue.GetUnit()) { + eCSSUnit_Unset == aValue.GetUnit() || + eCSSUnit_Revert == aValue.GetUnit()) { aConditions.SetUncacheable(); aOpacityField = aParentOpacity; aOpacityTypeField = aParentOpacityType; @@ -9580,7 +9677,8 @@ nsRuleNode::ComputeSVGData(void* aStartStruct, eCSSUnit_Initial == markerEndValue->GetUnit()) { svg->mMarkerEnd = nullptr; } else if (eCSSUnit_Inherit == markerEndValue->GetUnit() || - eCSSUnit_Unset == markerEndValue->GetUnit()) { + eCSSUnit_Unset == markerEndValue->GetUnit() || + eCSSUnit_Revert == markerEndValue->GetUnit()) { conditions.SetUncacheable(); svg->mMarkerEnd = parentSVG->mMarkerEnd; } @@ -9593,7 +9691,8 @@ nsRuleNode::ComputeSVGData(void* aStartStruct, eCSSUnit_Initial == markerMidValue->GetUnit()) { svg->mMarkerMid = nullptr; } else if (eCSSUnit_Inherit == markerMidValue->GetUnit() || - eCSSUnit_Unset == markerMidValue->GetUnit()) { + eCSSUnit_Unset == markerMidValue->GetUnit() || + eCSSUnit_Revert == markerMidValue->GetUnit()) { conditions.SetUncacheable(); svg->mMarkerMid = parentSVG->mMarkerMid; } @@ -9605,6 +9704,8 @@ nsRuleNode::ComputeSVGData(void* aStartStruct, } else if (eCSSUnit_None == markerStartValue->GetUnit() || eCSSUnit_Initial == markerStartValue->GetUnit()) { svg->mMarkerStart = nullptr; + } else if (eCSSUnit_Inherit == markerStartValue->GetUnit()) { + } else if (eCSSUnit_Inherit == markerStartValue->GetUnit() || eCSSUnit_Unset == markerStartValue->GetUnit()) { conditions.SetUncacheable(); @@ -9626,6 +9727,7 @@ nsRuleNode::ComputeSVGData(void* aStartStruct, case eCSSUnit_Inherit: case eCSSUnit_Unset: + case eCSSUnit_Revert: conditions.SetUncacheable(); svg->mPaintOrder = parentSVG->mPaintOrder; break; @@ -9658,6 +9760,7 @@ nsRuleNode::ComputeSVGData(void* aStartStruct, case eCSSUnit_Inherit: case eCSSUnit_Unset: + case eCSSUnit_Revert: conditions.SetUncacheable(); svg->SetStrokeDasharrayFromObject(parentSVG->StrokeDasharrayFromObject()); svg->mStrokeDasharray = parentSVG->mStrokeDasharray; @@ -10057,7 +10160,8 @@ nsRuleNode::ComputeSVGResetData(void* aStartStruct, // stop-color: const nsCSSValue* stopColorValue = aRuleData->ValueForStopColor(); if (eCSSUnit_Initial == stopColorValue->GetUnit() || - eCSSUnit_Unset == stopColorValue->GetUnit()) { + eCSSUnit_Unset == stopColorValue->GetUnit() || + eCSSUnit_Revert == stopColorValue->GetUnit()) { svgReset->mStopColor = NS_RGB(0, 0, 0); } else { SetColor(*stopColorValue, parentSVGReset->mStopColor, @@ -10067,7 +10171,8 @@ nsRuleNode::ComputeSVGResetData(void* aStartStruct, // flood-color: const nsCSSValue* floodColorValue = aRuleData->ValueForFloodColor(); if (eCSSUnit_Initial == floodColorValue->GetUnit() || - eCSSUnit_Unset == floodColorValue->GetUnit()) { + eCSSUnit_Unset == floodColorValue->GetUnit() || + eCSSUnit_Revert == floodColorValue->GetUnit()) { svgReset->mFloodColor = NS_RGB(0, 0, 0); } else { SetColor(*floodColorValue, parentSVGReset->mFloodColor, @@ -10077,7 +10182,8 @@ nsRuleNode::ComputeSVGResetData(void* aStartStruct, // lighting-color: const nsCSSValue* lightingColorValue = aRuleData->ValueForLightingColor(); if (eCSSUnit_Initial == lightingColorValue->GetUnit() || - eCSSUnit_Unset == lightingColorValue->GetUnit()) { + eCSSUnit_Unset == lightingColorValue->GetUnit() || + eCSSUnit_Revert == lightingColorValue->GetUnit()) { svgReset->mLightingColor = NS_RGB(255, 255, 255); } else { SetColor(*lightingColorValue, parentSVGReset->mLightingColor, @@ -10093,6 +10199,7 @@ nsRuleNode::ComputeSVGResetData(void* aStartStruct, case eCSSUnit_None: case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: svgReset->mClipPath = StyleClipPath(); break; case eCSSUnit_Inherit: @@ -10301,6 +10408,7 @@ nsRuleNode::ComputeEffectsData(void* aStartStruct, case eCSSUnit_None: case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: effects->mFilters.Clear(); break; case eCSSUnit_Inherit: @@ -10337,6 +10445,7 @@ nsRuleNode::ComputeEffectsData(void* aStartStruct, case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: case eCSSUnit_None: effects->mBoxShadow = nullptr; break; @@ -10367,6 +10476,7 @@ nsRuleNode::ComputeEffectsData(void* aStartStruct, case eCSSUnit_Initial: case eCSSUnit_Unset: + case eCSSUnit_Revert: case eCSSUnit_Auto: effects->mClipFlags = NS_STYLE_CLIP_AUTO; effects->mClip.SetRect(0,0,0,0); @@ -10678,10 +10788,12 @@ nsRuleNode::HasAuthorSpecifiedRules(nsStyleContext* aStyleContext, for (uint32_t i = 0; i < nValues; ++i) { nsCSSUnit unit = values[i]->GetUnit(); if (unit != eCSSUnit_Null && + unit != eCSSUnit_Revert && unit != eCSSUnit_Dummy && unit != eCSSUnit_DummyInherit) { if (unit == eCSSUnit_Inherit || - (i >= inheritedOffset && unit == eCSSUnit_Unset)) { + (i >= inheritedOffset && unit == eCSSUnit_Unset) || + (i >= inheritedOffset && unit == eCSSUnit_Revert)) { haveExplicitUAInherit = true; values[i]->SetDummyInheritValue(); } else { @@ -10695,7 +10807,8 @@ nsRuleNode::HasAuthorSpecifiedRules(nsStyleContext* aStyleContext, for (uint32_t i = 0; i < nValues; ++i) { if (values[i]->GetUnit() != eCSSUnit_Null && values[i]->GetUnit() != eCSSUnit_Dummy && // see above - values[i]->GetUnit() != eCSSUnit_DummyInherit) { + values[i]->GetUnit() != eCSSUnit_DummyInherit && + values[i]->GetUnit() != eCSSUnit_Revert) { // If author colors are not allowed, only claim to have // author-specified rules if we're looking at a non-color // property or if we're looking at the background color and it's @@ -10725,12 +10838,12 @@ nsRuleNode::HasAuthorSpecifiedRules(nsStyleContext* aStyleContext, for (uint32_t i = 0; i < nValues; ++i) { if (values[i]->GetUnit() == eCSSUnit_Null) { values[i]->SetDummyValue(); - } + } } for (uint32_t i = 0; i < nValues; ++i) { if (values[i]->GetUnit() == eCSSUnit_DummyInherit) { values[i]->Reset(); - } + } } styleContext = styleContext->GetParent(); } @@ -10833,6 +10946,8 @@ nsRuleNode::ComputeColor(const nsCSSValue& aValue, nsPresContext* aPresContext, "aValue shouldn't have eCSSUnit_Initial"); MOZ_ASSERT(aValue.GetUnit() != eCSSUnit_Unset, "aValue shouldn't have eCSSUnit_Unset"); + MOZ_ASSERT(aValue.GetUnit() != eCSSUnit_Revert, + "aValue shouldn't have eCSSUnit_Revert"); RuleNodeCacheConditions conditions; bool ok = SetColor(aValue, NS_RGB(0, 0, 0), aPresContext, aStyleContext, diff --git a/layout/style/nsRuleNode.h b/layout/style/nsRuleNode.h index 49fa8a027b..7ca3a165f9 100644 --- a/layout/style/nsRuleNode.h +++ b/layout/style/nsRuleNode.h @@ -787,7 +787,8 @@ protected: nsStyleFont* aFont); inline RuleDetail CheckSpecifiedProperties(const nsStyleStructID aSID, - const nsRuleData* aRuleData); + const nsRuleData* aRuleData, + bool& ignoreRuleCache); private: nsRuleNode(nsPresContext* aPresContext, nsRuleNode* aParent, diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h index 9507ea6fab..a708a6ff90 100644 --- a/layout/style/nsStyleConsts.h +++ b/layout/style/nsStyleConsts.h @@ -186,6 +186,7 @@ enum class StyleUserSelect : uint8_t { None, Text, Element, + Contain, Elements, All, Toggle, diff --git a/layout/style/res/html.css b/layout/style/res/html.css index 7a6d67f66f..53c88cbdc5 100644 --- a/layout/style/res/html.css +++ b/layout/style/res/html.css @@ -720,12 +720,12 @@ canvas { /* hidden elements */ base, basefont, datalist, head, meta, script, style, title, noembed, param, template { - display: none !important; + display: none; } area { /* Don't give it frames other than its imageframe */ - display: none !important; + display: none ! important; } iframe:fullscreen { diff --git a/toolkit/components/aboutmemory/content/aboutMemory.css b/toolkit/components/aboutmemory/content/aboutMemory.css index cf4d36de87..c359857a40 100644 --- a/toolkit/components/aboutmemory/content/aboutMemory.css +++ b/toolkit/components/aboutmemory/content/aboutMemory.css @@ -16,7 +16,7 @@ body { div.ancillary { margin: 0.5em 0; - -moz-user-select: none; + user-select: none; } div.section { @@ -71,7 +71,7 @@ h3 { a.upDownArrow { font-size: 130%; text-decoration: none; - -moz-user-select: none; /* no need to include this when cutting+pasting */ + user-select: none; /* no need to include this when cutting+pasting */ } .accuracyWarning { @@ -114,17 +114,17 @@ a.upDownArrow { } .noselect { - -moz-user-select: none; /* no need to include this when cutting+pasting */ + user-select: none; /* no need to include this when cutting+pasting */ } .option { font-size: 80%; - -moz-user-select: none; /* no need to include this when cutting+pasting */ + user-select: none; /* no need to include this when cutting+pasting */ } .legend { font-size: 80%; - -moz-user-select: none; /* no need to include this when cutting+pasting */ + user-select: none; /* no need to include this when cutting+pasting */ } .debug { diff --git a/toolkit/content/minimal-xul.css b/toolkit/content/minimal-xul.css index 0cd41922d1..80526cc9ac 100644 --- a/toolkit/content/minimal-xul.css +++ b/toolkit/content/minimal-xul.css @@ -23,7 +23,7 @@ * { -moz-user-focus: ignore; - -moz-user-select: none; + user-select: none; display: -moz-box; box-sizing: border-box; } @@ -97,7 +97,7 @@ thumb { } scrollbar, scrollbarbutton, scrollcorner, slider, thumb, scale { - -moz-user-select: none; + user-select: none; } scrollcorner { diff --git a/toolkit/content/xul.css b/toolkit/content/xul.css index 0aa0d3a217..9d94df64c0 100644 --- a/toolkit/content/xul.css +++ b/toolkit/content/xul.css @@ -658,7 +658,7 @@ treecol.treecol-image { tree > treechildren { display: -moz-box; -moz-binding: url("chrome://global/content/bindings/tree.xml#treebody"); - -moz-user-select: none; + user-select: none; -moz-box-flex: 1; } @@ -763,7 +763,7 @@ progressmeter { textbox { -moz-binding: url("chrome://global/content/bindings/textbox.xml#textbox"); - -moz-user-select: text; + user-select: text; text-shadow: none; } diff --git a/toolkit/mozapps/extensions/content/extensions.css b/toolkit/mozapps/extensions/content/extensions.css index 3eeb173bde..c4c4e8ee1c 100644 --- a/toolkit/mozapps/extensions/content/extensions.css +++ b/toolkit/mozapps/extensions/content/extensions.css @@ -61,7 +61,7 @@ xhtml|link { .text-list { white-space: pre-line; - -moz-user-select: element; + user-select: contain; } setting, row[unsupported="true"] { @@ -203,10 +203,10 @@ setting[type="menulist"] { } .addon .relnotes { - -moz-user-select: text; + user-select: text; } #detail-name, #detail-desc, #detail-fulldesc { - -moz-user-select: text; + user-select: text; } /* Make sure we're not animating hidden images. See bug 623739. */ diff --git a/toolkit/themes/shared/aboutReader.css b/toolkit/themes/shared/aboutReader.css index 1bfbd0309d..831fd31d24 100644 --- a/toolkit/themes/shared/aboutReader.css +++ b/toolkit/themes/shared/aboutReader.css @@ -216,7 +216,7 @@ body:not(.loaded) .toolbar:-moz-locale-dir(rtl) { padding: 0; list-style: none; background-color: #fbfbfb; - -moz-user-select: none; + user-select: none; border-right: 1px solid #b5b5b5; z-index: 1; } diff --git a/toolkit/themes/shared/datetimeinputpickers.css b/toolkit/themes/shared/datetimeinputpickers.css index f0c4315e5b..05f4ad2e77 100644 --- a/toolkit/themes/shared/datetimeinputpickers.css +++ b/toolkit/themes/shared/datetimeinputpickers.css @@ -315,7 +315,7 @@ button.month-year.active::after { padding: calc((var(--spinner-item-height) - var(--font-size-default)) / 2) 0; margin-bottom: var(--spinner-item-margin-bottom); height: var(--spinner-item-height); - -moz-user-select: none; + user-select: none; scroll-snap-coordinate: 0 0; } diff --git a/toolkit/themes/shared/in-content/common.inc.css b/toolkit/themes/shared/in-content/common.inc.css index ecd961d8da..a34f36bd6f 100644 --- a/toolkit/themes/shared/in-content/common.inc.css +++ b/toolkit/themes/shared/in-content/common.inc.css @@ -655,7 +655,7 @@ xul|*.radio-label-box { padding-bottom: 2px; padding-inline-start: 9px; margin: 0; - -moz-user-select: none; + user-select: none; } *|*.category-icon { @@ -678,7 +678,7 @@ xul|*.radio-label-box { font-weight: normal; line-height: 40px; margin: 0; - -moz-user-select: none; + user-select: none; } /* File fields */ diff --git a/toolkit/themes/shared/plugins/pluginProblem.css b/toolkit/themes/shared/plugins/pluginProblem.css index 9929bd92aa..9e40456d45 100644 --- a/toolkit/themes/shared/plugins/pluginProblem.css +++ b/toolkit/themes/shared/plugins/pluginProblem.css @@ -15,7 +15,7 @@ height: 100%; background-color: rgb(72,72,72); color: white; - -moz-user-select: none; + user-select: none; } .hoverBox {