Commit Graph
46 Commits
Author SHA1 Message Date
Wolfgang Beyer 0d0e5bfe42 Fix tabs shown on reload
The main toolbar containing tabs for the various panels contains a
counter for errors/warnings/issues/violations. This CL fixes the logic
for when this counter should be shown.

Previously, when there were violations but the violations experiment was
turned off, the counter would render a small visible element anyway.
This could lead to a bug where a page refresh would change the contents
of the main toolbar.

Fixed: chromium:1132775
Change-Id: I5bed294733267d204d12729efa3f3f7eb202d238
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2440894
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
2020-10-01 09:25:04 +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
Jack Franklin d99fe63933 Move legacy css copy_to_gen to each subfolder
Make each individual module responsible for copying its CSS, rather than
having that knowledge defined in the unittest front_end BUILD.gn.

Fixed: 1124236
Change-Id: I2e62559f346138ef1be915dec9be9c6aaa4c213e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2390067
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-02 15:25:00 +00:00
Simon Zünd 791d4882f5 [issues] Remove issues tab experiment
The issues tab is configured as an experiment enabled by default since
M84. This CL removes the experiment all-together for M87.

R=sigurds@chromium.org

Bug: chromium:1072302
Change-Id: Idecb2bacf57f548b5e7fd1ab4d73bea415eac233
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2382854
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-08-31 13:49:33 +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
Tim van der Lippe 4adcb2cf4e Typecheck console_counters/WarningErrorCounter.js with TypeScript
R=szuend@chromium.org

Bug: 1011811
Change-Id: I3c9b78dc9c0bd4576d0ea6a6a8155faf6a33eaaa
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2379754
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-08-27 15:11:45 +00:00
Tim van der Lippe 80d8265054 [globals] self.UI.inspectorView
R=szuend@chromium.org

Bug: 1058320
Change-Id: If282650f584d4db45c0a6260e102f044791f759d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2379692
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-08-27 14:16:55 +00:00
Wolfgang Beyer 1938e000a9 Fix error/warning counter tooltip to show correct count
Fixed: chromium:1094269
Change-Id: I5911618728d0728b4ddb9a677d6c759e2c68fa2a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2361684
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
2020-08-18 11:24:38 +00:00
Jan Scheffler 0a3d3cb227 Migrate front_end/ui to devtools_entrypoint
R=aerotwist@chromium.org, jacktfranklin@chromium.org

Bug: 1101738
Change-Id: Ifed859365bdab62a1929922370aec39dff66cea8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2320828
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
2020-07-28 13:02:53 +00:00
Paul Lewis c881a764ba Migrate console_counters to devtools_entrypoint
Bug: 1101738
Change-Id: I9641b1bd1e55e33017fac06b05884a075c5ef0c7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318260
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-27 15:04:57 +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
Yang Guo e6c865efa2 Seed more owners and use TLs as default owners
Also update COMMON_OWNERS (10+ commits/reviews in the past 6 months).

Bug:chromium:1082687
Change-Id: I55224b14468e5b3fa17ceadf40193db5ed2f82dc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2253902
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Shane Clifford <shanejc@microsoft.com>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2020-06-22 18:28:23 +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
Sigurd Schneider c03e2b1c24 [issues] Improve tooltip for issues
This makes the tooltip consistent between the issues panel and the
error warning counter bar.

Bug: chromium:1057979
Change-Id: I5878af5efdcbb680b67d6a3fffb3c37d7146c883
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2178581
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-05-05 07:08:45 +00:00
Wolfgang Beyer a03d3df43a [Issues] Add telemetry for how issues panel is being opened
This CL adds a new metrics enum to allow measuring from where in the
UI the new Issues Panel is being opened.

The corresponding chromium CL is at https://crrev.com/c/2159218

Bug: 1072299
Change-Id: I810a0b40967c8dd84214a1403c500e38a5e4f8f1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2157040
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-05-04 14:50:31 +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
Sigurd Schneider ba81851dad [issues] Add IssueManager abstraction
This CL adds a central singleton that collects all issues from all
known targers. This singleton is then used by the issues view to
display issues.

This change enables correct handling of issues that arise from OOPIF
and worker sources.

