Commit Graph
58 Commits
Author SHA1 Message Date
Christy Chen 5d7848d54d Reland "[Loc] Migrate changes tool to localization V2"
This reverts commit 9e5ab71e50.

Reason for revert: The Cl was reverted due to devtools pak file limitation. That issue has been fixed in https://chromium-review.googlesource.com/c/chromium/src/+/2558341

Original change's description:
> Revert "[Loc] Migrate changes tool to localization V2"
>
> This reverts commit abcb8f7aa8.
>
> Reason for revert: Consistently causing autoroll issues when rolling devtools-frontend into Chromium - see https://chromium-review.googlesource.com/c/chromium/src/+/2554521 for an example.
>
> To recreate this, do a debug build of Chromium with this patch applied to DevTools. It's causing an issue with duplicate keys in the pak files. No DevTools Frontend builds do a debug build of Chromium with the DevTools frontend patch applied so our CQ will be green despite causing an issue.
>
> You can run this locally in Chromium to reproduce via:
>
> autoninja -C out/Default chrome:packed_resources_extra
>
> Which will show the error. 
>
> Original change's description:
> > [Loc] Migrate changes tool to localization V2
> >
> > Migrate changes tool
> > Tested with en-XL: https://imgur.com/a/hFDBjQV
> >
> >
> > Bug: 1136655
> > Change-Id: Ic434c3085b9e2f2cf44583cca7ee1ce8f1d412f2
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2548688
> > Commit-Queue: Christy Chen <chrche@microsoft.com>
> > Reviewed-by: Simon Zünd <szuend@chromium.org>
>
> TBR=szuend@chromium.org,chrche@microsoft.com
>
> Change-Id: I94b27434562f6a6bff3be381ab8a5802bd8b03f9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1136655
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2557044
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>

TBR=szuend@chromium.org,chrche@microsoft.com,jacktfranklin@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1136655
Change-Id: I35166a6f4f38462073b933c01c169b3c8d14311b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2567344
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Christy Chen <chrche@microsoft.com>
Commit-Queue: Christy Chen <chrche@microsoft.com>
2020-12-02 06:13:17 +00:00
Tim van der Lippe 7dcef88d8b Remove skip_compilation from module.json files
R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I4c4fd280adb4f5f7b327239d08d80b2cb98b203b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560248
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-25 13:19:08 +00:00
Jack Franklin 9e5ab71e50 Revert "[Loc] Migrate changes tool to localization V2"
This reverts commit abcb8f7aa8.

Reason for revert: Consistently causing autoroll issues when rolling devtools-frontend into Chromium - see https://chromium-review.googlesource.com/c/chromium/src/+/2554521 for an example.

To recreate this, do a debug build of Chromium with this patch applied to DevTools. It's causing an issue with duplicate keys in the pak files. No DevTools Frontend builds do a debug build of Chromium with the DevTools frontend patch applied so our CQ will be green despite causing an issue.

You can run this locally in Chromium to reproduce via:

autoninja -C out/Default chrome:packed_resources_extra

Which will show the error. 

Original change's description:
> [Loc] Migrate changes tool to localization V2
>
> Migrate changes tool
> Tested with en-XL: https://imgur.com/a/hFDBjQV
>
>
> Bug: 1136655
> Change-Id: Ic434c3085b9e2f2cf44583cca7ee1ce8f1d412f2
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2548688
> Commit-Queue: Christy Chen <chrche@microsoft.com>
> Reviewed-by: Simon Zünd <szuend@chromium.org>

TBR=szuend@chromium.org,chrche@microsoft.com

Change-Id: I94b27434562f6a6bff3be381ab8a5802bd8b03f9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1136655
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2557044
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-11-24 10:54:09 +00:00
Christy Chen abcb8f7aa8 [Loc] Migrate changes tool to localization V2
Migrate changes tool
Tested with en-XL: https://imgur.com/a/hFDBjQV


