Commit Graph
82 Commits
Author SHA1 Message Date
Tim van der Lippe 05149e9772 Remove ls from legacy-defs
This adds all missing imports for `ls` to all files. After this change,
all usages of `ls` will now properly be resolved to a LocalizedString
rather than a normal string.

R=jacktfranklin@chromium.org

No-Presubmit: True
Change-Id: Icf6d8c3b8bea1f9e66f4b6b58e4ae4c7f99e6f9c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2629554
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-01-15 12:53:50 +00:00
Tim van der Lippe d7cfd14814 Fix no-implicit-coercion errors in front_end/
R=jacktfranklin@chromium.org

No-Presubmit: True
Bug: 1082789
Change-Id: Ic77884bf7e9b5dc74053915b3b10699368841b66
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2595268
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-01-07 12:40:16 +00:00
Jack Franklin d37a14b73b Migrate string-utilities.js to TypeScript
Bug: 1050549
Change-Id: I24e781f4f3377c87b342947a83547687fad56f36
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2584263
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-12-11 10:37:07 +00:00
Benedikt Meurer dead315abb Add webassemblymemory subtype.
This needs to roll before we add the subtype to the V8 inspector, as
otherwise the console will print errors when logging a
WebAssembly.Memory.

DISABLE_THIRD_PARTY_CHECK=protocol update

Bug: chromium:1155566
Change-Id: I62a4a21eba7479a91630599915c3c4b9e52d2659
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2575083
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2020-12-07 09:07:59 +00:00
Tim van der Lippe 5e1aeb0577 Remove suppress annotations
All of these were Closure-specific.

R=szuend@chromium.org

No-Presubmit: True
Bug: 1011811
Change-Id: Ia580e21cd3b06f532bb5a63a770ccfa3d7c796ee
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2569761
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-12-02 17:27:02 +00:00
Tim van der Lippe 420e5e3b70 Replace remaining title property setters with Tooltip.install
R=jacktfranklin@chromium.org

Bug: 1150762
Change-Id: I0262fa0dd9229f20e0ad4834c0699059a1effaea
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2555063
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-11-24 11:36:47 +00:00
Tim van der Lippe 70842f313f Replace title property setter with Tooltip install invocation
ui/Tooltip.js overrides the HTMLElement prototype to override the
title property. Rather than using this property, we shoul be
calling Tooltip.install directly. This makes sure that new
components are not relying on the behavior of the legacy
prototype patching.

These usages have been manually audited using the following regexes:

Search: ([\S]+)\.title = ([^;]+);
Replace: UI.Tooltip.Tooltip.install($1, $2);

Note that there are classes in DevTools that also have a title
property. Most notably `TreeElement`. We should not be replacing
these, as they do not inherit from HTMLElement. Luckily, we are
running TypeScript to make sure we don't call `Tooltip.install`
with a non-HTMLElement.

A follow-up CL will clean up the getters.

R=jacktfranklin@chromium.org

Bug: 1150762
No-presubmit: True
Change-Id: I5928e75c70293531849e0576f4fb2a2a8b3e02d2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2555060
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-11-23 17:16:46 +00:00
Sigurd Schneider b393a432c8 Display description in console.table if preview is not available.
When calling console.table on native JavaScript objects, the _buildTableMessage method looks the use the 'valuePreview.properties' array as the values to pass into console.table.  Some native javascript objects present the 'valuePreview.properties' as an empty array causing no data to be passed or displayed.  To account for this, a second condition is added which preserves the original functionality of the method, and asks if the 'properties' array is empty, use the object 'default values'.

Bug: chromium:1057090

Change-Id: I99e97aeb79a184a1101003e1ad5d2a04dce63439
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2481736
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-11-09 08:53:19 +00:00
Yang Guo b5737b236f Make console info text more precise
R=petermarshall@chromium.org

Fixed: 1141675
Change-Id: If73897f1bbddad1de1b7b148345e169a82e73251
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2517738
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2020-11-05 11:48:51 +00:00
Alfonso Castaño dfe8ca30ee Minor fixes in console logic for Trusted Types
Previous CL: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2494803
Screenshot: https://i.imgur.com/WFua1Mi.png
Bug: chromium:1048143
Change-Id: Ib04c6f37ced8305eaf01f72b40fd463a7128c628
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2507109
Commit-Queue: Alfonso Castaño <alcastano@google.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-10-29 13:28:42 +00:00
Yang Guo 40091c32fc Use clearer wording for console message hint
When expanding a logged object in the console, we evaluate its content
at that point. That may differ from when the object was logged. The
message should be more explicit about this to help avoid confusion.