Fixed: chromium:1073797
Change-Id: I75a8bb46d240f63df013c0b06506cad7fb2e5a8f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2168885
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-04-29 11:14:55 +00:00
Sigurd Schneider b59ed7ed88 [issues] Report issue number instead of aggregated issue number
This change reports the number of issues known to DevTools instead of
the number of aggregated issues. This means that any improvement will
result in a decreased number. We think this provides better feedback for
developers.

To make this work properly, this change also introduces de-duplication
of issues, as cookie issues are ofen reported more than once by the
chromium back-end.

Note that until the fix in https://crrev.com/c/2164625 is in,
will possibly be too large when first opening DevTools. Reloading
the inspected page should work-around that bug.

Bug: chromium:1057979
Change-Id: Iebea90f3840a5c782866713990b03ae47712346b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2164746
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-04-27 07:16:25 +00:00
Sigurd Schneider 4be1b3709a [issues] Add issue counter to console counters in top menu bar
This CL adds the issue counter to the top menu bar. It relies on the
issue model being enables from the start. It uses the main target to
get the issues model, and then sticks with that. This works, because
we bubble all issues up to the local root (i.e. all arrive in the main
target model).

Once we add issues for workers, etc. we might have to revise this.

Bug: chromium:1057979, chromium:1061876
Change-Id: I1421d5d2243c5ad28b1e66b9f9e7739c310192bd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2137379
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-04-07 09:54:10 +00:00
Paul Lewis 4a896b29ab [global] Remaps self.SDK.consoleModel
Moves self.SDK.consoleModel to an instance() method.

Bug: 1058320
Change-Id: I52e403c85e6d478e43f7f82d48a34cba0c4fe47d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107626
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-20 12:32:37 +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
Paul Lewis a83ea61dac [global] Remaps self.Common.console
This CL changes references to self.Common.console (the global instance
of Common.Console) over to Common.Console.Console.instance(). To keep
both TypeScript and Closure happy we must make a method on the Console
class itself, since it only allows private constructors to be accessed
by static methods on the class.

Bug: 1058320
Change-Id: Icd4ac8aea76383588a5664a96643179d91812698
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2087757
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-04 13:20:05 +00:00
Connor Clark 2bc3be29be Reland "[Lighthouse] Rename Audits panel to Lighthouse"
This reverts commit 0651468562.

Reason for revert: Cause of failure has been remedied. See: https://chromium-review.googlesource.com/c/chromium/src/+/2055398

Original change's description:
> Revert "[Lighthouse] Rename Audits panel to Lighthouse"
>
> This reverts commit 2ae53ef04d.
>
> Reason for revert: This CL breaks CI: https://ci.chromium.org/p/devtools-frontend/builders/ci/DevTools%20Linux/453. It looks like the layout test expects audits not lighthouse in the name, so it's probably in need of a 3-way merge.
>
> Original change's description:
> > [Lighthouse] Rename Audits panel to Lighthouse
> >
> > Change-Id: Ia2ab175d2a3b6c8ded73aff8ff0f5582f5a8fa0c
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2044605
> > Commit-Queue: Connor Clark <cjamcl@chromium.org>
> > Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> > Reviewed-by: Paul Irish <paulirish@chromium.org>
>
> TBR=paulirish@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,cjamcl@chromium.org
>
> Change-Id: Ia6d5f42a0e6ece4352696c51bf0de5754774cb0a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2051983
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> Commit-Queue: Paul Lewis <aerotwist@chromium.org>

TBR=paulirish@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,cjamcl@chromium.org

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

Bug: 1052111
Change-Id: I638ca9bd5cd94e02fb7318f2a7d7c66fca40e6c8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2056866
Reviewed-by: Connor Clark <cjamcl@chromium.org>
Reviewed-by: Paul Irish <paulirish@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Connor Clark <cjamcl@chromium.org>
2020-02-18 01:56:25 +00:00
Tim van der Lippe fe89cb3004 Migrate console_counters/ to import cross-module
Bug: 1006759
Change-Id: I307230df99c9413113c6cb3456625229f7ceeb41
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2051962
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-13 13:24:00 +00:00
Paul Lewis 0651468562 Revert "[Lighthouse] Rename Audits panel to Lighthouse"
This reverts commit 2ae53ef04d.

