Add cssnano
The CSS minifier we currently use (clean-css) is not maintained and
lacks support for new CSS features. CSSNano is a replacement that
supports features we need (primarily container queries).
This CL only adds the relevant dependencies, and does not use it. I will
do that (and remove clean-css) in a follow-up.
Bug: 1399763
Change-Id: I899ecc4482164404dd5ac2fd13f92fb797978e29
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4092305
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
diff --git a/node_modules/postcss-selector-parser/API.md b/node_modules/postcss-selector-parser/API.md
index 6aa1f14..36c7298 100644
--- a/node_modules/postcss-selector-parser/API.md
+++ b/node_modules/postcss-selector-parser/API.md
@@ -395,16 +395,18 @@
### `container.atPosition(line, column)`
-Returns the node at the source position `index`.
+Returns the node at the source position `line` and `column`.
```js
-selector.at(0) === selector.first;
-selector.at(0) === selector.nodes[0];
+// Input: :not(.foo),\n#foo > :matches(ol, ul)
+selector.atPosition(1, 1); // => :not(.foo)
+selector.atPosition(2, 1); // => \n#foo
```
Arguments:
-* `index`: The index of the node to return.
+* `line`: The line number of the node to return.
+* `column`: The column number of the node to return.
### `container.index(node)`
diff --git a/node_modules/postcss-selector-parser/CHANGELOG.md b/node_modules/postcss-selector-parser/CHANGELOG.md
index b97f69a..eff9d86 100644
--- a/node_modules/postcss-selector-parser/CHANGELOG.md
+++ b/node_modules/postcss-selector-parser/CHANGELOG.md
@@ -1,3 +1,15 @@
+# 6.0.11
+
+- Fixed: parse attribute case insensitivity flag
+
+# 6.0.10
+
+- Fixed: `isPseudoElement()` supports `:first-letter` and `:first-line`
+
+# 6.0.9
+
+- Fixed: `Combinator.raws` property type
+
# 6.0.8
- Fixed: reduced size
diff --git a/node_modules/postcss-selector-parser/dist/parser.js b/node_modules/postcss-selector-parser/dist/parser.js
index e0451de..b97a0fa 100644
--- a/node_modules/postcss-selector-parser/dist/parser.js
+++ b/node_modules/postcss-selector-parser/dist/parser.js
@@ -344,7 +344,7 @@
}
lastAdded = 'attribute';
- } else if (!node.value && node.value !== "" || lastAdded === "value" && !spaceAfterMeaningfulToken) {
+ } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) {
var _unescaped = (0, _util.unesc)(content);
var _oldRawValue = (0, _util.getProp)(node, 'raws', 'value') || '';
@@ -532,8 +532,8 @@
return nodes;
}
/**
- *
- * @param {*} nodes
+ *
+ * @param {*} nodes
*/
;
diff --git a/node_modules/postcss-selector-parser/dist/selectors/attribute.js b/node_modules/postcss-selector-parser/dist/selectors/attribute.js
index 8f535e5..9edc30b 100644
--- a/node_modules/postcss-selector-parser/dist/selectors/attribute.js
+++ b/node_modules/postcss-selector-parser/dist/selectors/attribute.js
@@ -441,7 +441,8 @@
key: "value",
get: function get() {
return this._value;
- }
+ },
+ set:
/**
* Before 3.0, the value had to be set to an escaped value including any wrapped
* quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value
@@ -454,8 +455,7 @@
* Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe
* how the new value is quoted.
*/
- ,
- set: function set(v) {
+ function set(v) {
if (this._constructed) {
var _unescapeValue2 = unescapeValue(v),
deprecatedUsage = _unescapeValue2.deprecatedUsage,
@@ -479,6 +479,31 @@
}
}
}, {
+ key: "insensitive",
+ get: function get() {
+ return this._insensitive;
+ }
+ /**
+ * Set the case insensitive flag.
+ * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag`
+ * of the attribute is updated accordingly.
+ *
+ * @param {true | false} insensitive true if the attribute should match case-insensitively.
+ */
+ ,
+ set: function set(insensitive) {
+ if (!insensitive) {
+ this._insensitive = false; // "i" and "I" can be used in "this.raws.insensitiveFlag" to store the original notation.
+ // When setting `attr.insensitive = false` both should be erased to ensure correct serialization.
+
+ if (this.raws && (this.raws.insensitiveFlag === 'I' || this.raws.insensitiveFlag === 'i')) {
+ this.raws.insensitiveFlag = undefined;
+ }
+ }
+
+ this._insensitive = insensitive;
+ }
+ }, {
key: "attribute",
get: function get() {
return this._attribute;
diff --git a/node_modules/postcss-selector-parser/dist/selectors/guards.js b/node_modules/postcss-selector-parser/dist/selectors/guards.js
index aa76912..c949af5 100644
--- a/node_modules/postcss-selector-parser/dist/selectors/guards.js
+++ b/node_modules/postcss-selector-parser/dist/selectors/guards.js
@@ -48,7 +48,7 @@
exports.isUniversal = isUniversal;
function isPseudoElement(node) {
- return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after");
+ return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line");
}
function isPseudoClass(node) {
diff --git a/node_modules/postcss-selector-parser/package.json b/node_modules/postcss-selector-parser/package.json
index 59b630d..9655072 100644
--- a/node_modules/postcss-selector-parser/package.json
+++ b/node_modules/postcss-selector-parser/package.json
@@ -1,6 +1,6 @@
{
"name": "postcss-selector-parser",
- "version": "6.0.8",
+ "version": "6.0.11",
"devDependencies": {
"@babel/cli": "^7.11.6",
"@babel/core": "^7.11.6",
diff --git a/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts b/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts
index 383e222..89a2c52 100644
--- a/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts
+++ b/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts
@@ -339,8 +339,16 @@
function selector(opts: ContainerOptions): Selector;
function isSelector(node: any): node is Selector;
+ interface CombinatorRaws {
+ value?: string;
+ spaces?: {
+ before?: string;
+ after?: string;
+ };
+ }
interface Combinator extends Base {
- type: "combinator"
+ type: "combinator";
+ raws?: CombinatorRaws;
}
function combinator(opts: NodeOptions): Combinator;
function isCombinator(node: any): node is Combinator;