chrome-devtools-frontend 1.0.955630 → 1.0.956881
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTHORS +1 -0
- package/config/gni/devtools_grd_files.gni +0 -2
- package/front_end/.eslintrc.js +1 -11
- package/front_end/Images/generate-css-vars.js +2 -2
- package/front_end/core/common/ParsedURL.ts +35 -2
- package/front_end/core/common/Settings.ts +1 -1
- package/front_end/core/host/InspectorFrontendHost.ts +2 -1
- package/front_end/core/i18n/i18nImpl.ts +2 -3
- package/front_end/core/i18n/locales/en-US.json +0 -3
- package/front_end/core/i18n/locales/en-XL.json +0 -3
- package/front_end/core/root/Runtime.ts +0 -72
- package/front_end/core/root/root-legacy.ts +0 -2
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +10 -0
- package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +3 -4
- package/front_end/entrypoints/lighthouse_worker/LighthouseService.ts +4 -7
- package/front_end/entrypoints/main/MainImpl.ts +21 -13
- package/front_end/entrypoints/main/main-meta.ts +1 -1
- package/front_end/generated/protocol.d.ts +1 -0
- package/front_end/global_typings/global_defs.d.ts +0 -1
- package/front_end/models/extensions/ExtensionServer.ts +1 -22
- package/front_end/models/formatter/FormatterWorkerPool.ts +2 -12
- package/front_end/models/formatter/ScriptFormatter.ts +3 -3
- package/front_end/models/issues_manager/DeprecationIssue.ts +7 -7
- package/front_end/panels/console/ConsoleSidebar.ts +9 -9
- package/front_end/panels/elements/ElementsPanel.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +5 -4
- package/front_end/panels/elements/components/LayoutPane.ts +1 -1
- package/front_end/panels/emulation/AdvancedApp.ts +2 -2
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -1
- package/front_end/panels/sources/SourcesPanel.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +19 -0
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +7 -1
- package/front_end/third_party/acorn/acorn.ts +1 -1
- package/front_end/ui/legacy/GlassPane.ts +0 -1
- package/front_end/ui/legacy/ResizerWidget.ts +4 -2
- package/front_end/ui/legacy/SoftDropDown.ts +2 -1
- package/front_end/ui/legacy/TextPrompt.ts +2 -2
- package/front_end/ui/legacy/Treeoutline.ts +9 -15
- package/front_end/ui/legacy/UIUtils.ts +17 -24
- package/front_end/ui/legacy/ViewManager.ts +1 -1
- package/front_end/ui/legacy/Widget.ts +3 -2
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +5 -5
- package/front_end/ui/legacy/components/color_picker/spectrum.css +5 -2
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -0
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +13 -18
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +1 -2
- package/front_end/ui/legacy/components/perf_ui/flameChart.css +8 -0
- package/front_end/ui/legacy/components/source_frame/FontView.ts +0 -1
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +0 -1
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +0 -1
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +0 -1
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +0 -2
- package/front_end/ui/legacy/inspectorSyntaxHighlight.css +8 -11
- package/front_end/ui/legacy/softContextMenu.css +4 -1
- package/front_end/ui/legacy/tabbedPane.css +1 -0
- package/front_end/ui/legacy/themeColors.css +3 -1
- package/front_end/ui/legacy/theme_support/theme_support_impl.ts +24 -234
- package/front_end/ui/legacy/treeoutline.css +0 -4
- package/front_end/ui/legacy/utils/create-shadow-root-with-core-styles.ts +3 -2
- package/front_end/ui/legacy/utils/inject-core-styles.ts +3 -31
- package/front_end/ui/legacy/utils/utils.ts +1 -5
- package/front_end/ui/lit-html/lit-html.ts +1 -1
- package/package.json +1 -1
- package/scripts/build/generate_css_js_files.js +2 -2
- package/scripts/build/ninja/generate_css.gni +3 -0
- package/scripts/component_server/server.js +2 -2
- package/scripts/eslint_rules/lib/no_bound_component_methods.js +116 -0
- package/scripts/eslint_rules/tests/no_bound_component_methods_test.js +85 -0
- package/front_end/global_typings/intl_display_names.d.ts +0 -111
- package/front_end/ui/legacy/inspectorSyntaxHighlightDark.css +0 -270
- package/front_end/ui/legacy/utils/append-style.ts +0 -9
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Copyright 2021 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
meta: {
|
|
8
|
+
type: 'problem',
|
|
9
|
+
docs: {
|
|
10
|
+
description: 'Enforce that no methods that are used as LitHtml events are bound.',
|
|
11
|
+
category: 'Possible Errors',
|
|
12
|
+
},
|
|
13
|
+
fixable: 'code',
|
|
14
|
+
schema: [], // no options
|
|
15
|
+
messages: {
|
|
16
|
+
nonRenderBindFound:
|
|
17
|
+
'Found bound method name {{ methodName }} on {{ componentName }} that was not `render`. Lit-Html binds all event handlers for you automatically so this is not required.',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
create: function(context) {
|
|
21
|
+
function nodeIsHTMLElementClassDeclaration(node) {
|
|
22
|
+
return node.type === 'ClassDeclaration' && node.superClass && node.superClass.name === 'HTMLElement';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const classesToCheck = new Set();
|
|
26
|
+
|
|
27
|
+
// Store any method names that were passed to addEventListener.
|
|
28
|
+
// With the following code:
|
|
29
|
+
// window.addEventListener('click', this.boundOnClick)
|
|
30
|
+
// we would add `boundOnClick` to this set.
|
|
31
|
+
const addEventListenerCallPropertyNames = new Set();
|
|
32
|
+
|
|
33
|
+
function checkPropertyDeclarationForBinding(className, node) {
|
|
34
|
+
if (!node.value || node.value.type !== 'CallExpression') {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (node.value.callee.type !== 'MemberExpression') {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (node.value.callee.property.name !== 'bind') {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// At this point we know it's a property of the form:
|
|
44
|
+
// someBoundThing = this.thing.bind(X)
|
|
45
|
+
// and now we want to check that the argument passed to bind is `this`.
|
|
46
|
+
// If the argument to bind is not `this`, we leave it be and move on.
|
|
47
|
+
if (node.value.arguments[0]?.type !== 'ThisExpression') {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// At this point it's definitely of the form:
|
|
52
|
+
// someBoundThing = this.thing.bind(this)
|
|
53
|
+
// But we know that `render` may be bound for the scheduler, so if it's render we can move on
|
|
54
|
+
if (node.value.callee.object.property.name === 'render') {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Now it's an error UNLESS we found a call to
|
|
59
|
+
// addEventListener(x, this.#boundFoo),
|
|
60
|
+
// in which case it's allowed.
|
|
61
|
+
|
|
62
|
+
// Get the property name for the bound method
|
|
63
|
+
// #boundFoo = this.foo.bind(this);
|
|
64
|
+
// node.key.name === 'boundFoo';
|
|
65
|
+
const boundPropertyName = node.key.name;
|
|
66
|
+
if (addEventListenerCallPropertyNames.has(boundPropertyName)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
context.report({
|
|
71
|
+
node: node,
|
|
72
|
+
messageId: 'nonRenderBindFound',
|
|
73
|
+
data: {componentName: className, methodName: node.value.callee.object.property.name}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function checkClassForBoundMethods(classDeclarationNode) {
|
|
78
|
+
const classPropertyDeclarations = classDeclarationNode.body.body.filter(node => {
|
|
79
|
+
return node.type === 'PropertyDefinition';
|
|
80
|
+
});
|
|
81
|
+
for (const decl of classPropertyDeclarations) {
|
|
82
|
+
checkPropertyDeclarationForBinding(classDeclarationNode.id.name, decl);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
ClassDeclaration(classDeclarationNode) {
|
|
88
|
+
if (!nodeIsHTMLElementClassDeclaration(classDeclarationNode)) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
classesToCheck.add(classDeclarationNode);
|
|
93
|
+
},
|
|
94
|
+
'CallExpression[callee.type=\'MemberExpression\'][callee.property.name=\'addEventListener\']'(
|
|
95
|
+
callExpressionNode) {
|
|
96
|
+
const methodArg = callExpressionNode.arguments[1];
|
|
97
|
+
// Confirm that the argument is this.X, otherwise skip it
|
|
98
|
+
if (methodArg.type !== 'MemberExpression') {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Get the property from the addEventListener call
|
|
103
|
+
// window.addEventListener('click', this.#boundFoo)
|
|
104
|
+
// This will be the node representing `#boundFoo`
|
|
105
|
+
// and its `.name` property will be `boundFoo`
|
|
106
|
+
const propertyArg = methodArg.property;
|
|
107
|
+
addEventListenerCallPropertyNames.add(propertyArg.name);
|
|
108
|
+
},
|
|
109
|
+
'Program:exit'() {
|
|
110
|
+
for (const classNode of classesToCheck) {
|
|
111
|
+
checkClassForBoundMethods(classNode);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Copyright 2021 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
const rule = require('../lib/no_bound_component_methods.js');
|
|
7
|
+
const ruleTester = new (require('eslint').RuleTester)({
|
|
8
|
+
parserOptions: {ecmaVersion: 9, sourceType: 'module'},
|
|
9
|
+
parser: require.resolve('@typescript-eslint/parser'),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
ruleTester.run('no_bound_component_methods', rule, {
|
|
13
|
+
valid: [
|
|
14
|
+
{
|
|
15
|
+
code: `export class FeedbackButton extends SomeOtherNonElementThing {
|
|
16
|
+
readonly #boundClick = this.onClick.bind(this);
|
|
17
|
+
}`,
|
|
18
|
+
filename: 'front_end/components/test.ts',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
code: `export class FeedbackButton extends HTMLElement {
|
|
22
|
+
readonly #boundRender = this.render.bind(this);
|
|
23
|
+
private readonly shadow = this.attachShadow({mode: 'open'});
|
|
24
|
+
private frame?: SDK.ResourceTreeModel.ResourceTreeFrame;
|
|
25
|
+
}`,
|
|
26
|
+
filename: 'front_end/components/test.ts',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
code: `export class FeedbackButton extends HTMLElement {
|
|
30
|
+
readonly #boundRender = this.render.bind(this);
|
|
31
|
+
#globalBoundThing = this.someEvent.bind(this);
|
|
32
|
+
private readonly shadow = this.attachShadow({mode: 'open'});
|
|
33
|
+
|
|
34
|
+
constructor() {
|
|
35
|
+
window.addEventListener('click', this.#globalBoundThing);
|
|
36
|
+
}
|
|
37
|
+
}`,
|
|
38
|
+
filename: 'front_end/components/test.ts',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
code: `export class FeedbackButton extends HTMLElement {
|
|
42
|
+
readonly #boundRender = this.render.bind(this);
|
|
43
|
+
private globalBoundThing = this.someEvent.bind(this);
|
|
44
|
+
private readonly shadow = this.attachShadow({mode: 'open'});
|
|
45
|
+
|
|
46
|
+
constructor() {
|
|
47
|
+
window.addEventListener('click', this.globalBoundThing);
|
|
48
|
+
}
|
|
49
|
+
}`,
|
|
50
|
+
filename: 'front_end/components/test.ts',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
invalid: [
|
|
54
|
+
{
|
|
55
|
+
code: `export class FeedbackButton extends HTMLElement {
|
|
56
|
+
static readonly litTagName = LitHtml.literal\`devtools-feedback-button\`;
|
|
57
|
+
readonly #boundRender = this.render.bind(this);
|
|
58
|
+
readonly #boundClick = this.onClick.bind(this);
|
|
59
|
+
}`,
|
|
60
|
+
filename: 'front_end/components/test.ts',
|
|
61
|
+
errors: [{messageId: 'nonRenderBindFound', data: {componentName: 'FeedbackButton', methodName: 'onClick'}}]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
code: `export class FeedbackButton extends HTMLElement {
|
|
65
|
+
static readonly litTagName = LitHtml.literal\`devtools-feedback-button\`;
|
|
66
|
+
private readonly boundClick = this.onClick.bind(this);
|
|
67
|
+
}`,
|
|
68
|
+
filename: 'front_end/components/test.ts',
|
|
69
|
+
errors: [{messageId: 'nonRenderBindFound', data: {componentName: 'FeedbackButton', methodName: 'onClick'}}]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
code: `export class FeedbackButton extends HTMLElement {
|
|
73
|
+
static readonly litTagName = LitHtml.literal\`devtools-feedback-button\`;
|
|
74
|
+
private readonly boundClick = this.onClick.bind(this);
|
|
75
|
+
private readonly boundFocus = this.onFocus.bind(this);
|
|
76
|
+
|
|
77
|
+
constructor() {
|
|
78
|
+
this.addEventListener('click', this.boundClick);
|
|
79
|
+
}
|
|
80
|
+
}`,
|
|
81
|
+
filename: 'front_end/components/test.ts',
|
|
82
|
+
errors: [{messageId: 'nonRenderBindFound', data: {componentName: 'FeedbackButton', methodName: 'onFocus'}}]
|
|
83
|
+
},
|
|
84
|
+
]
|
|
85
|
+
});
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
declare namespace Intl {
|
|
2
|
-
/**
|
|
3
|
-
* An object with properties reflecting the locale
|
|
4
|
-
* and styles options computed during initialization
|
|
5
|
-
* of the `Intl.DisplayNames` object
|
|
6
|
-
*
|
|
7
|
-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/resolvedOptions#Description).
|
|
8
|
-
*
|
|
9
|
-
* [Specification](https://tc39.es/ecma402/#sec-intl-displaynames-constructor)
|
|
10
|
-
*/
|
|
11
|
-
interface DisplayNamesOptions {
|
|
12
|
-
localeMatcher: RelativeTimeFormatLocaleMatcher;
|
|
13
|
-
style: RelativeTimeFormatStyle;
|
|
14
|
-
type: 'language'|'region'|'script'|'currency';
|
|
15
|
-
fallback: 'code'|'none';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface DisplayNames {
|
|
19
|
-
/**
|
|
20
|
-
* Receives a code and returns a string based on the locale and options provided when instantiating
|
|
21
|
-
* [`Intl.DisplayNames()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames)
|
|
22
|
-
*
|
|
23
|
-
* @param code The `code` to provide depends on the `type`:
|
|
24
|
-
* - If the type is "region", code should be either an [ISO-3166 two letters region code](https://www.iso.org/iso-3166-country-codes.html),
|
|
25
|
-
* or a [three digits UN M49 Geographic Regions](https://unstats.un.org/unsd/methodology/m49/).
|
|
26
|
-
* - If the type is "script", code should be an [ISO-15924 four letters script code](https://unicode.org/iso15924/iso15924-codes.html).
|
|
27
|
-
* - If the type is "language", code should be a `languageCode` ["-" `scriptCode`] ["-" `regionCode` ] *("-" `variant` )
|
|
28
|
-
* subsequence of the unicode_language_id grammar in [UTS 35's Unicode Language and Locale Identifiers grammar](https://unicode.org/reports/tr35/#Unicode_language_identifier).
|
|
29
|
-
* `languageCode` is either a two letters ISO 639-1 language code or a three letters ISO 639-2 language code.
|
|
30
|
-
* - If the type is "currency", code should be a [3-letter ISO 4217 currency code](https://www.iso.org/iso-4217-currency-codes.html).
|
|
31
|
-
*
|
|
32
|
-
* @returns A language-specific formatted string.
|
|
33
|
-
*
|
|
34
|
-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/of).
|
|
35
|
-
*
|
|
36
|
-
* [Specification](https://tc39.es/ecma402/#sec-Intl.DisplayNames.prototype.of).
|
|
37
|
-
*/
|
|
38
|
-
of(code: string): string;
|
|
39
|
-
/**
|
|
40
|
-
* Returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current
|
|
41
|
-
* [`Intl/DisplayNames`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames) object.
|
|
42
|
-
*
|
|
43
|
-
* @returns An object with properties reflecting the locale and formatting options computed during the construction of the
|
|
44
|
-
* given [`Intl/DisplayNames`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames) object.
|
|
45
|
-
*
|
|
46
|
-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/resolvedOptions).
|
|
47
|
-
*
|
|
48
|
-
* [Specification](https://tc39.es/ecma402/#sec-Intl.DisplayNames.prototype.resolvedOptions)
|
|
49
|
-
*/
|
|
50
|
-
resolvedOptions(): DisplayNamesOptions;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* The [`Intl.DisplayNames()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames)
|
|
55
|
-
* object enables the consistent translation of language, region and script display names.
|
|
56
|
-
*
|
|
57
|
-
* Part of [Intl object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl)
|
|
58
|
-
* namespace and the [ECMAScript Internationalization API](https://www.ecma-international.org/publications/standards/Ecma-402.htm).
|
|
59
|
-
*
|
|
60
|
-
* [Compatibility](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames#browser_compatibility).
|
|
61
|
-
*/
|
|
62
|
-
const DisplayNames: {
|
|
63
|
-
prototype: DisplayNames;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Constructor creates [`Intl.DisplayNames`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames)
|
|
67
|
-
* objects that enable the consistent translation of language, region and script display names.
|
|
68
|
-
*
|
|
69
|
-
* @param locales A string with a BCP 47 language tag, or an array of such strings.
|
|
70
|
-
* For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)
|
|
71
|
-
* page. The following Unicode extension key is allowed:
|
|
72
|
-
* - `nu` The numbering system to be used. Possible values include: `"arab"`, `"arabext"`, `"bali"`, `"beng"`, `"deva"`, `"fullwide"`, `"gujr"`, `"guru"`, `"hanidec"`, `"khmr"`, `"knda"`, `"laoo"`, `"latn"`, `"limb"`, `"mlym"`, `"mong"`, `"mymr"`, `"orya"`, `"tamldec"`, `"telu"`, `"thai"`, `"tibt"`.
|
|
73
|
-
*
|
|
74
|
-
* @param options An object with some or all of the following properties:
|
|
75
|
-
* - `localeMatcher` The locale matching algorithm to use. Possible values are `"lookup"` and `"best fit"`; the default is `"best fit"`.
|
|
76
|
-
* For information about this option, see the [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) page.
|
|
77
|
-
* - `style` The formatting style to use, the default is `"long"`. `"narrow"` `"short"` `"long"`
|
|
78
|
-
* - `type` The type to use. `"language"` `"region"` `"script"` `"currency"`
|
|
79
|
-
* - `fallback` The fallback to use, the default is `"code"`. `"code"` `"none"`
|
|
80
|
-
*
|
|
81
|
-
* @returns [Intl.DisplayNames](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames) object.
|
|
82
|
-
*
|
|
83
|
-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames).
|
|
84
|
-
*
|
|
85
|
-
* [Specification](https://tc39.es/ecma402/#sec-intl-displaynames-constructor).
|
|
86
|
-
*/
|
|
87
|
-
new (locales?: UnicodeBCP47LocaleIdentifier|UnicodeBCP47LocaleIdentifier[], options?: Partial<DisplayNamesOptions>):
|
|
88
|
-
DisplayNames;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Returns an array containing those of the provided locales that are supported in display names without having to fall back to the runtime's default locale.
|
|
92
|
-
*
|
|
93
|
-
* @param locales A string with a BCP 47 language tag, or an array of such strings.
|
|
94
|
-
* For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)
|
|
95
|
-
* page.
|
|
96
|
-
*
|
|
97
|
-
* @param options An object that may have the following property:
|
|
98
|
-
* - `localeMatcher` The locale matching algorithm to use. Possible values are `"lookup"` and `"best fit"`; the default is `"best fit"`.
|
|
99
|
-
* For information about this option, see the [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) page.
|
|
100
|
-
*
|
|
101
|
-
* @returns An array of strings representing a subset of the given locale tags that are supported in display names without having to fall back to the runtime's default locale.
|
|
102
|
-
*
|
|
103
|
-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
|
|
104
|
-
*
|
|
105
|
-
* [Specification](https://tc39.es/ecma402/#sec-Intl.DisplayNames.supportedLocalesOf).
|
|
106
|
-
*/
|
|
107
|
-
supportedLocalesOf(
|
|
108
|
-
locales: UnicodeBCP47LocaleIdentifier|UnicodeBCP47LocaleIdentifier[],
|
|
109
|
-
options: {localeMatcher: RelativeTimeFormatLocaleMatcher}): UnicodeBCP47LocaleIdentifier[];
|
|
110
|
-
};
|
|
111
|
-
}
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2015 The Chromium Authors. All rights reserved.
|
|
3
|
-
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
.cm-js-atom {
|
|
8
|
-
color: rgb(161 247 181); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.cm-js-attribute {
|
|
12
|
-
color: rgb(97 148 198); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.cm-js-builtin {
|
|
16
|
-
color: rgb(159 180 214); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.cm-js-comment {
|
|
20
|
-
color: rgb(116 116 116); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.cm-js-def {
|
|
24
|
-
color: var(--color-token-tag);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.cm-js-keyword {
|
|
28
|
-
color: rgb(154 127 213); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.cm-js-link {
|
|
32
|
-
color: rgb(159 180 214); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.cm-js-meta {
|
|
36
|
-
color: rgb(221 251 85); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.cm-js-number {
|
|
40
|
-
color: rgb(161 247 181); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.cm-js-operator {
|
|
44
|
-
color: rgb(210 192 87); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.cm-js-property {
|
|
48
|
-
color: rgb(210 192 87); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.cm-js-string {
|
|
52
|
-
color: rgb(242 139 84); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.cm-js-string-2 {
|
|
56
|
-
color: rgb(242 139 84); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.cm-js-tag {
|
|
60
|
-
color: var(--color-token-tag);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.cm-js-variable {
|
|
64
|
-
color: rgb(217 217 217); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.cm-js-variable-2 {
|
|
68
|
-
color: rgb(217 217 217); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.cm-atom {
|
|
72
|
-
color: rgb(161 247 181); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.cm-comment {
|
|
76
|
-
color: rgb(116 116 116); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.cm-variable {
|
|
80
|
-
color: rgb(217 217 217); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.cm-keyword {
|
|
84
|
-
color: rgb(154 127 213); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.cm-number {
|
|
88
|
-
color: rgb(161 247 181); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.cm-operator {
|
|
92
|
-
color: rgb(210 192 87); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.cm-css-atom {
|
|
96
|
-
color: rgb(217 217 217); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.cm-css-builtin {
|
|
100
|
-
color: rgb(255 163 79); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.cm-css-def {
|
|
104
|
-
color: rgb(255 163 79); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.cm-css-comment {
|
|
108
|
-
color: rgb(116 116 116); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.cm-css-meta {
|
|
112
|
-
color: rgb(132 240 255); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.cm-css-number {
|
|
116
|
-
color: rgb(217 217 217); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.cm-css-operator {
|
|
120
|
-
color: rgb(217 217 217); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.cm-css-property {
|
|
124
|
-
color: rgb(132 240 255); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.cm-css-qualifier {
|
|
128
|
-
color: rgb(255 163 79); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.cm-css-string {
|
|
132
|
-
color: rgb(231 194 111); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.cm-css-string-2 {
|
|
136
|
-
color: rgb(217 217 217); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.cm-css-tag {
|
|
140
|
-
color: rgb(255 163 79); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.cm-css-variable {
|
|
144
|
-
color: rgb(255 163 79); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.cm-css-variable-2 {
|
|
148
|
-
color: rgb(255 163 79); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.cm-xml-comment {
|
|
152
|
-
color: rgb(137 137 137); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.cm-xml-error {
|
|
156
|
-
color: rgb(198 95 95); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.cm-xml-string {
|
|
160
|
-
color: rgb(242 151 102); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.cm-xml-tag {
|
|
164
|
-
color: var(--color-token-tag);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.cm-xml-attribute {
|
|
168
|
-
color: var(--color-token-attribute);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.cm-xml-link {
|
|
172
|
-
color: rgb(231 194 111); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.webkit-html-attribute-name {
|
|
176
|
-
color: var(--color-token-attribute);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.webkit-html-attribute-value {
|
|
180
|
-
color: rgb(242 151 102); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.webkit-html-comment {
|
|
184
|
-
color: rgb(137 137 137); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.webkit-html-tag {
|
|
188
|
-
color: var(--color-token-tag);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.webkit-html-tag-name {
|
|
192
|
-
color: var(--color-token-tag);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.webkit-html-close-tag-name {
|
|
196
|
-
color: var(--color-token-tag);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.webkit-html-text-node {
|
|
200
|
-
color: rgb(207 208 208); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.webkit-html-css-node {
|
|
204
|
-
color: rgb(207 208 208); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.webkit-html-js-node {
|
|
208
|
-
color: rgb(207 208 208); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.webkit-html-pseudo-element {
|
|
212
|
-
color: rgb(237 119 229); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.webkit-css-property {
|
|
216
|
-
color: var(--webkit-css-property-color, rgb(53 212 199)); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.cm-def {
|
|
220
|
-
color: var(--color-token-tag);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.cm-header {
|
|
224
|
-
color: var(--color-token-tag);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.cm-variable-2 {
|
|
228
|
-
color: #05a; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.cm-variable-3,
|
|
232
|
-
.cm-type {
|
|
233
|
-
color: rgb(93 176 215); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.cm-string {
|
|
237
|
-
color: rgb(242 139 84); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.cm-meta {
|
|
241
|
-
color: rgb(221 251 85); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.cm-qualifier {
|
|
245
|
-
color: rgb(255 163 79); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
.cm-builtin {
|
|
249
|
-
color: rgb(159 180 214); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.cm-bracket {
|
|
253
|
-
color: #997; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.cm-tag {
|
|
257
|
-
color: var(--color-token-tag);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
.cm-attribute {
|
|
261
|
-
color: rgb(97 148 198); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.cm-hr {
|
|
265
|
-
color: #999; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.cm-link {
|
|
269
|
-
color: rgb(159 180 214); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
270
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// Copyright 2019 The Chromium Authors. All rights reserved.
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
export function appendStyle(node: Node, {cssContent}: {cssContent: string}): void {
|
|
6
|
-
const styleElement = document.createElement('style');
|
|
7
|
-
styleElement.textContent = cssContent;
|
|
8
|
-
node.appendChild(styleElement);
|
|
9
|
-
}
|