Reason for revert: This CL breaks CI: https://ci.chromium.org/p/devtools-frontend/builders/ci/DevTools%20Linux/453. It looks like the layout test expects audits not lighthouse in the name, so it's probably in need of a 3-way merge.

Original change's description:
> [Lighthouse] Rename Audits panel to Lighthouse
> 
> Change-Id: Ia2ab175d2a3b6c8ded73aff8ff0f5582f5a8fa0c
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2044605
> Commit-Queue: Connor Clark <cjamcl@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Paul Irish <paulirish@chromium.org>

TBR=paulirish@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,cjamcl@chromium.org

Change-Id: Ia6d5f42a0e6ece4352696c51bf0de5754774cb0a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2051983
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-02-12 11:06:32 +00:00
Connor Clark 2ae53ef04d [Lighthouse] Rename Audits panel to Lighthouse
Change-Id: Ia2ab175d2a3b6c8ded73aff8ff0f5582f5a8fa0c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2044605
Commit-Queue: Connor Clark <cjamcl@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Irish <paulirish@chromium.org>
2020-02-11 22:43:22 +00:00
Paul Lewis e504fd6a5f [Global] Updates refs to SDK.consoleModel
Bug: 1006759
Change-Id: Ifa6d7f177a22a38eaa4f3a16a26c797659ddee98
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2017145
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 17:10:50 +00:00
Paul Lewis 0a7c6b6b7e [Global] Update refs to UI.inspectorView
Bug: 1006759
Change-Id: I2770dd011ec47c98fb79fa6a48e306be3ad3fe4e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2017143
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 16:37:10 +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
Paul Lewis 04ccecc2d7 [Global] Updates references to Common.console
Bug: 1006759
Change-Id: I5c854000a3de456a7cca34ca270c07dc0d53e0e7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2014924
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-22 17:59:05 +00:00
Tim van der Lippe 678f13988c Migrate console_counters/ to ESM internally
Bug: 1006759
Change-Id: I926a7693872c7e07b80e1632143d7a8d27810e75
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1991516
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-10 14:42:47 +00:00
Christy Chen 94b4a0baf8 DevTools: Avoid using .join() to construct the title of a console counter
Change ported from CL
https://chromium-review.googlesource.com/c/chromium/src/+/1866856

WarningErrorCounter is using .join to construct the title, which is an
anti-pattern that prevents proper localization of lists. This CL is changing
it to use placeholders instead.
https://imgur.com/EZ9egYl


Bug: 941561
Change-Id: I9bd67821c25dd6deea62f051041c9f6b7ed8ac73
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1873361
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Reviewed-by: Mandy Chen <mandy.chen@microsoft.com>
Commit-Queue: Christy Chen <chrche@microsoft.com>
2019-11-20 23:13:53 +00:00
John Emau 6b80080315 DevTools: give errors and warnings counter an accessible name
Without this change screen readers in browse mode [1] will incorrectly
read errors and warnings that have a tooltip of "42 errors, 99 warnings"
as "4299".

After this change screen readers will announce the same content as the
shown in the tooltip: "42 errors, 99 warnings".

Because errors and warnings are indicated with icons this change will
fix the screen reader bug and helps meet success criteria for
WCAG 1.1.1 Non-text Content [2].

Root cause:
The icons do not have accessible names and screen readers will combine
the content of the spans:

   <span><error-icon/>42<span><span><warning-icon/>99</span>
   is announced as 4299

The fix:
* Set the accessible name of counter element (title alone is insufficient [3]).
* Make the children of the counter hidden otherwise NVDA (and JAWs)
  screen readers will ignore the aria-label [4].

[1]: https://www.nvaccess.org/files/nvda/documentation/userGuide.html#BrowseMode
[2]: https://www.w3.org/WAI/WCAG21/quickref/#non-text-content
[3]: https://crrev.com/18d41172/third_party/blink/renderer/devtools/front_end/ui/Tooltip.js#190
[4]: https://github.com/nvaccess/nvda/issues/1354#issuecomment-155287285

Screenshot (NVDA speech viewer): https://i.imgur.com/KznR7O7.png
      screen reader should announce the number of errors and warnings.