Bug: 1136655
Change-Id: Ic434c3085b9e2f2cf44583cca7ee1ce8f1d412f2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2548688
Commit-Queue: Christy Chen <chrche@microsoft.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-11-23 18:46:16 +00:00
Tim van der Lippe 43efdd17a9 Use TypeScript-authored files in changes/
R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I2d7ae3b530fa5e7e406ff226b846e383069d18c7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2534206
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-12 16:31:18 +00:00
Tim van der Lippe 9534205dbf Typecheck changes/ChangesHighlighter.js with TypeScript
Unfortunately the typings in `@types/CodeMirror` are most of the
time incorrect and require several upstream patches to make them
pass. For now, we are ignoring these issues, to unblock numerous
other build infrastructure changes we need to make.

R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I730663b0dc6ef9ff85d5d4a2cc58403a39d7d921
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2534203
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-11-12 16:24:03 +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
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
Yang Guo ef36cec5b9 Apply governance change
DISABLE_THIRD_PARTY_CHECK=no code changes
R=bmeurer@chromium.org

Change-Id: I2477c36f5ef2494ccae3efae3f1aee942f365fec
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2489420
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2020-10-21 07:54:15 +00:00
Tim van der Lippe 46e1bcace9 Remove pre_generates_legacy from module.json files
This was a temporary flag used during the build_release_applications
to GN migration.

R=aerotwist@chromium.org

Bug: 1131500
Change-Id: I8a772bcc4bee31dbd3270bf7ef62d8c97941024a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2484716
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-19 16:12:09 +00:00
Tim van der Lippe ead1fa43d0 Move remaining legacy files to GN
R=aerotwist@chromium.org

Bug: 1131500
Change-Id: Ibb247dd02a5032604824517be4276c4b83c8fc8c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2479140
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-10-19 09:25:50 +00:00
Paul Lewis d428614454 TypeScriptify ChangesSidebar.js
R=szuend@chromium.org

Bug: 1011811
Change-Id: Id99df0184feffdb8138bc8e10c5def9d14be1225
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2479131
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-10-16 12:10:37 +00:00
Tim van der Lippe d87271d132 Remove usages of Runtime.sharedInstance
For all classes that were retrieved via Runtime.sharedInstance,
migrate them to the singletong instance pattern. This removes
the indirection via Runtime and improves code navigation as
well as typechecking.

R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: Ifcf0b73be703308fbdbad0c585f0d945cee9b3b7
Fixed: 1131423
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2434340
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-29 10:59:08 +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
Mathias Bynens 601f7f247f Migrate ChangesView to TypeScript
Preparatory CL: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2426531

Bug: 1011811
Change-Id: I86d72b61805fc15b7f819a708f88d5e484ec3593
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2431505
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-09-28 10:49:52 +00:00
Mathias Bynens fd016bf307 Remove the global spacesPadding and numberToStringWithSpacesPadding helpers
Their functionality can be expressed more easily with inline
String.prototype.padStart calls.

This simplifies the upcoming TypeScriptification of ChangesView.js.

Bug: chromium:1011811, chromium:1050549
Change-Id: I1b39d7e4ff6d71968ec2cfdff9dc24fb072f1a47
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2426531
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-09-24 14:57:15 +00:00
Tim van der Lippe cac65d4fa0 Remove skip_rollup
This was a temporary flag as part of the devtools_entrypoint migration.
Since that migration has concluded, we can now remove all references
to it and clean up `build_release_applications.py`.

R=jacktfranklin@chromium.org,aerotwist@chromium.org

Bug: 1101738
Change-Id: I3ef9ec1a99bc9fc1758532124db22b3b4b1a5e2a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2391140
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-08 15:44:09 +00:00
Tim van der Lippe 19a45dfd55 Remove is_legacy_javascript_entrypoint
This removes the now-obsolete is_legacy_javascript_entrypoint build flag,
which was used as part of the devtools_entrypoint migration.

