chrome-devtools-frontend 1.0.934857 → 1.0.936663

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.
Files changed (101) hide show
  1. package/config/gni/all_devtools_files.gni +0 -27
  2. package/config/gni/devtools_grd_files.gni +10 -15
  3. package/front_end/.eslintrc.js +1 -0
  4. package/front_end/Tests.js +13 -0
  5. package/front_end/core/host/UserMetrics.ts +2 -1
  6. package/front_end/core/i18n/locales/en-US.json +15 -6
  7. package/front_end/core/i18n/locales/en-XL.json +15 -6
  8. package/front_end/core/sdk/ConsoleModel.ts +0 -20
  9. package/front_end/entrypoints/devtools_app/devtools_app.json +0 -7
  10. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +1 -1
  11. package/front_end/entrypoints/inspector_main/module.json +1 -2
  12. package/front_end/entrypoints/main/MainImpl.ts +10 -3
  13. package/front_end/entrypoints/node_app/node_app.json +0 -1
  14. package/front_end/entrypoints/node_main/node_main-meta.ts +0 -3
  15. package/front_end/entrypoints/shell/shell.json +0 -9
  16. package/front_end/entrypoints/worker_app/worker_app.json +0 -5
  17. package/front_end/models/issues_manager/IssuesManager.ts +2 -2
  18. package/front_end/models/issues_manager/{DeprecationIssue.ts → NavigatorUserAgentIssue.ts} +4 -4
  19. package/front_end/models/issues_manager/issues_manager.ts +2 -2
  20. package/front_end/panels/application/BackForwardCacheView.ts +54 -6
  21. package/front_end/panels/application/module.json +0 -5
  22. package/front_end/panels/console/ConsoleFilter.ts +1 -1
  23. package/front_end/panels/console/ConsolePinPane.ts +1 -0
  24. package/front_end/panels/console/ConsoleViewMessage.ts +2 -19
  25. package/front_end/panels/console/module.json +0 -2
  26. package/front_end/panels/console_counters/console_counters-meta.ts +0 -3
  27. package/front_end/panels/coverage/CoverageListView.ts +13 -4
  28. package/front_end/panels/coverage/module.json +0 -1
  29. package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +1 -0
  30. package/front_end/panels/css_overview/module.json +1 -2
  31. package/front_end/panels/developer_resources/developer_resources-meta.ts +0 -2
  32. package/front_end/panels/elements/ElementsTreeElement.ts +2 -1
  33. package/front_end/panels/elements/StylesSidebarPane.ts +16 -1
  34. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -0
  35. package/front_end/panels/elements/components/QueryContainer.ts +1 -0
  36. package/front_end/panels/elements/module.json +0 -3
  37. package/front_end/panels/emulation/DeviceModeWrapper.ts +4 -0
  38. package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +18 -2
  39. package/front_end/panels/emulation/module.json +1 -2
  40. package/front_end/panels/help/help-meta.ts +0 -3
  41. package/front_end/panels/input/input-meta.ts +0 -2
  42. package/front_end/panels/media/module.json +0 -1
  43. package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +0 -3
  44. package/front_end/panels/network/module.json +0 -5
  45. package/front_end/panels/performance_monitor/performance_monitor-meta.ts +0 -3
  46. package/front_end/panels/profiler/module.json +1 -3
  47. package/front_end/panels/profiler/profilesPanel.css +1 -1
  48. package/front_end/panels/settings/emulation/devicesSettingsTab.css +1 -1
  49. package/front_end/panels/settings/settings-meta.ts +0 -2
  50. package/front_end/panels/sources/BreakpointEditDialog.ts +1 -0
  51. package/front_end/panels/sources/NavigatorView.ts +8 -8
  52. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +15 -0
  53. package/front_end/panels/sources/module.json +0 -5
  54. package/front_end/panels/sources/watchExpressionsSidebarPane.css +10 -3
  55. package/front_end/panels/timeline/module.json +1 -3
  56. package/front_end/panels/web_audio/web_audio-meta.ts +0 -3
  57. package/front_end/panels/webauthn/webauthn-meta.ts +0 -2
  58. package/front_end/ui/components/buttons/button.css +1 -0
  59. package/front_end/ui/components/docs/create_breadcrumbs.ts +1 -0
  60. package/front_end/ui/components/helpers/get-stylesheet.ts +0 -1
  61. package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -0
  62. package/front_end/ui/components/text_editor/config.ts +3 -1
  63. package/front_end/ui/components/text_editor/theme.ts +5 -0
  64. package/front_end/ui/legacy/TabbedPane.ts +4 -0
  65. package/front_end/ui/legacy/UIUtils.ts +1 -1
  66. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +2 -1
  67. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +6 -1
  68. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +3 -1
  69. package/front_end/ui/legacy/components/data_grid/dataGrid.css +5 -0
  70. package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +2 -1
  71. package/front_end/ui/legacy/components/inline_editor/CSSLength.ts +10 -3
  72. package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +3 -2
  73. package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +5 -1
  74. package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +2 -1
  75. package/front_end/ui/legacy/components/inline_editor/Swatches.ts +4 -2
  76. package/front_end/ui/legacy/components/inline_editor/cssLength.css +30 -9
  77. package/front_end/ui/legacy/components/source_frame/module.json +1 -2
  78. package/front_end/ui/legacy/inspectorCommon.css +2 -12
  79. package/front_end/ui/legacy/softDropDownButton.css +0 -11
  80. package/front_end/ui/legacy/themeColors.css +2 -2
  81. package/package.json +1 -1
  82. package/scripts/build/rollup.config.js +3 -0
  83. package/scripts/eslint_rules/lib/ban_a_tags_in_lit_html.js +47 -0
  84. package/scripts/eslint_rules/tests/ban_a_tags_in_lit_html_test.js +60 -0
  85. package/front_end/entrypoints/node_main/module.json +0 -8
  86. package/front_end/panels/console_counters/module.json +0 -5
  87. package/front_end/panels/developer_resources/module.json +0 -6
  88. package/front_end/panels/event_listeners/module.json +0 -6
  89. package/front_end/panels/help/module.json +0 -5
  90. package/front_end/panels/input/module.json +0 -5
  91. package/front_end/panels/mobile_throttling/module.json +0 -5
  92. package/front_end/panels/performance_monitor/module.json +0 -5
  93. package/front_end/panels/search/module.json +0 -5
  94. package/front_end/panels/settings/module.json +0 -5
  95. package/front_end/panels/web_audio/module.json +0 -5
  96. package/front_end/panels/webauthn/module.json +0 -6
  97. package/front_end/ui/legacy/components/color_picker/module.json +0 -8
  98. package/front_end/ui/legacy/components/cookie_table/module.json +0 -9
  99. package/front_end/ui/legacy/components/data_grid/module.json +0 -8
  100. package/front_end/ui/legacy/components/inline_editor/module.json +0 -14
  101. package/front_end/ui/legacy/components/object_ui/module.json +0 -5
