Commit Graph
42 Commits
Author SHA1 Message Date
Mathias Bynens dbaa7129b3 Clean up redundant Promise.resolve() in ConsolePinPane.js
Bug: chromium:1161501
Change-Id: I12affd8ecf749a6b2d2dc849d7ba6187cc0ffc2b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2602978
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
2020-12-24 09:01:35 +00:00
Tim van der Lippe 2e38eeaf9f Remove all comments with only the unrestricted annotation
The unrestricted annotation is Closure-specific and can be removed.
This patch removes all comments with only the unrestricted annotation
in them.

R=szuend@chromium.org

No-Presubmit: True
Bug: 1011811
Change-Id: Iba0723644f53f5307c3077d341271af86becc32a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2569758
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-02 15:25:32 +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
Tim van der Lippe 3a34cdfe5a Typecheck changes/ChangesTextEditor.js with TypeScript
R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: I90f983c10cf6855a07f1ce9e077a47d4c2a10974
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2526687
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-10 16:29:28 +00:00
Sigurd Schneider 090c3b6d15 Remove deepElementFrom{Event,Point} from prototypes
.. and move them to UIUtils.

Bug: chromium:1011811
Change-Id: Idc5364328e62ac820980576e9c253d1bc6ee26d6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2527053
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-10 11:50:51 +00:00
Jack Franklin 71519f8efb Introduce enableLegacyPatching flag for CSS patching
As part of the dark mode migration we are adding
`enableLegacyPatching:true` to all call sites of `appendStyle` (and
related methods). If a user passes `false` for that flag, no CSS colour
patching will occur.

This CL is therefore a no-op from a user's perspective as we pass `true`
on every call to maintain existing behaviour, but once we start
migrating we will turn the option to `false`. Long term, once all code
is migrated and the old patching is removed, we will remove this flag
entirely once again.

Bug: 1122511
Change-Id: I76b818e83b7d5ee0175e1548759373f53481e0ab
No-Presubmit: True
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2516345
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-03 14:11:46 +00:00
Jake Mulhern a33dbaa3d3 Remove unnecessay "edit expression" option from right click drop down
This patch removes the redundant "edit expression" option from the drop-
down menu that appears when a live expression is right-clicked. This is
redundant since right clicking the expression focuses on the expression
and makes it editable without clicking on this option.

Fixed: 940864
Change-Id: I64e1859102d9610bfa16ab3b99425887ea4cc1fa
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2499218
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-10-27 12:25:57 +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 565e4cc5b0 [ts] Type-check sdk/ConsolePinPane.js with TypeScript
This also names a couple of anonymous classes from
UIUtils to make them namable in type annotations,
which improves type checking.

Bug: chromium:1011811, chromium:1135143
Change-Id: Ib5eecde8974e9bf78a32c52f392c079afe4f7eca
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2452695
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-10-08 12:31:46 +00:00
Paul Lewis ef5265375c Remove unnecessary empty string
TBR=jacktfranklin@chromium.org

Change-Id: I2de9ee119bdcb722ff293cb429ca474a96c1321a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2456586
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-10-07 15:14:05 +00:00
Jake Mulhern e66f55b486 Switched to empty string for live expression preview during creation
Substituted 'not available' string with an empty string in the preview
for a newly created live expression.  This was done to avoid the unwanted
flash of text while the Promise resolves during creation.

Bug: 1126033

Change-Id: Ic526fe54ee52c48c5a4fcb2dd1424d94811d29a6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2427444
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-10-07 12:57:55 +00:00
Michael Liao 4b9530f348 [Console Pin Pane]: Fixing focus order when deleting expression
Issue:
- Console pin pane has odd focus order when deleting an expression
    - focus gets placed back to the "Create live expression" button

Changes:
- focus logic:
    - Deleting an expression --> focuses next entry
    - Deleting the only expression --> focus on "Create Live Expressions" button
    - Deleting last expression --> focuses previous entry
- Focus is placed on the delete button

Before: https://imgur.com/L9Tyzrl

After: https://imgur.com/a/iSBXlCY

Created bug for quality of life change in Console Pin Pane:
https://bugs.chromium.org/p/chromium/issues/detail?id=1134381