This uncovered that accessibility was still using devtools_pre_built
and a file was missing from the GRD variable.

R=aerotwist@chromium.org,jacktfranklin@chromium.org

Fixed: 1101738
Change-Id: Ie1556ccc1d1563c855417de18e896308de0cfe19
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2356305
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-08-28 12:32:29 +00:00
Jan Scheffler a5c5b34d67 Migrate front_end/changes to devtools_entrypoint
R=aerotwist@chromium.org, jacktfranklin@chromium.org

Bug: 1101738
Change-Id: Ie26902cda0e64b14670026bfc92ed9c65e9fdaa3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2332221
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-31 13:24:59 +00:00
Tim van der Lippe 37512b0d25 Remove empty script arrays from module.json files
If the module uses `modules` to load the JavaScript files, then
we can remove the `scripts` array altogether. Note that there
are still some modules left that use `scripts`, most notably
the `lighthouse_worker`, which is a remote module.

R=aerotwist@chromium.org

Bug: 1105476
Change-Id: Ie303e9835f5ce6d42ccae7b3a305d8f3df1af84c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302597
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-17 10:05:33 +00:00
Tim van der Lippe 1b2c52bbfa Remove tvanderlippe@ as explicit OWNER from several front_end subfolders
As part of the initial seeding of the OWNERS, the automated scripts added
myself as OWNERS to pretty much every single folder in `front_end/`. This
is an artifact of the widespread infrastructure I have done, with in
particular the ES Modules migration that touched every single file in
DevTools.

In the past few weeks, several times I have received CLs were I was asked
to perform a domain review on the feature in question. Most of the time,
I have no knowledge of that particular feature.

To reduce confusion and roundtrips asking for different domain reviewers,
I removed myself as explicit OWNERS of these files. Note that I can still
use my INFRA_OWNERS to land changes, but as usual these are infra-only.
E.g. these will include the larger refactorings that span multiple features,
but not a single feature in particular.

I have kept myself OWNERS of folders that are part of the core
architecture of DevTools, as I am comfortable reviewing these as domain
reviewer.

R=yangguo@chromium.org,aerotwist@chromium.org

Change-Id: Ib1be70b97c5395498795b4b28ce7001731305d41
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282516
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2020-07-06 12:36:21 +00:00
Mathias Bynens 42f585a5ad Fix -theme-preserve styles
Previously, many CSS rules were written as:

    -theme-preserve {
      foo: bar;
    }

Note that the selector is `-theme-preserve`, which in theory matches
any <-theme-preserve> elements — but we don’t use any such elements,
and it’s an invalid custom element name [1] anyway.

The only reason these selectors are used is to mark a CSS rule as
unaffected by DevTools theming; `_patchProperty` in `UIUtils.js` checks
if the selector contains `'-theme-'`.

stylelint-config-standard complains about this selector for good
reason, so we should use something else. A simple fix is to use a class
selector instead:

    .-theme-preserve {
      foo: bar;
    }

There is one gotcha: `-theme-preserve` gets applied as an actual class
name to some <input> elements in the memory timeline under the
Performance panel. To prevent those elements from getting all the
`-theme-preserve` styles, this patch changes the class name for that
specific case to `-theme-preserve-input`.

This works great: stylelint is now happy, and `_patchProperty` in
`UIUtils.js` still works correctly, since it only checks if the
selector contains `-theme-` anywhere.

[1]: https://mothereff.in/custom-element-name#-theme-preserve

Bug: chromium:1083142
Change-Id: I923f12de6d581e9fef71a9a58bda184e40dee796
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2252017
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-06-19 13:07:31 +00:00
Yang Guo 3852a23f96 Seed more owners to front_end directories
Bug: chromium:1082687
Change-Id: I07ad07fba7513d674eb8b6e84d8296bf64d37230
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2207319
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Shane Clifford <shanejc@microsoft.com>
Reviewed-by: Leo Lee <leolee@microsoft.com>
2020-05-20 07:20:27 +00:00
Mathias Bynens ca9fa2d73f Consistently format CSS color and opacity values
- Prefer the modern comma-free CSS color function syntax over the
  legacy syntax. [1]