R=petermarshall@chromium.org

Fixed:1142641
Change-Id: I7f535c41fb4381e6e7a61da240c67664decc363b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2505788
Commit-Queue: Yang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-10-29 09:22:49 +00:00
Alfonso Castaño 20d22cd2dc Improve displaying of Trusted Type objects in the console
Backend changes:
https://chromium-review.googlesource.com/c/chromium/src/+/2494761
https://chromium-review.googlesource.com/c/v8/v8/+/2494706

Screenshot: https://i.imgur.com/WFua1Mi.png
Bug: chromium:1048143
Change-Id: I60d02b98e0609751359c5dfa87665d9a9151931d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2494803
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Alfonso Castaño <alcastano@google.com>
2020-10-28 19:39:48 +00:00
Sigurd Schneider 8bfb421bc2 Refactor console.table messages to their own class
This CL makes the type property on SDK.ConsoleModel.ConsoleMessage read-
only and refactors the ConsoleViewMessage to remove the console.table
related logic to the derived class ConsoleTableMessageView.

Bug: chromium:1140516
Change-Id: I18cb3fa938da40ddf024df7ca01025fec6396585
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2498231
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-10-27 12:08:57 +00:00
Sigurd Schneider 53e98636d9 Remove unrestricted annotations to enable more type checking
Bug: chromium:1140516
Change-Id: I4f1bed09b9884dce34513094523f3367a138bd0b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2498230
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
2020-10-27 09:00:06 +00:00
Sigurd Schneider ca7b4fffd1 Introduce weakmap for node property
Bug: chromium:1011811, chromium:1135143
Change-Id: I4369f82447b3dd9555ea5077f637c48c9b482258
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2463359
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-10-14 09:03:00 +00:00
Sigurd Schneider 45f32c3ad7 [ts] Type-check console/ConsoleViewMessage.js with TypeScript
Bug: chromium:1011811, chromium:1135143
Change-Id: I93eb1d40ea39ea599a240d7bceb6a5a6c70001e4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2463358
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-13 16:12:48 +00:00
Sigurd Schneider 8f4ac865b5 Refactor static member to proper accessors
This unblocks the front-end change: https://crrev.com/c/2467936

Bug: chromium:1011811, chromium:1135143
Change-Id: I852fdce9341ac7f56e034a7fdecd3c4377af8b28
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2467837
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-10-13 13:54:08 +00:00
Sigurd Schneider 30ac3ddbae Refactor factory pattern in ConsoleViewMessage.js
Bug: chromium:1011811, chromium:1135143
Change-Id: Iced58cdba850162f22f82e6550ba84210d525169
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2466186
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-10-13 11:03:18 +00:00
Sigurd Schneider 23c5297dda Remove DOM prototype patching of createTextChild(ren)
Bug: chromium:1011811
Change-Id: I44a66c10efd317dcb7d5a4f58ab4be0fded4b215
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2466182
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-10-13 10:23:48 +00:00
Sigurd Schneider e8e75cf3c9 Fix typo in variable name
Bug: chromium:1011811, chromium:1135143
Change-Id: I5e61cd1862f3a3eff1e22de482c4a93f7f77a77a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2466183
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-10-13 08:47:38 +00:00
Sigurd Schneider b2953b2fe4 Prepare console/ConsoleView.js for TypeScript..
.. checking of console/ConsoleViewMessage.js

Bug: chromium:1011811, chromium:1135143
Change-Id: I520a7e7739e8924482f91e4aa3c31d13e97bfc52
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2461777
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-10-09 12:56:18 +00:00
Sigurd Schneider 53f3352018 HTMLElementification in console/
This is prework for TypeScriptification with the aim of reducing noise
in the follow-up CLs.

Bug: chromium:1011811, chromium:1135143
Change-Id: I9e5a6589940f432438fb73415542d2d0d341dc71
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2461771
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-08 15:31:17 +00:00
Paul Lewis ca569a50bd Migrates theme patching to top-level ThemeSupport
This CL replaces all uses of self.UI.themeSupport with an instance
function from the top level theme_support directory. It also dupes in
some of the functionality from ui/utils to prevent a circular dependency
between ui/utils and theme_support.

Change-Id: Ib8efd06630b99ee23af04ecba0dbf3cc4b19c036
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2352711
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-09 16:32:13 +00:00
Tim van der Lippe 9c9fb12c56 [globals] self.UI.shortcutRegistry
R=aerotwist@chromium.org