Bug: 1133362
Change-Id: I116a6d9f6032bddb9853cf1a9a6d3c6e49e82392
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2436473
Commit-Queue: Michael Liao <michael.liao@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Reviewed-by: Jose Leal <joselea@microsoft.com>
2020-10-01 23:42:00 +00:00
Michael Liao e18b2c30ca [Console Pin Pane]: use dt-close-button as remove live expression button
Issue:
- focus is not clearly visible on the delete button for live expressions

Changes:
- changed the delete button to 'dt-close-button' (the one that tabbed panes use)
- made screen reader labels more descriptive
    - From: "Remove expression"
    - To: "Remove blank expression" or "Remove expression: {expression}"


Before: https://imgur.com/DjqAU9y

After: https://imgur.com/tfCDnqu

Bug: 1133344
Change-Id: Ic41d218316a701bf224ce61094a5765806d2eec7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2438200
Reviewed-by: Songtao Xia <soxia@microsoft.com>
Reviewed-by: Jack Lynch <jalyn@microsoft.com>
Commit-Queue: Michael Liao <michael.liao@microsoft.com>
2020-09-29 22:43:45 +00:00
Tim van der Lippe 7f2002c598 [globals] self.runtime
Migrate all usages of self.runtime to Root.Runtime.Runtime.instance().

This also requires various type updates, as now Closure/TypeScript
can better understand the code and discover issues.

R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: Ice07aa0ca959e61a6acdf4618b9a272d8c1096b8
Fixed: 1081614
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2434339
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-29 10:52:39 +00:00
Tim van der Lippe d1a00aacb9 [globals] self.UI.context
R=jacktfranklin@chromium.org

Bug: 1058320
Change-Id: Icc1d806782e7624fff02e719670a2cca59070ddd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2364594
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-08-19 16:24:38 +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
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 23ee1aad0a Reconfigure lint rule w.r.t. quotes
We prefer single quotes by default, but still want to allow double
quotes in cases where that helps avoid quote-escaping, and also want
to allow template literals in cases where string interpolation is
used. For example:

    const a = 'xxx';  // ok
    const b = "xxx";  // not ok, should use single quotes
    const c = "xxx'xxx";  // ok, double quotes avoid an escape sequence
    const d = `xxx`;  // not ok, frivolous use of template literal
    const e = `xxx ${42}`;  // ok

Per https://github.com/eslint/eslint/issues/12976, setting
the `allowTemplateLiterals` option for the `quotes` lint rule to
`false` gives us the desired behavior.

Note that the above lint rules are auto-fixed when running the linter;
there should be no need to manually make any changes to appease the
linter.

Per review feedback, this patch also removes the following escape
sequences for printable non-ASCII symbols:

- U+00D7 → ×
- U+2026 → …
- U+2019 → ’

Chromium CL temporarily updating test expectations:
https://chromium-review.googlesource.com/c/chromium/src/+/2083147

Cq-Depend: chromium:2083147
Bug: chromium:1057042
Change-Id: Id6bec3f96ca694d2fbc07dd8629fce305a58df8a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2082372
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Mathias Bynens <mathias@chromium.org>
2020-03-02 16:18:16 +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 d990734442 [Global] Update refs to UI.context
Bug: 1006759
Change-Id: I4a405fb1d80f6a384a311a3482c37f943238b73f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019137
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-24 14:25:48 +00:00
Paul Lewis 6bcdb18044 [Global] Update refs to Common.settings
Bug: 1006759
Change-Id: Ie1943b50ba8ba23fae4f52f958ae6f8c7b6a7d3f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016744
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 11:29:11 +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
Tim van der Lippe c96ccd99f0 Remove unused globals
By using the script in crrev.com/c/devtools/devtools-frontend/+/1942289
we can prune all globals that are not actually global. Most of these are
internal private variables that are now module-scoped. Some variables
were also completely unused, which ESLint nicely reported.

Change-Id: I43689ac7544ad1239acc7d0eeec4dcd563d7fea9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1942290
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-29 16:38:40 +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
Michael Liao 5be6234e05 DevTools [Console]: Refocus create live expression button after removing pin
Re-upload of https://chromium-review.googlesource.com/c/chromium/src/+/1865615 to new repository