- Explicitly use the `deg` suffix for angle values in colors, to
  clarify the range.
- Explicitly use the `%` suffix for percentages instead of formatting
  the value as a number, again to clarify the range.

[1]: https://twitter.com/mathias/status/1253242715304857601
[2]: https://goo.gle/devtools-css-color

Bug: chromium:1083142
Fixed: chromium:1073885
Change-Id: I8e1582a2dee3553a61df88564051ea84c2011d76
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2209091
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Mathias Bynens <mathias@chromium.org>
2020-05-19 16:50:26 +00:00
Mathias Bynens b0c1f4bce2 Fix stylelint-config-standard violations
Bug: chromium:1083142
Change-Id: I5ea4cc5d0f83e52856383ba37a47472e33eb19a2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204113
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-05-15 17:05:27 +00:00
Tim van der Lippe e7f27058f4 Replace double class invocations of createElementWithClass
This applies the following replacement to the codebase:

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

to

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

R=aerotwist@chromium.org

Bug: 1011811, 1077215
Change-Id: I0ac37f594bd12dd7b1ffb53d7ca9ef04761df5f0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2176114
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-05-04 09:49:41 +00:00
Mathias Bynens 5e43b27e8b Reformat module.json files
This patch makes it so that all module.json files use the same
consistent indentation that matches .editorconfig and the rest
of the codebase. At the request of reviewers, one such file
(front_end/emulated_devices/module.json) has been excluded
from this patch. It will be reformatted in a separate CL.

Note that this patch does not “roll CodeMirror”, although a
pre-commit hook forces me to include that phrase in the commit
message because the module.json file in the relevant folder is
modified.

Bug: chromium:1070492
Change-Id: Ib31ed5232461e2f80bf05f31105fc919f6639b0a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2127007
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-04-14 05:35:23 +00:00
Alex R 8475bb3343 Make TreeOutline in Changes not focusable until there is content
When the empty TreeOutline in Changes panel gets focus via keyboard,
the outline is shown without any content. This change disable focus
until there is some content in the aforementioned TreeOutline.

Bug: 1048986
Change-Id: I9aa9c24a0197a9fd23a862cc803ce785196a6a2f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2132236
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
2020-04-03 08:54:03 +00:00
Paul Lewis 75c7d0decc [global] Remaps self.UI.viewManager
Moves self.UI.viewManager to an instance() method.

Bug: 1058320
Change-Id: I0c444101da59ba9eba4745d1dc551bb8906a0a4f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107624
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-03-19 12:39:32 +00:00
Kalon Hinds 1574c49c4f High contrast support for Changes Panel
This patch provides forced-colors overrides to make sidebar icons
on the changes panel visible in high contrast mode.

Screenshots: https://imgur.com/a/GG665sc
Bug: 1048378
Change-Id: I6f285eca8abafc40de17a8606a5f9c59aea0a384
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107112
Commit-Queue: Kalon Hinds <kahinds@microsoft.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-03-18 22:24:39 +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 4abec848cb Remove typedefs from changes-legacy.js
Bug: 1006759
Change-Id: I83d4c4ad7f8dd247c8a27ef6e83bbe27a7eec17b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2057204
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-14 15:21:06 +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 aa76aa23f5 Fix internal bindings in ui/
These were some left-over fixes that regressed while doing phase 3 of
ESM. It includes fixing the typedefs in ui-legacy to be in the proper
file and exported.

Bug: 1006759
Change-Id: Ie398fcec632bcaf6462b44581213f5e6c45882de
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2055066
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-14 15:21:06 +00:00
Tim van der Lippe bd62fd61e5 Migrate changes/ to import cross-module
Bug: 1006759
Change-Id: I426354313642308278f258294995bbf26ffe5cf6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2054161
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-13 15:30:45 +00:00
Michael Liao 76192f01c8 [Changes]: Allowing horizontal scrolling using arrow keys
Issue:
- Users could not use arrow keys to scroll horizontally in the Changes tool