Bug: 1058320
Change-Id: I962f9a795b8e5ce12d00d35710ec92d3c3d424a7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2391227
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-08 15:41:19 +00:00
Jan Scheffler c5bc69f8bf Migrate front_end/console to devtools_entrypoint
R=aerotwist@chromium.org, jacktfranklin@chromium.org

Bug: 1101738
Change-Id: I5c1030afe46de06dd92c0ce1678975ad25cf6634
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2328846
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-30 12:25:40 +00:00
Mathias Bynens 5165a7a61b Replace usages of whitelist/blacklist
This patch replaces unwelcoming language with better terms.

Generally, the following replacements are made:

- whitelist → allowlist
- blacklist → blocklist

However, in some cases where “whitelist” was used as part of the
function name (e.g. `isWhitelistedProperty`) it felt more natural to
simplify the name (i.e. `isAllowedProperty` instead of the slightly
awkward `isAllowlistedProperty`).

This patch does not change third_party dependencies nor Lighthouse.
It also leaves `setWhitelistedShortcuts` for now, since renaming that
requires changes in Blink.

Change-Id: I56712d15b32b6a4259ccb333de6edd5fc62ee03f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2238229
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-06-10 07:05:40 +00:00
Tim van der Lippe 2074939fe3 Typecheck browser_sdk/LogManager.js with TypeScript
R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: If381c01631c56dd6fdf7d71ae7f34414a12b237d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2218012
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-05-27 14:56:46 +00:00
Tim van der Lippe ee954d41bf Replace triple class invocation of createElementWithClass
If they are space-separated, they are all classes. If is the third
argument, it is actually the custom elements type.

R=aerotwist@chromium.org

Bug: 1011811, 1077215
Change-Id: I05be67de0548ee9f735308d6b6f925241c45ab1c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2176116
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-05-04 11:45:41 +00:00
Tim van der Lippe 3cccb4f51b Complete typecheck of sdk/NetworkManager.js with TypeScript
What we learnt/changed:
- For invoke_* commands, allow the omission of the request object,
by adding an initializer in the generated code.

R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I04ee0eec703bdcc0235bc5a4a41387af72f912a7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2173374
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-05-04 11:09:51 +00:00
Tim van der Lippe f49e23286b Replace single class invocations of createElementWithClass
This applies the following replacement to the codebase:

(\S+) = createElementWithClass\('(\w+)', '([^'\s]+)'\);

to

$1 = document.createElement('$2');\n$1.classList.add('$3');

R=aerotwist@chromium.org

No-Presubmit: true
Bug: 1011811, 1077215
Change-Id: I0d76b39f1ed8cd4a44f18f94e398db934ba4b09c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2176112
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-05-01 16:54:52 +00:00
Paul Lewis 2d7d65c5e8 [global] Remaps self.Common.settings
This CL changes references to self.Common.settings (the global
instance of SDK.Common.Settings) over to
Common.Settings.Settings.instance(). To keep both TypeScript and
Closure happy we must make a method on the Settings class itself,
since it only allows private constructors to be accessed by static
methods on the class.

Bug: 1058320
Change-Id: I04afc8caf64acf29cdda13ef03ad05cfff4786a1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2091450
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-16 22:04:07 +00:00
Mathias Bynens f06e8c0758 Enable no-else-return lint rule with autofix
This rule matches the Chromium-wide coding style.

Bug: chromium:1057042

Change-Id: I21ad946227ca7344146abace1d2f6146b3a6c207
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2078924
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-28 14:17:07 +00:00
Tim van der Lippe 93b57c3bbc Remove prototype wrangling for String formatters
They are now moved to the StringUtilities file. Sadly, `String.sprintf`
is still used in the TestRunners that can't use ES modules.

The Multimap required exporting, as the NetworkManager has a reference
to it as well.

Bug: 1050549
Change-Id: Ia7b38dc212282a9800ee8c3083dac7f4a5e046e1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2067057
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-02-20 18:15:46 +00:00
Kim-Anh Tran 9e49a451cd [devtools] Make wasm source url clickable
This removes the wasm function info from a source url.
As a result, we get the correct url to jump to the wasm source
on a click.

Bug: v8:9762
Change-Id: I3944143518e4943b5aef0b44119c7d4c8ce4a5d2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2059992
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
2020-02-18 09:08:36 +00:00
Tim van der Lippe c02a97ca2c Fix imports for Common.Event typedef
All references now use the fully qualified
"Common.EventTarget.EventTargetEvent". It renames it to
"EventTargetEvent" to prevent a name-clash with the native "Event" type.