Test: Navigate to the counter in NVDA browse mode on Win10 and the
Bug: 963183
Change-Id: I46985e223a6f8bac5cd1dbdf597a4b0c9ab71567
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1861214
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Commit-Queue: John Emau <John.Emau@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#707031}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5814dabc5bfa705994cea056b539243789e481c9
2019-10-17 20:12:14 +00:00
Tim van der Lippe a4d448c312 Migrate console_counters/ to ESM
- Also upgrade the refactor script to automatically add the
extensionpoint to the BUILD.gn to save myself some typing.

Bug: 1006759
Change-Id: I3f789f96122569141194ce26ac288f01af68f6e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1852209
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#704600}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e55e98bc0ca76229380e3bca5a78e15d953da0c5
2019-10-10 13:38:29 +00:00
Tim van der Lippe 99e59b8c29 Migrate Runtime.js to ESM
Introduce a new namespace "Root" to be able to disambiguate between
Runtime the namespace and Runtime the object.

roll CodeMirror
The above line is necessary to fix the presubmit, which complains
about CodeMirror changes. This is only updating a type reference.

Bug: 1006759
Change-Id: I04941d9f18649701060e3035f7eeb2ef3abb51e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829708
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#701257}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 17cc008cf6ad28c6e8c07c638a1b380ca30e7f79
2019-09-30 20:00:59 +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 50fd396d65 DevTools: Add auto-generated descriptions to all grdp files
In the previous patch (https://crrev.com/c/1678842) I added auto-generated
descriptions to changes_strings.grdp. In this patch, I'm adding the rest
of the descriptions. A follow-up patch will be made to add a presubmit
check that all grdp messages have descriptions.

Bug: 941561
Change-Id: I61e65143e7d5160ce1e880c58ec56afdf03819cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1688716
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#675723}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f2d042ca17f3b033b58df41adbeaeaaf0be427c1
2019-07-09 18:03:08 +00:00
cjamcl@google.com aa1532c2f8 DevTools: rename Audits2 to Audits
Change-Id: Ibc5f1dfcbf8ecffde51f65198cd496a8084f569b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614691
Commit-Queue: Connor Clark <cjamcl@google.com>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Erik Luo <luoe@chromium.org>
Reviewed-by: Paul Irish <paulirish@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#665035}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d9e4e36ccdf6109611ee34608d11fdaa3fdaee6a
2019-05-31 03:01:24 +00:00
Lorne Mitchell c56ff2d968 Reland of "DevTools: Added GRD/GRDP files for all localizable strings in the DevTools."
This is a reland of https://chromium-review.googlesource.com/c/chromium/src/+/1613921/, which was reverted (Bug=966547) because
third_party/blink/renderer/devtools/front_end/langpacks/devtools_ui_strings.grd was being picked up by Google's internal localization pipeline.

Bug=941561

Change-Id: I9a97e16e367716189d34944b76605c9321d47092
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627921
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Lorne Mitchell <lomitch@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#664013}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 613ca444d07326b6f087c083af79a636a858a7d9
2019-05-28 23:35:03 +00:00
Krishna Govind 897c867a07 Revert "DevTools: Added GRD/GRDP files for all localizable strings in the DevTools."
This reverts commit 2f05fdbf2ab3458b4b3a3f2a86f908a3a7d04f79.

Reason for revert: Breaks chrome translation, crbug 966547

Original change's description:
> DevTools: Added GRD/GRDP files for all localizable strings in the DevTools.
> 
> This change includes...
> * A main GRD file for the DevTools (front_end/langpacks/devtools_ui_strings.grd)
> * GRDP files organized by subfolder
> * A node script that keeps the GRD/GRDP files in sync with the keys in the DevTools frontend
> * A git cl presubmit --upload check that runs the node script
> 
> Note: Subsequent changes will add a build step to generate a .pak file that contains these DevTools strings. You can read about the overall approach here (https://bugs.chromium.org/p/chromium/issues/detail?id=941561).
> 
> 
> Details of this design:
> ======================
> We followed a similar pattern used by WebUI where strings are encoded in GRIT GRD/P files, which are used by a localization service to perform translations. They are also consumed in the build step to generate a .pak file, which is loaded by the browser's resource system.
> 
> Chromium documentation:
> * https://www.chromium.org/developers/tools-we-use-in-chromium/grit/grit-users-guide
> * https://www.chromium.org/developers/design-documents/ui-localization
> 
> Frontend strings:
> -----------------
> These are the localizable strings that are displayed to the user.
> 
> GRDP <message> strings:
> -----------------------
> Each frontend string has a corresponding <message> entry in a GRDP file. These entries are what the localization service will use to perform localizations. It's also the input to the GRIT compiler, which generates a .pak file, which is loaded by the browser's resource_bundle system.
> 
> GRDP <messsage> placeholders:
> ----------------------------
> Frontend strings use placeholders, which are used to substitute in values at runtime.
> For example,
> 'This string has %s two placeholder %.2f.'
> 
> Since the order of the string may change in a different language, we need to encode the order of the placeholders. As such, in the GRDP file you'll find %s replaced with $[1-9].
> 
> For example,
> 'This string has <ph name="ph1">$1s</ph> two placeholder <ph name="ph2">$2.2f</ph>.'
> 
> Also, note that the precision and type of the placeholder is maintained (i.e. .2f).
> 
> Detecting changes:
> -----------------
> The check_localizable_resources.js script performs the following check and generates an error if there are any changes that need to be made to a GRDP file.
> 
> 1. Parses the frontend strings and hashes them.
> 2. Reads the messages from the GRDP files and hashes them.
> 3. Uses a difference between these two sets to report which strings need to be added and/or removed from GRDP files.
> 
> Optionally, the user can specify --autofix and it will automatically update the appropriate GRDP files.
> 
> Presubmit check:
> ---------------
> Running git cl presubmit --upload will run the check_localizable_resources.js script with the --autofix argument.
> 
> If there are any changes, they reported to the user like this.
> 
> ** Presubmit ERRORS **
> Error: Found changes to localizable DevTools strings.
> DevTools localizable resources checker has updated the appropriate grdp file(s).
> Manually write a description for any new <message> entries.
> Use git status to see what has changed.
> 
> BUG=941561
> 
> Change-Id: I5ac1656a037a6aaffeb4f64b103c4daec28be39a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1613921
> Reviewed-by: Joel Einbinder <einbinder@chromium.org>
> Reviewed-by: Alexei Filippov <alph@chromium.org>
> Commit-Queue: Lorne Mitchell <lomitch@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#662371}

TBR=alph@chromium.org,einbinder@chromium.org,exterkamp@chromium.org,jeffish@microsoft.com,lomitch@microsoft.com

Change-Id: Ic4ca7d000d10b2bc61b585198469ca30f051dc62
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 941561
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627943
Reviewed-by: Krishna Govind <govind@chromium.org>
Commit-Queue: Krishna Govind <govind@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#662798}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ceb872b6f6a02d707783563a225c77bb0c62170a
2019-05-23 20:33:45 +00:00
Lorne Mitchell 072e6f877f DevTools: Added GRD/GRDP files for all localizable strings in the DevTools.
This change includes...
* A main GRD file for the DevTools (front_end/langpacks/devtools_ui_strings.grd)
* GRDP files organized by subfolder
* A node script that keeps the GRD/GRDP files in sync with the keys in the DevTools frontend
* A git cl presubmit --upload check that runs the node script

Note: Subsequent changes will add a build step to generate a .pak file that contains these DevTools strings. You can read about the overall approach here (https://bugs.chromium.org/p/chromium/issues/detail?id=941561).


Details of this design:
======================
We followed a similar pattern used by WebUI where strings are encoded in GRIT GRD/P files, which are used by a localization service to perform translations. They are also consumed in the build step to generate a .pak file, which is loaded by the browser's resource system.

Chromium documentation:
* https://www.chromium.org/developers/tools-we-use-in-chromium/grit/grit-users-guide
* https://www.chromium.org/developers/design-documents/ui-localization

Frontend strings:
-----------------
These are the localizable strings that are displayed to the user.

GRDP <message> strings:
-----------------------
Each frontend string has a corresponding <message> entry in a GRDP file. These entries are what the localization service will use to perform localizations. It's also the input to the GRIT compiler, which generates a .pak file, which is loaded by the browser's resource_bundle system.

GRDP <messsage> placeholders:
----------------------------
Frontend strings use placeholders, which are used to substitute in values at runtime.
For example,
'This string has %s two placeholder %.2f.'

Since the order of the string may change in a different language, we need to encode the order of the placeholders. As such, in the GRDP file you'll find %s replaced with $[1-9].

For example,
'This string has <ph name="ph1">$1s</ph> two placeholder <ph name="ph2">$2.2f</ph>.'

Also, note that the precision and type of the placeholder is maintained (i.e. .2f).

Detecting changes:
-----------------
The check_localizable_resources.js script performs the following check and generates an error if there are any changes that need to be made to a GRDP file.

1. Parses the frontend strings and hashes them.
2. Reads the messages from the GRDP files and hashes them.
3. Uses a difference between these two sets to report which strings need to be added and/or removed from GRDP files.

Optionally, the user can specify --autofix and it will automatically update the appropriate GRDP files.

Presubmit check:
---------------
Running git cl presubmit --upload will run the check_localizable_resources.js script with the --autofix argument.

If there are any changes, they reported to the user like this.

** Presubmit ERRORS **
Error: Found changes to localizable DevTools strings.
DevTools localizable resources checker has updated the appropriate grdp file(s).
Manually write a description for any new <message> entries.
Use git status to see what has changed.

BUG=941561

Change-Id: I5ac1656a037a6aaffeb4f64b103c4daec28be39a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1613921
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Lorne Mitchell <lomitch@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#662371}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2f05fdbf2ab3458b4b3a3f2a86f908a3a7d04f79
2019-05-22 21:58:44 +00:00
Joey Arhar aef9356008 [DevTools] Add violation console counter for spotlight
Bug: 934031
Change-Id: I6e9a00ea25a2a1d87b7684f12302d4aed98c3c6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1524880
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#641357}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0acdcbb8df1a5202af4a95b4bc21b2bd8d4bb00e
2019-03-15 23:49:59 +00:00
Lorne Mitchell 81a1a977f6 DevTools: Fix frontend localizability
There are severals places in the DevTools frontend UI where we need
to update existing strings to ensure that they are localizable.

1. Updated strings that are conditionaly plural into their singular and
   plural forms.
2. Updated strings that use concatenation to instead use variable
   substitution.
3. Fixed a couple other minor issues.

Regarding the use of variable substitution instead of concatenation.

Consider:

Common.UIString(palette.colors[i] +
  '. Long-click to show alternate shades.');

Here, the location of the color isn't captured, instead the actual hex
value is. What we really need is a string with a marker for the
variable substitution.

Instead, we should do the following:

Common.UIString('%s. Long-click to show alternate shades.',
  palette.colors[i]);

Or,

ls`${palette.colors[i]}. Long-click to show alternate shades.`;

Change-Id: Ica7253f7c69e9a2478452d0a944147680b4ca8d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504254
Commit-Queue: Lorne Mitchell <lomitch@microsoft.com>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#638193}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5e6c21ed70371dcdb04b9f86552ef8537c5e683f
2019-03-06 18:13:13 +00:00
Joel Einbinder 7fbe24c094 DevTools: Convert to Shadow DOM and Custom Elements v1
Bug: 685385
Change-Id: I027e84d8003b7799492211d5fcf8348cd91fd799
Reviewed-on: https://chromium-review.googlesource.com/c/1422962
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#625513}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b00e6ea1c9b4db5d743c7c204b1f63abf89e0398
2019-01-24 05:19:01 +00:00
Blink Reformat 4c46d0969f The Great Blink mv for source files, part 2.
Move and rename files.

NOAUTOREVERT=true
NOPRESUBMIT=true
NOTREECHECKS=true
Bug: 768828
TBR=darin@chromium.org
NOTRY=true

Change-Id: I66d3b155808bc5bdbf237b80208e1e552bcf7f28
Reviewed-on: https://chromium-review.googlesource.com/1001153
Reviewed-by: Blink Reformat <blink-reformat@chromium.org>
Commit-Queue: Blink Reformat <blink-reformat@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#549061}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0aee4434a4dba42a42abaea9bfbc0cd196a63bc1
2018-04-07 15:32:37 +00:00