@@ -0,0 +1,47 @@
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
+ function isLitHtmlTemplateCall(taggedTemplateExpression) {
7
+ if (taggedTemplateExpression.name) {
8
+ // Call to html`` and we assume that html = LitHtml's html function.
9
+ return taggedTemplateExpression.name === 'html';
10
+ }
11
+
12
+ // Match calls to LitHtml.html``
13
+ return taggedTemplateExpression.object && taggedTemplateExpression.object.name === 'LitHtml' &&
14
+ taggedTemplateExpression.property.name === 'html';
15
+ }
16
+
17
+ module.exports = {
18
+ meta: {
19
+ type: 'problem',
20
+ docs: {
21
+ description: 'Check for <a> and </a> in Lit templates instead of using x-link.',
22
+ category: 'Possible Errors',
23
+ },
24
+ fixable: 'code',
25
+ schema: [] // no options
26
+ },
27
+ create: function(context) {
28
+ return {
29
+ TaggedTemplateExpression(node) {
30
+ const isLitHtmlCall = isLitHtmlTemplateCall(node.tag);
31
+ if (!isLitHtmlCall) {
32
+ return;
33
+ }
34
+
35
+ // node.quasi.quasis are all the static parts of the template literal.
36
+ for (const templatePart of node.quasi.quasis) {
37
+ if (templatePart.value.raw.includes('<a') || templatePart.value.raw.includes('</a>')) {
38
+ context.report({
39
+ node,
40
+ message: 'Adding links to a component should be done using `front_end/ui/legacy/XLink.ts`',
41
+ });
42
+ }
43
+ }
44
+ },
45
+ };
46
+ }
47
+ };
@@ -0,0 +1,60 @@
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/ban_a_tags_in_lit_html.js');
7
+ const ruleTester = new (require('eslint').RuleTester)({
8
+ parserOptions: {ecmaVersion: 9, sourceType: 'module'},
9
+ parser: require.resolve('@typescript-eslint/parser'),
10
+ });
11
+
12
+ const EXPECTED_ERROR_MESSAGE = 'Adding links to a component should be done using `front_end/ui/legacy/XLink.ts`';
13
+
14
+ ruleTester.run('ban_a_tags_in_lit_html', rule, {
15
+ valid: [
16
+ {
17
+ code: 'LitHtml.html`<p></p>`',
18
+ filename: 'front_end/components/test.ts',
19
+ },
20
+ {
21
+ code: 'LitHtml.html`<input />`',
22
+ filename: 'front_end/components/test.ts',
23
+ },
24
+ {
25
+ code: 'LitHtml.html`<${DataGrid.litTagName}></${DataGrid.litTagName}>`',
26
+ filename: 'front_end/components/test.ts',
27
+ },
28
+ {
29
+ code: 'LitHtml.html`<p><${DataGrid.litTagName}></${DataGrid.litTagName}></p>`',
30
+ filename: 'front_end/components/test.ts',
31
+ },
32
+ {
33
+ code:
34
+ 'LitHtml.html`<${DataGrid1.litTagName}><${DataGrid2.litTagName}></${DataGrid2.litTagName}></${DataGrid1.litTagName}>`',
35
+ filename: 'front_end/components/test.ts',
36
+ }
37
+ ],
38
+ invalid: [
39
+ {
40
+ code: 'LitHtml.html`<a />`',
41
+ filename: 'front_end/components/test.ts',
42
+ errors: [{message: EXPECTED_ERROR_MESSAGE}]
43
+ },
44
+ {
45
+ code: 'LitHtml.html`<a></a>`',
46
+ filename: 'front_end/components/test.ts',
47
+ errors: [{message: EXPECTED_ERROR_MESSAGE}]
48
+ },
49
+ {code: 'LitHtml.html`</a>`', filename: 'front_end/components/test.ts', errors: [{message: EXPECTED_ERROR_MESSAGE}]},
50
+ {code: 'LitHtml.html`<a >`', filename: 'front_end/components/test.ts', errors: [{message: EXPECTED_ERROR_MESSAGE}]},
51
+ {
52
+ code: 'LitHtml.html`<p><${DataGrid.litTagName}></${DataGrid.litTagName}><a></a></p>`',
53
+ errors: [{message: EXPECTED_ERROR_MESSAGE}]
54
+ },
55
+ {
56
+ code: 'LitHtml.html`<${DataGrid.litTagName}><a /></${DataGrid.litTagName}>`',
57
+ errors: [{message: EXPECTED_ERROR_MESSAGE}]
58
+ },
59
+ ]
60
+ });
@@ -1,8 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ],
5
- "resources": [
6
- "nodeConnectionsPanel.css"
7
- ]
8
- }
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ]
5
- }
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy",
4
- "ui/legacy/components/data_grid"
5
- ]
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy",
4
- "ui/legacy/components/object_ui"
5
- ]
6
- }
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ]
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ]
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ]
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ]
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ]
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ]
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ]
5
- }
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy/components/data_grid",
4
- "ui/legacy"
5
- ]
6
- }
@@ -1,8 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ],
5
- "resources": [
6
- "spectrum.css"
7
- ]
8
- }
@@ -1,9 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy",
4
- "ui/legacy/components/data_grid"
5
- ],
6
- "resources": [
7
- "cookiesTable.css"
8
- ]
9
- }
@@ -1,8 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ],
5
- "resources": [
6
- "dataGrid.css"
7
- ]
8
- }
@@ -1,14 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ],
5
- "resources": [
6
- "bezierEditor.css",
7
- "colorSwatch.css",
8
- "bezierSwatch.css",
9
- "cssShadowSwatch.css",
10
- "cssShadowEditor.css",
11
- "fontEditor.css",
12
- "swatchPopover.css"
13
- ]
14
- }
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": [
3
- "ui/legacy"
4
- ]
5
- }