Bug: 1006759
Change-Id: I13fcdfd613041da146d741a0d1f785bfc905a7a8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2056481
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-14 15:21:06 +00:00
Tim van der Lippe 9b2f871384 Migrate console/ to import cross-module
Bug: 1006759
Change-Id: I685b1c819e17acab6db5f440cdf8e4b173712649
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2051961
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-13 13:37:48 +00:00
Paul Lewis 93d8e2cd12 [Global] Update refs to UI.themeSupport
Bug: 1006759
Change-Id: I8d11fd8de1f43e2add97dd09dd539bfda4a23f39
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019560
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-24 17:07:25 +00:00
Paul Lewis 05eb37fad0 [Global] Update refs to UI.shortcutRegistry
Bug: 1006759
Change-Id: I7f5e50e80ec49429698737f79c555472c44fb68f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019549
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-24 15:34:35 +00:00
Paul Lewis 4b64b3f263 [Global] Remap refs to Common.moduleSetting
Bug: 1006759
Change-Id: Ia45ef0fd0b97588ca23a8d784c0564050b0bbf4c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016748
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 12:00:20 +00:00
Jack Lynch 7bc9bf2b07 Performance Event Log link accessibility
This CL makes the links in the Performance panel Event Log details view,
shown to the right in [1], tabstops so that they can be accessed by
keyboard users.

[1] https://gyazo.com/de063c6b02c4d7580807338a6371f9f7

Bug: 963183
Change-Id: I718805bc31fbfa681a035909358345e96d3aa8bd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1891710
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2020-01-13 17:53:35 +00:00
Tim van der Lippe eaacb72383 Migrate console/ to ESM internally
Bug: 1006759
Change-Id: If15f5741c87ff711976a317910cbf01489db1d3e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1991515
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-10 14:03:57 +00:00
Jack Lynch 236e1d251e Add tabstop option to Component.Linkifier
This CL adds a tabstop option to the various linkify() functions under
Component.Linkifier. Allowing Linkifier users to choose whether they
want a tabbable link or not is neccessary to satisfy accessibility
requirements without adding extra tabstops to links that are made
accessible via a context menu or some other alternative. As some of the
argument lists were getting long, I also moved the optional arguments
into an object.

These changes will break a web test, so [1] must be merged first. The
fixes are in [2]

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1894280
[2] https://chromium-review.googlesource.com/c/chromium/src/+/1721843

Bug: 963183
Change-Id: Iaa3047f5fffa609c9e5c0b6cb49ccbeee5737de1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1891546
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
2020-01-07 21:53:41 +00:00
Connor Moody 1a5c0d3694 DevTools: Make expandable text in ObjectPropertiesSection accessible.
When the content size in ObjectPropertiesSection exceeds a given value, UIUtils.createExpandableText was previously used to provide 'Show More' and 'Copy' buttons inline with the abbreviated text.

This CL eliminates createExpandableText and introduces the ObjectPropertyValue and ExpandableTextPropertyValue classes. These classes live in ObjectPropertiesSection.js (as opposed to UIUtils) since they are closely related to ObjectPropertiesSection / ObjectPropertyTreeElement.

Previously, value element factory methods in ObjectPropertiesSection returned raw elements which limited options for an accessibility implementation. Now, these factory methods return an ObjectPropertyValue instance or ExpandableTextPropertyValue when applicable.

ObjectPropertyValue is a wrapper around basic property value types. ExpandableTextPropertyValue extends ObjectPropertyValue and replaces createExpandableText.

ExpandableTextPropertyValue implements UI.ContextMenu.Provider so that the components that own instances of these classes can add 'Show more' and 'Copy' buttons to the context menu, ensuring that expandable text functionality is keyboard accessible.

This CL also makes changes visual changes to expandable text including making the 'Copy' and 'Show more' adornments smaller relative to the property text and only showing abbreviated text inside the property tooltip.

Before: https://gyazo.com/517cfe9eef7b62da8c35c3253a7a38c0
After: https://gyazo.com/0345babe8b983e04e4cd25d76fcca5ee
Change-Id: Ia24ad2ef64840932eb2deb4bc7e6c83dbc454758

To verify:
run the following in the DevTools console:

console.log({
    longstring: [...Array(5000).keys()].join('')
})

The resulting object displayed in the console will use ObjectPropertiesSection with expandable text.
Open the context menu on the longstring property to test the change.

