Add stylelint dependency
This also adds CC-BY-4.0 to the list of accepted licenses.
DISABLE_THIRD_PARTY_CHECK=update dependencies
Bug: chromium:1083142
Change-Id: I8612de2fba52dae32eeb71af79d5aacfde52142b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2220097
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
diff --git a/node_modules/postcss-resolve-nested-selector/LICENSE b/node_modules/postcss-resolve-nested-selector/LICENSE
new file mode 100644
index 0000000..420486d
--- /dev/null
+++ b/node_modules/postcss-resolve-nested-selector/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 David Clark
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/postcss-resolve-nested-selector/README.md b/node_modules/postcss-resolve-nested-selector/README.md
new file mode 100644
index 0000000..7d24f46
--- /dev/null
+++ b/node_modules/postcss-resolve-nested-selector/README.md
@@ -0,0 +1,65 @@
+# postcss-resolve-nested-selector
+
+[](https://travis-ci.org/davidtheclark/postcss-resolve-nested-selector)
+
+Given a (nested) selector in a PostCSS AST, return an array of resolved selectors.
+
+Tested to work with the syntax of
+[postcss-nested](https://github.com/postcss/postcss-nested)
+and [postcss-nesting](https://github.com/jonathantneal/postcss-nesting).
+Should also work with SCSS and Less syntax. If you'd like to help out by
+adding some automated tests for those, that'd be swell. In fact, if you'd
+like to add any automated tests, you are a winner!
+
+## API
+
+`resolveNestedSelector(selector, node)`
+
+Returns an array of selectors resolved from `selector`.
+
+For example, given this JS:
+
+```js
+var resolvedNestedSelector = require('postcss-resolve-nested-selector');
+postcssRoot.eachRule(function(rule) {
+ rule.selectors.forEach(function(selector) {
+ console.log(resolvedNestedSelector(selector, rule));
+ });
+});
+```
+
+And the following CSS:
+
+```scss
+.foo {
+ .bar {
+ color: pink;
+ }
+}
+```
+
+This should log:
+
+```
+['.foo']
+['.foo .bar']
+```
+
+Or with this CSS:
+
+```scss
+.foo {
+ .bar &,
+ a {
+ color: pink;
+ }
+}
+```
+
+This should log:
+
+```
+['.foo']
+['.bar .foo']
+['.foo a']
+```
diff --git a/node_modules/postcss-resolve-nested-selector/index.js b/node_modules/postcss-resolve-nested-selector/index.js
new file mode 100644
index 0000000..8659841
--- /dev/null
+++ b/node_modules/postcss-resolve-nested-selector/index.js
@@ -0,0 +1,25 @@
+module.exports = function resolveNestedSelector(selector, node) {
+ var parent = node.parent;
+ var parentIsNestAtRule = parent.type === 'atrule' && parent.name === 'nest';
+
+ if (parent.type === 'root') return [selector];
+ if (parent.type !== 'rule' && !parentIsNestAtRule) return resolveNestedSelector(selector, parent);
+
+ var parentSelectors = (parentIsNestAtRule)
+ ? parent.params.split(',').map(function(s) { return s.trim(); })
+ : parent.selectors;
+
+ var resolvedSelectors = parentSelectors.reduce(function(result, parentSelector) {
+ if (selector.indexOf('&') !== -1) {
+ var newlyResolvedSelectors = resolveNestedSelector(parentSelector, parent).map(function(resolvedParentSelector) {
+ return selector.replace(/&/g, resolvedParentSelector);
+ });
+ return result.concat(newlyResolvedSelectors);
+ }
+
+ var combinedSelector = [ parentSelector, selector ].join(' ');
+ return result.concat(resolveNestedSelector(combinedSelector, parent));
+ }, []);
+
+ return resolvedSelectors;
+}
diff --git a/node_modules/postcss-resolve-nested-selector/package.json b/node_modules/postcss-resolve-nested-selector/package.json
new file mode 100644
index 0000000..a9112c8
--- /dev/null
+++ b/node_modules/postcss-resolve-nested-selector/package.json
@@ -0,0 +1,20 @@
+{
+ "author": "David Clark",
+ "description": "Resolve a nested selector in a PostCSS AST",
+ "devDependencies": {
+ "ava": "0.12.0",
+ "postcss": "5.0.16",
+ "postcss-nested": "1.0.0",
+ "postcss-nesting": "2.2.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "postcss-resolve-nested-selector",
+ "scripts": {
+ "test": "ava test/*-test.js"
+ },
+ "version": "0.1.1"
+}
\ No newline at end of file