Changes:
- Added extraKeys param to ChangesTextEditor that re-routes Left/Right arrow key input to scroll horizontally

GIF: https://imgur.com/7F3Enxi

Bug: 963183
Change-Id: I97768a3d21caee80e8d22dc52eea8a5a86c71112
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2027844
Commit-Queue: Michael Liao <michael.liao@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2020-02-07 18:36:51 +00:00
Paul Lewis 50993696be [Global] Update refs to UI.viewManager & UI.zoomManager
Bug: 1006759
Change-Id: Iebf11153861850acbbfef9f40e3552d1be9a6460
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016760
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 15:45:11 +00:00
Tim van der Lippe ba24602160 Remove unused globals
Bug: 1006759
Change-Id: I70685c3787a4fb0f7be00315fed2f4bdaf2eb05a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2002607
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-16 11:14:14 +00:00
Simon Zünd 1facecf39e [cleanup] Replace {pushAll} helper with {push} plus spread operator
Change-Id: I5c91ff89ff69090db8a3cfaf326a5308d23d6ca7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2003312
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-01-16 10:23:34 +00:00
Paul Lewis 95eeb30b5f Migrates changes/ to ESM internally
Bug: 1006759
Change-Id: I6543c6eddbba6b01b9e096c5ae813bde9add9d9c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1991639
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-10 11:45:16 +00:00
Jack Lynch d611227247 Reveal Changes source with keyboard
This CL uses onInvokeElement in the Changes drawer to allow keyboard
users to hit spacebar to reveal the file in the Sources panel once [1]
has been merged to pass through those keypresses from codemirror.

[1] https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1891836

Bug: 963183
Change-Id: I0d9b465fca6b70d2a30bd7285d0fdfaff66a2e52
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1891666
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
2020-01-08 01:02:54 +00:00
Jack Lynch 9542a8be14 Fix accessibility issues in the Changes editor
This change makes the Changes drawer editor more accessible by adding a
gutter column with +/- symbols on added or deleted rows, respectively.
This information was previously conveyed only through color, a WCAG
violation.

In order to communicate whether a line is an addition or deletion to
screen reader users, I created a new code mirror input style that
prepends 'Addition:' or 'Deletion:' to the text that screen readers read
out for each diff line. This solution was settled on after discussing it
with other devs working on accessibility in order to avoid implementing
something more complex like VS Code's screen reader diff experience [1].

Screenshot: https://gyazo.com/8fe95b563a9e74d0d8b1a88900876c2a

[1] https://github.com/Microsoft/vscode/issues/17263#issuecomment-305701496

Bug: 963183
Change-Id: Ieeab30b8058fb36ef3a0d9ef4beac52419f6dc33
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1891836
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
2019-12-31 21:42:27 +00:00
Jack Lynch 528ec9d1e1 Mark Changes drawer as tabpanel
This CL marks the list of files in the Changes drawer [1] as a tablist
rather than a tree. This provides clarity for screen reader users
because the current behavior better matches the Tab pattern as defined
in the WAI-ARIA Authoring Practices [2]:

  > Tabs are a set of layered sections of content, known as tab panels,
  > that display one panel of content at a time. Each tab panel has an
  > associated tab element, that when activated, displays the panel.
  > The list of tab elements is arranged along one edge of the
  > currently displayed panel, most commonly the top edge.

[1] https://gyazo.com/12ee1829f0660b77523eb51bf59481e1
[2] https://www.w3.org/TR/wai-aria-practices-1.1/#tabpanel

Bug: 963183
Change-Id: Ic79c22ad55941e4b340c23c5979ec02adf60b080
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1891834
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2019-12-18 01:03:26 +00:00
Jack Lynch 4e63e659a8 Improve screen reader labels in Changes
This CL adds a more descriptive label for the revert button in the
Changes drawer and adds a label to the diff viewer/editor itself.