Issue:
- Focus disappears after removing an expression in the "Create Live Expression" field

Changes:
- Passing in the "Create Live Expression" button to the console pin pane
- Auto-focusing the create live expression button upon deleting a live expression

GIF:
https://imgur.com/irtTu6s

Bug: 963183
Change-Id: I2a827ea364785e4a660434f764dccf96f99767c6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1872448
Commit-Queue: Michael Liao <michael.liao@microsoft.com>
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
2019-10-24 22:54:30 +00:00
Tim van der Lippe 1d6e57a0e3 Always add braces to single-line if-statements
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.

This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.

Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9
2019-09-30 11:55:34 +00:00
Tim van der Lippe c85c3122b8 Always run the full eslint during presubmit
This would prevent us from submitting CLs that would inadvertently
break other code, even if we did not touch it.

Bug: 1004860
Change-Id: I45f2fd8481b45c8d1bafc621965b9498d4dc80ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1813320
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#697973}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8ff97a7c3127bd664700f8aafded334c82da6211
2019-09-19 11:27:04 +00:00
Aaron Gable c9d00052df Revert "Reland "Convert ui/ARIAUtils.js to an ES module""
This reverts commit ec810baced8e07ca3e9f2b801703be433807d2a2.

Reason for revert: causing eslint failures on Linux Tests:
/b/s/w/ir/third_party/blink/renderer/devtools/front_end/dom_extension/DOMExtension.js
  817:10  error  'onInvokeElement' is defined but never used  no-unused-vars
https://ci.chromium.org/p/chromium/builders/ci/Linux%20Tests/81950