Change-Id: Ia24ad2ef64840932eb2deb4bc7e6c83dbc454758
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1958580
Commit-Queue: Connor Moody <connor.moody@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2019-12-19 08:06:48 +00:00
Michael Liao 18769f2106 [Common - Data Grids]: bundling data grid parameters + Adding required name field for all data grids
Issue:
- Data grids in DevTools do not have an aria-label
- There are a ton of DataGrid parameters and adding one is messy

Changes:
- Naming all data grids
- Created DataGrid.Datagrid.Parameters type to hold data grid parameters (including a required gridName field)

Bug: 963183
Change-Id: I83b130d468fb80034be264b45b86b799f650e978
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1891652
Commit-Queue: Michael Liao <michael.liao@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2019-12-12 19:12:26 +00:00
Brandon Goddard 04a5a76893 Console: Add Expand/Collapse aria label for stack trace messages
This CL adds the aria-expanded property for console messages
that have call stacks attached to them. These messages display
a preview, but the full callstack can be seen by expanding/collapsing
the message through click or arrow key press. Before, screen
readers would not announce that this message is expandible. Now,
they announce that these messages can be expanded/collapsed.

Before: https://imgur.com/AmbDocC

After: https://imgur.com/wvGqmgk

Bug: 963183
Change-Id: I9bf5cc32c4ebd742f856df20115a4a7b952c6654
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1958573
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Reviewed-by: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Brian Cui <brcui@microsoft.com>
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
2019-12-10 21:31:56 +00:00
Peter Marshall 3e4e569cd2 Remove asParsedURL on the String prototype
Use a static function on the ParsedURL class instead.

A lot of our tooling is happier linking through to the class method
rather than the prototype thing, and setting things on prototypes is
generally discouraged in JS for a bunch of reasons.

Change-Id: I95cf70ed58e7cca6d4c2bf7633b69199f513d068
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1958524
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2019-12-10 09:00:24 +00:00
Paul Lewis bf7aa3c19e Migrates console/ to esm
Change-Id: I98fbb09aca094d5493923dd595c940f9f4bc9e85
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1924206
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2019-11-20 17:15:48 +00:00
Tim van der Lippe b45d9a0a31 Remove ProductRegistry
Design doc: https://docs.google.com/document/d/1fRNhE_FXfCWwR8zOBkE5J5B6An53Lf0GbQHUB1QSnEI/edit?usp=sharing

Bug:664704,1011466
Change-Id: Iaec3f495a18b821b312694011129902a9c63f67f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1893080
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2019-11-05 17:54:26 +00:00
Anubha Mathur fbacf4e274 DevTools: Fix accessibility issue where datagrid tables in console caused inconsistent keyboard navigation
Issue: Keyboard accessibility in console is inconsistent when datagrids are present.
Shift + Tab in console prompt takes you to the last console message, beyond which arrow keys let you navigate through console messages.

When console.table creates datagrids, the original tabIndex for these is 0, which immediately take focus on shift+tab. This has now been updated to -1, since keyboard focus is not needed in console datagrids. Sorting functionality is still keyboard accessible using context menu key.

Gif: https://imgur.com/a/jlGCoFg

Bug: 963183
Change-Id: I5996505724f66530b8e4f73379e7d196eb3d013f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1873358
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Commit-Queue: Anubha Mathur <anubmat@microsoft.com>
2019-10-28 22:24:07 +00:00
John Emau f7e30fb274 DevTools: Make console message source links keyboard accessible
Make all console message anchor source links keyboard accessible by
adding the anchor element to the _selectableChildren array in the
ConsoleViewMessage UI component which will use _selectableChildren to
manage keyboard navigation and focus.

This is required to meet WCAG 2.1.1 Keyboard success criteria.
See: https://www.w3.org/WAI/WCAG21/quickref/#keyboard

For the tests I added an additional ArrowUp or ArrowDown to move focus
to the original desired target under test, occasionally I would include
the content of the source link in the test's expected results for
additional guards against regressions.

on the previous message, then use the up and down arrow keys to navigate
between visible links within the console messages.

Screenshot: https://i.imgur.com/ZUDFsUV.png
Gif: https://i.imgur.com/UlhVhwn.gifv
Test: Put focus in the console input, then use Shift + Tab to set focus
Bug: 963183
Change-Id: I8e094506adeed099a2b0c1b81c4b4394f83129a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1638137
Commit-Queue: John Emau <John.Emau@microsoft.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#702981}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5b7e51e53cf3209007d9cb43e28f292d38c90810
2019-10-04 19:12:32 +00:00