https://gyazo.com/d7584085a4f9864a2bf8d6b9f4b985c2

Bug: 963183
Change-Id: Ica6b044151f65737e199b546f9b4a3bc8c65315c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1891663
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
2019-12-17 20:56:46 +00:00
Paul Lewis 17a3e344ef Migrates changes/ to esm
Change-Id: Ic50d87a9d24c47bd4bbd6d76a3ff00429cbf6b16
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1924200
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2019-11-19 17:18:40 +00:00
Tim van der Lippe 20b29c2646 Enforce newlines at end of files
Trying to upload a CL with missing newlines at the end of files fails with the following warning:

These files should end in one (and only one) newline character:

Update the ESLint config to let the linter fix these errors.

Change-Id: Ia858b5864a1dc43144e0c6d81dedbf46376c2b8d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1897679
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2019-11-04 15:02:44 +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
Mandy Chen 1e9d87b8f2 DevTools: Create a grdp file for shared strings to avoid confusion
Since the current localization system uses a unique ID for each string that
is calculated based on the the md5 hash of the string, each string
in the grdp files needs to be unique. However, there are strings in the
frontend that appear multiple times. When such strings are moved across
folders, sometimes a seemingly random grdp file is changed by the autofix
script. (See https://crrev.com/c/1683826 for an example)

This CL introduces shared_strings.grdp, a file dedicated for strings that
are shared across folders/grdp files. Instead of putting these strings in
the grdp files that come first when sorted alphabetically, they live in
shared_strings.grdp and have common descriptions among all instances of
such strings. This way if shared strings need to be moved, it's more clear
what's going on.

Note that this CL contains a lot of changes that are generated automatically
(e.g. shared strings are removed from their current locations), so here's
the list of actual changes that need to be reviewed:

* shared_strings.grdp file is added to front_end/langpacks and front_end/langpacks/
devtools_ui_strings.grd
* path to shared_strings.grdp is added to scripts/localization_utils/localization_utils.js
* in scripts/localization_utils/check_localized_strings.js, the parser marks
strings that appear more than once as shared and set the target grdp file to be
shared_strings.grdp
* shared_strings.grdp file is checked by scripts/check_localizability.js for
localizability violations
* shared_strings.grdp messages have common descriptions added

Bug: 941561
Change-Id: I00db23854656509f2f03988e70adc0109b6e09d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1800918
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#697667}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d10bf7c5a97cf9184866c1117935c199bacf7ff3
2019-09-18 17:18:15 +00:00
Junyi Xiao 0ccf6db244 Devtools: a11y fixes for Memory heap profiler
Accessibility testing revealed the following issues within the tool:
1. no focus indicator on javascript VM instances list

This change:
changes current selected/hover and adds selected but inactive color to match treeoutline in Element

Bug: 963183

Workflow gif: https://imgur.com/a/lHNTOP7

Change-Id: Iaed79d7166bf70011711be548ba66c65a57922da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1678946
Commit-Queue: Junyi Xiao <juxiao@microsoft.com>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#690483}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 522709bc5b3158fdaef516f391d382d7321e505f
2019-08-26 20:26:47 +00:00
Mandy Chen e7eb0207b0 DevTools: Add auto-generated descriptions to changes_strings.grdp
This patch fills in the 'desc' tag for each <message> in the
changes tab with auto-generated descriptions.

Regarding the quality of these descriptions. Our plan is to fix
descriptions that result in poor translations as reported by our
translation team and end users.

Follow-up patches will be made to add descriptions to other grdp files.

Bug: 941561
Change-Id: I838baac8eb55f79a53e0f1e251713bc5a7237da1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1678842
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#672699}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0a89851bb04e87065a9451bbe1acc5a964a8f1d0
2019-06-26 22:46:19 +00:00