Original change's description:
> Reland "Convert ui/ARIAUtils.js to an ES module"
>
> This is a reland of b3373919f86df10c190a8672ca828c7ea4b920e5
>
> Original change's description:
> > Convert ui/ARIAUtils.js to an ES module
> >
> > ES modules allow files to explicitly import and export symbols [1].
> > This patch migrates ARIAUtils.js to an ES module, while maintaining
> > backwards compatibility with existing usages of `window.UI.ARIAUtils`.
> >
> > The build system is updated to copy these modules verbatim, as it no
> > longer require pre-processing to be loaded. The `module.json` no longer
> > includes this file as a script, to make sure it is not double-bundled
> > into `shell.js`. Instead, it is added to the new field `modules`, which
> > contains all modules. By doing so, it becomes clear which files are
> > converted to modules already and which require the legacy references
> > to the global scope.
> >
> > This module and future modules will be imported from `root.js`, which is
> > added to all existing HTML application files.
> >
> > Design Doc: https://docs.google.com/document/d/1h9dOy3nNPNfZ2AtZXzB-DwJqG4Oo37WWvKLCuzCcPzo/edit?usp=sharing
> >
> > [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
> >
> > TBR=jochen@chromium.org
> >
> > Change-Id: Ie79c8f2fce3aff96fa28af0b575eae39bfe8e1a5
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1748949
> > Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> > Reviewed-by: Yang Guo <yangguo@chromium.org>
> > Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
> > Cr-Commit-Position: refs/heads/master@{#697238}
>
> Change-Id: I7544cbf4364d0b1a3c2f137a4d17a1afdb1d4aed
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1810534
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#697626}

TBR=yangguo@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org

Change-Id: I445fd35f135450cd9e8ed4c69bf913662f461ce6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1811989
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#697824}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 901bcc219d9204748f9c256ceca0f2cd68061006
2019-09-18 23:35:18 +00:00
Tim van der Lippe 63a4d3dcd6 Reland "Convert ui/ARIAUtils.js to an ES module"
This is a reland of b3373919f86df10c190a8672ca828c7ea4b920e5

Original change's description:
> Convert ui/ARIAUtils.js to an ES module
>
> ES modules allow files to explicitly import and export symbols [1].
> This patch migrates ARIAUtils.js to an ES module, while maintaining
> backwards compatibility with existing usages of `window.UI.ARIAUtils`.
>
> The build system is updated to copy these modules verbatim, as it no
> longer require pre-processing to be loaded. The `module.json` no longer
> includes this file as a script, to make sure it is not double-bundled
> into `shell.js`. Instead, it is added to the new field `modules`, which
> contains all modules. By doing so, it becomes clear which files are
> converted to modules already and which require the legacy references
> to the global scope.
>
> This module and future modules will be imported from `root.js`, which is
> added to all existing HTML application files.
>
> Design Doc: https://docs.google.com/document/d/1h9dOy3nNPNfZ2AtZXzB-DwJqG4Oo37WWvKLCuzCcPzo/edit?usp=sharing
>
> [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
>
> TBR=jochen@chromium.org
>
> Change-Id: Ie79c8f2fce3aff96fa28af0b575eae39bfe8e1a5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1748949
> Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
> Cr-Commit-Position: refs/heads/master@{#697238}

Change-Id: I7544cbf4364d0b1a3c2f137a4d17a1afdb1d4aed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1810534
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#697626}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ec810baced8e07ca3e9f2b801703be433807d2a2
2019-09-18 15:31:38 +00:00
Tim van der Lippe ffa7862d4e Update Closure compiler to v20190729
The new compiler caught a lot of pre-existing issues in the codebase.
Sadly, the old compiler version was not smart enough to understand the
new changes. Therefore, the changes have be included in the same CL as
the compiler update.

Most of the changes are related to better handling of prototype and
class inheritance, as well as handling of null/undefined tracking.

Change-Id: I3941a3a240a4d09c4945e1e20d2521090ef837c9
Bug: 991710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762081
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
Auto-Submit: Tim van der Lippe <tvanderlippe@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#696761}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ca93474213278e32e36d6ace1474c56884030757
2019-09-16 12:07:12 +00:00
Jeff Fisher 5096e5fadb DevTools: cleanup keydown pattern
We sprinkle a lot of isEnter/isSpace keychecks in the code for invoking
buttons and links and it has started to smell.

This change adds a new helper isEnterOrSpaceKey() to save some typing.
It also adds a new onInvokeElement that conditionally invokes a callback
when a keydown event that passes isEnterOrSpaceKey occurs.

Change-Id: I163ad059db6d58da8209ed6887b3d728deb97cec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1716096
Commit-Queue: Jeff Fisher <jeffish@microsoft.com>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#686753}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 58f0643123083b037f67a36a8071bfcb09cc35a3
2019-08-14 10:05:51 +00:00
John Emau d3bef01745 DevTools: Improve console live expressions accessible name
Added option to configure code mirrors accessible name then set console
live expressions accessible name to "Live expression editor".
Before it read "Code editor" which is the same as the primary console input.

Screenshot: https://i.imgur.com/GZDwP3F.png
Bug: 963183
Change-Id: Ie3fd3206953c54df31d6abeaeca7e5f7ad0dabee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1628224
Reviewed-by: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: John Emau <johnemau@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#666359}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5635f819724970444c02fef12e0656a9872c7c0d
2019-06-05 18:08:40 +00:00
John Emau 53d64092ac DevTools: Make Console Accessible
Marked 'Remove expression` console pin as a button with a tabindex,
accessible name, Enter and Space keydown event activation, and focus
indicator styling.

Accessibility tree screenshot: https://i.imgur.com/6KCMN5b.png
NVDA Speech Viewer screenshot: https://i.imgur.com/Dd5AyTW.png

See: https://www.w3.org/WAI/WCAG21/quickref/#name-role-value
Bug: 963183
Change-Id: I5dbd6b1d25bf52a3beacaf088bf7395e0f4ef083
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1629787
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: John Emau <johnemau@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#665314}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ad4bda615f79c3ce2222a9f27ed1f6ce27f62f12
2019-05-31 22:41:56 +00:00
Erik Luo b6ef57eb82 DevTools: hide TextPrompt selection highlight when unfocused
TextPrompts have contenteditable="plaintext-only", which keep their
text selection after losing focus. This CL hides their text select
highlight when not focused.

Also, live expressions no longer keep their highlight when
losing focus.

Bug: 820007
Change-Id: I19f1e498c3e3c03ad38f022e3c2e9ebbf0f96d94
Reviewed-on: https://chromium-review.googlesource.com/c/1069334
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#601026}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 94ccd8c0882834b24c036c7830a068533196098a
2018-10-19 02:15:40 +00:00
Erik Luo 824d9c2617 DevTools: fix executionContext check for live expressions
Bug: 893781
Change-Id: I2246e241eaeef889664c2451eedac419beb6622a
Reviewed-on: https://chromium-review.googlesource.com/c/1272295
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#598139}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 88a3a493dccf010f8eb13c53961461f8c3f8c7df
2018-10-10 00:09:25 +00:00
Erik Luo c75946e020 DevTools: highlight live expression node previews on hover
Hovering nodes that are results of Live expressions will
highlight it in the page.

Bug: 886596
Change-Id: Ia6d90217a72867cbe831a8bdfc608c983b642317
Reviewed-on: https://chromium-review.googlesource.com/c/1249277
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#597691}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ba904a798c86d5b876fc0ad19ccce834f04d2ce7
2018-10-08 21:44:25 +00:00
Erik Luo 34a22cf66c DevTools: revert to last committed live expression on escape
Bug: none
Change-Id: I6e206b63e45e8b6e4510125195aa1169223d5d1e
Reviewed-on: https://chromium-review.googlesource.com/1220550
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#592664}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 19390734c8dc481e0928738ed0b94d2c0a0dcf38
2018-09-20 02:29:30 +00:00
Erik Luo 9f24d20e9b DevTools: release objects generated for REPL preview
Bug: none
Change-Id: Ic24e0f08fa6d55461d7bdd50d6164b00e47ab950
Reviewed-on: https://chromium-review.googlesource.com/1200402
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#589860}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6a4cfb8d406346ccf28fc262ce930c691795ec74
2018-09-10 08:51:51 +00:00
Erik Luo 212d281a71 DevTools: update Console watch name to Live
Screenshot: https://imgur.com/a/fD18yf6

Bug: 849875
Change-Id: Ida8934b5a2607b49d9ca1f93d1714fdbe568270c
Reviewed-on: https://chromium-review.googlesource.com/1196008
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#587370}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6f96a48d490f559c3c6ee71f314dffb1b70c21a5
2018-08-30 01:26:39 +00:00
Erik Luo 66bcf105f5 DevTools: iterate on console pin interaction UX
- Console prompt is cleared when text is pinned
- Pins persist across refresh
- Newly created pin runs with side effects until text differs
  or new expression is committed (on blur)
- Ctrl-Enter moves focus from Pin to Console prompt
- Added command menu option to create new pin
- Pressing Tab indents, moves focus iff pin is empty
  (same logic as Console prompt)
- Pins producing errors show error message on red background
- Pin text is trimmed upon blur/commit

Bug: 849875
Change-Id: I641abb6b5e19a84c17b1a6cd3e50ca7b459f2015
Reviewed-on: https://chromium-review.googlesource.com/1141096
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#586108}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 811a4303b8b973d61567d61372ec8e1d692037c0
2018-08-25 02:15:37 +00:00
Erik Luo d8eee2bbe9 DevTools: continuously update Console pins on interval
Part 2: live updating pins
- same JSAutocomplete, `await` processing, previews as
  ConsolePrompt
- 250ms interval to update pins
- prevent side-effects while editing text (editor has focus)

Screenshot: https://imgur.com/a/zaPlRTC

Bug: 849875
Change-Id: I0cd18101e58a6ff4e71e674633409ca0e015e1e7
Reviewed-on: https://chromium-review.googlesource.com/1096417
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#577397}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b0290b0756fefbc1ae6dce3fa986f5de4fbdc021
2018-07-24 01:36:18 +00:00
Erik Luo 6294d3b496 DevTools: pinned expressions in console
Part 1: introduce pins behind an experiment.
- Prompt has 'pin' button to add current expression to pins
- Pin pane sticks to the top of the Console, with max height
- Pins have multiline editors and a value preview that shows
  "not available" when there is an error

Screenshot: https://imgur.com/a/Ahdtosa

Bug: 849875
Change-Id: Ib0b8bafd97551f823ff8b64d13c5259f42328994
Reviewed-on: https://chromium-review.googlesource.com/1087509
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#574740}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 589cdcb33ef96770a2c3e4a9c76ee439d1e2e56e
2018-07-12 21:54:16 +00:00