Commit Graph
698 Commits
Author SHA1 Message Date
Alex Rudenko c8ded2e768 Move inspector overlay unit tests
Change-Id: I2c6fe5cda57feb1213461f87ddd1a72b00665472
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2396135
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-09 06:26:18 +00:00
Alex Rudenko ca9078f199 Move unittests karma config out of the frontend folder
Change-Id: I06e28e5a9afbbf7daa569a9b699c60e4554ed5a9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2395404
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-09 06:02:48 +00:00
Alex Rudenko 0e8d7f4c64 Move inspector_overlay to the top level
This CL moves inspector_overlay out of the front_end folder.
Unit tests remain under the front_end for now as we need to see
how to move them (they rely on karma config and helpers).

Design doc: https://docs.google.com/document/d/1yuQoNPtH2KxSFKoz3bRrQKu9wrPUjW4hx7idzAxb_B4/edit

Bug: 1100925
Change-Id: I0da88d9aae33602572d11485a3cbb46b5e3d588f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2395397
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-09-08 10:38:09 +00:00
Philip Pfaffe 0c069f3956 Tidy up the debugger language plugins test case
A little bit of cleanup:
- Remove most uses of any. Two remain where I didn't find an
  alternative.
- Add typedefs for the plugin interface
- I couldn't manage to factor out the common plugin definitions in a way
  that made the plugins acutally easier to use or write, but I simplified
  them a little.

Drive-By: AsyncScope-ify a helper in sources-helpers.

Change-Id: I92cd1ce21aaec0629ea60534246d33a2ecd380e3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2374215
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-07 17:17:48 +00:00
Philip Pfaffe e687f6142d [wasm-debug] Show variable values on mouse over
The code editor is able to tokenize the C++ code and can identify
variables just as for JavaScript. Given a variable name, we search the
paused call stack's source scope view if it contains a variable of that
name.

Bug: chromium:1113215
Change-Id: I0bafec3eae32821f4914e9f6c6fc8d0ec8c24243
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2339318
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2020-09-07 15:09:28 +00:00
Kateryna Prokopenko b0a518212b Add sources panel link e2e test for Issues tab
Check that a correct line is highlighted in Sources panel when a link is clicked in affected resources of an issue

Bug: chromium:1124712
Change-Id: Ia5af7bc8d9fe9e463b8b7ec88f38727f7862e23c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2391243
Commit-Queue: Kateryna Prokopenko <kprokopenko@google.com>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-09-03 16:12:17 +00:00
Wolfgang Beyer ed9c15fc40 Reland of "Fix context menu for issues banner"
Reland fixes e2e-test for MacOS

Original CL: https://crrev.com/c/2382862
Revert: https://crrev.com/c/2391248

Bug: chromium:1123455
Change-Id: If827a8656f2e09b90f7d9f5b84719beac466aa82
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2391228
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
2020-09-03 13:38:21 +00:00
Wolfgang Beyer 8205ef6b25 Revert "Fix context menu for issues banner"
This reverts commit e3c171740b.

Reason for revert: Test breaks on MacOS

Original change's description:
> Fix context menu for issues banner
> 
> Right-clicking on the (styled like a console message) issues banner
> generated an error (only visible on the DevTools on DevTools console)
> and no context menu would be shown. This CL fixes this behavior.
> 
> 'toExportString()' was added to fix the context menu's 'Save as...'
> option.
> 
> Screenshot: https://i.imgur.com/xQINU9F.png
> 
> Bug: chromium:1123455
> Change-Id: Ia0ef9846fe321248d6498c61a6b650926558439c
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2382862
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>

TBR=sigurds@chromium.org,wolfi@chromium.org

Change-Id: I91328cf6387067a5c53081d8e282f0accf4208d0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1123455
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2391248
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
2020-09-03 12:14:13 +00:00
Patrick Brosset 1824faf288 Layout: Give each grid overlay a different color in order to differentiate them
There can be many grids on a single page, and therefore many adorners in the
Elements tree and many checkboxes in the Layout panel.
Users may want to turn several of these grids on so they can see visually in
the page how they align.

Right now, all grids share the same colors, this makes it hard to know which
lines and which labels belong to which grids:
Example: https://imgur.com/OqqeFGN.jpg

This change introduces some logic to generate a new color for each grid overlay.
Only the main color is generated, and an alpha value is used to derive the gap
color from it. The labels already match the line colors provided, so no changes
needed for this.
Example: https://imgur.com/Kja5xNK.jpg

To generate colors, we use the HSV format and set the S and V values so that we
can go through the whole hue spectrum and keep some consistency between the
colors.
This does mean, however, that we are limited in how many different colors we can
generate (we need to incremenet the H value quite a bit every time to make sure
colors aren't too similar). Hence, after 10 colors or so, we circle back.

Colors are attributed per nodeId, and stored in a map indexed by those ids. This
means that colors are persistent in a user session.

In a future CL, we'll make the swatches clickable so users can change the
colors.

Bug: 1123052
Change-Id: Ie9fa67432230473bcdd438f9b5adf3fce169d165
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2384794
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Shane Clifford <shanejc@microsoft.com>
2020-09-03 09:48:31 +00:00
Wolfgang Beyer e3c171740b Fix context menu for issues banner
Right-clicking on the (styled like a console message) issues banner
generated an error (only visible on the DevTools on DevTools console)
and no context menu would be shown. This CL fixes this behavior.

'toExportString()' was added to fix the context menu's 'Save as...'
option.

Screenshot: https://i.imgur.com/xQINU9F.png

Bug: chromium:1123455
Change-Id: Ia0ef9846fe321248d6498c61a6b650926558439c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2382862
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
2020-09-03 08:09:21 +00:00
Changhao Han ca13f09d78 Add UMA to track computed style grouping usage
Bug: chromium:1096230
Change-Id: I13dd4029ea802b44c2888655f66b45e783663e90
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2392240
Auto-Submit: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-09-03 06:13:21 +00:00
Connor Clark 88d9ad2f3b [Lighthouse] Translate the Lighthouse report based on system locale.
Bug: 941561
Change-Id: I8d20f83077f3d0b124e64838fac6bf176c90ac33
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2382176
Commit-Queue: Connor Clark <cjamcl@chromium.org>
Reviewed-by: Vidal Diazleal <vidorteg@microsoft.com>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Paul Irish <paulirish@chromium.org>
2020-09-02 21:52:01 +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
Tim van der Lippe 71ae782372 Migrate media to devtools_entrypoint
R=jacktfranklin@chromium.org

Bug: 1101738
Change-Id: I670a299a808b9164fb76385efc37d87d5257336d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2390621
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-02 15:13:20 +00:00
Sigurd Schneider 50ec6b20f6 [ts] Add helpers to assert element type
This CL adds two helpers assertElement and assertElements that
can be used in conjunction with querySelector and querySelectorAll
to assert the element types of the results. The functions rely on
instanceof (thereby also performing a null check), and have types
that makes TypeScript reflect the check in the type system (i.e.
after asserting, e.g. assertElement(e, HTMLInputElement) TypeScript
knows that e is of type HTMLInputElement.

The CL also applies the function in a couple of places, and found
a bug in test/unittests/front_end/elements/LayoutPane_test.ts where
a HTMLButtonElement as incorrectly asserted as HTMLInputElement.

Bug: chromium:1011811
Change-Id: Icca56588a75597879003a298040e061fa088da78
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2388388
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-02 12:08:10 +00:00
Jack Franklin 6e9c408473 Fix 404 layoutPane.css in unit tests
This CL does two things:

1. Makes the tests fail if a CSS file fails to preload correctly.
2. Fixes the 404 by adding layoutPane.css to the list of files to be copied.

It's not good that the copying of the CSS is done by the
unit_test/frontend/BUILD.gn. A follow up CL will move the copying of CSS
files into the respective BUILD.gns of the source code (e.g. `ui/*.css`
will be copied to gen in `ui/BUILD.gn`).

Change-Id: Ia46cbcd2b00757b62fce3b5b128a01c30df0281d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2390062
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-02 11:38:30 +00:00
Kim-Anh Tran ce21eed47e Sort and merge location ranges on stepOver and stepInto
This makes sure that the location ranges that are sent to the back-end
are sorted and maximally merged (as required by the back-end).

Bug: chromium:1105765
Change-Id: Ia09f2156469a876997fcc7cdc5ccd7f3a51a3c8a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2354106
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
2020-08-31 12:49:03 +00:00
Patrick Brosset af165fe4d2 Layout: Assorted cosmetic changes to the layout pane as per mockups
This change brings the new Layout panel closer to what the mockups for
this panel specify and also makes a few fixes to manage narrow and wide
sizes better.

For information, the last mockups were shared in this thread:
https://chromium.slack.com/archives/C016SAMDTK7/p1597755197253400?thread_ts=1597421739.244800&cid=C016SAMDTK7

Here is the list of changes:
* Removed the label before the line label drop-down, as per mockups
* Made the line label drop-down first in the settings section
* Fixed a bug where elements would appear as div..class when the
  className contained whitespaces
* Centered checkboxes and labels vertically
* Clipped long node previews with an ellipsis to avoid horizontal
  scrolling
* Fixed a bug where the checkboxes and select button became smaller
  when there was enough space
* Introduced multi-column layout for when the panel is super wide

Before: https://imgur.com/Jo8oMG7.jpg
After: https://imgur.com/zEmGi3V.jpg (also includes moving the settings
to the top, which is in another CL, that I happened to build this CL on)

Bug: 1109177
Change-Id: I1a7c543f7f21d5e003cdb91dbb44dc04765aa0a4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2379226
Reviewed-by: Michael Liao <michael.liao@microsoft.com>
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
2020-08-31 08:41:16 +00:00
Tim van der Lippe 87775943ee Typecheck persistence/FileSystemWorkspaceBinding.js with TypeScript
R=szuend@chromium.org

Bug: 1011811
Change-Id: Ia8059340396e7aee9b6ab78a5326704f788a9099
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2379695
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-08-28 10:33:08 +00:00
Connor Clark aac228ce1b [Lighthouse] Roll Lighthouse 6.3.0
Bug: 772558
Change-Id: I95bb7d9bfc5e192e1a4a2ac865dd3cb43b7fa582
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2380039
Commit-Queue: Paul Irish <paulirish@chromium.org>
Reviewed-by: Paul Irish <paulirish@chromium.org>
2020-08-27 19:54:57 +00:00
Changhao Han f51d07946b Add UMA for showing sidebar panes
Backend CL: https://crrev.com/c/2378025

Bug: chromium:1119895
Change-Id: I5c24b4b49437cea977bcdddc6327cb3702fa88c4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2377585
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
2020-08-27 12:02:55 +00:00
Tim van der Lippe 82bfa12e5b [globals] Migrate extensionServer to instance method
R=szuend@chromium.org

Bug: 1058320, 1122000
Change-Id: I1d9e614321d8c1303ad83388c019c15b83d393a6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2376813
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-08-27 10:46:55 +00:00
Patrick Brosset 60806e12e0 Grid: Support RTL column labels in the grid overlay
The grid overlay supports RTL directed grids, to some extent. The lines and gaps
are drawn correctly, but the number, names, sizing and area labels are
misplaced.

For labels to work, a backend change is required, this will be done in a
separate CL. But a couple of minor things also are required in the frontend:

- Making sure the logic to know if labels are too close to each other works with
  RTL (this requires comparing absolute distances).
- Making sure area name labels are within their areas (instead of starting at
  the right line, but going in the wrong direction, outside of the area).

These 2 things are fixed in this CL. And a new debug file is added for RTL.

Bug: 1096971
Change-Id: I5cbb21283f1eece2c377c4a5ad07e1850e3f36bf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2375585
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-08-27 09:57:45 +00:00
Peter Marshall 4616d9c1bb components: Rename PieChart2 to PieChart
Completing the replacement of the old PieChart

Change-Id: Icb827fc567ce4945522f882897e1ddd041a17e39
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2352746
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-08-27 09:38:35 +00:00
Brian Cui 69ed1bc016 Remove Settings from More tools menu
This CL removes the Settings entrypoint from the More tools menu, as it
receives very little usage (<5%) relative to the top level Settings gear
icon.

This CL also deprecates related Settings entrypoint telemetry.

Bug: 1121312
Change-Id: Ia07de5b2e220246dc800c5fb282cfd820e5b1ae3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2375593
Commit-Queue: Brian Cui <brcui@microsoft.com>
Reviewed-by: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
2020-08-26 23:39:13 +00:00
Philip Pfaffe 75a5e83cc0 AsyncScope-ify the console helpers
The console helpers are using frontend.waitForFunction in a couple
places which are not currently assigned an AsyncScope automatically.

Change-Id: I5a0ebab798e56627b9ded740334aa818648e3235
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2374214
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2020-08-25 15:39:26 +00:00
Philip Pfaffe abd83bc6eb Language Extension API: First-class support for constant variable values
Allowing language extensions to directly report value representations
for known-constant variables saves evaluator roundtrips (Query,
JIT-compile, Send to the engine, execute, retrieve result), which take
quite some time. Additionally, the new API also allows us to test the
display of variable values, since we're now able to easily provide
values to the frontend from a test extension.

Bug: chromium:1113662

Change-Id: I883115816f53e9d85b0e86549fb23d0f588050b8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2339556
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2020-08-25 15:38:21 +00:00
Tim van der Lippe f8a851ceac Fix snippets flaky e2e test
This should hopefully make sure that we can always find the selector.

R=petermarshall@chromium.org

Fixed: 1111255
Change-Id: I2a69c3a561f15e0e6f72c87fd454c69f7ed76a58
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2367948
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-08-24 07:59:47 +00:00
Peter Marshall aeac448bc1 components: Create a PieChart component
Add a web component called PieChart2. The old non-component version
is called PieChart already. We'll replace it with this one once it lands
and then remove the original PieChart and rename this one.

Switch over one user of PieChart (TimelineUIUtils) to use the new
version.

Add tests and examples to the component server.

Change-Id: I563059e0322739d533a95155735fcafbe414e815
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2339562
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-08-24 07:57:37 +00:00
Changhao Han 0a98cc54ea Implements grouped Computed styles in the Computed tab
Design doc: https://goo.gle/devtools-computed-styles

Screencast: https://imgur.com/a/n8Y7jXH

Updated screencast for expanding by default: https://imgur.com/a/0CUnlch

Bug: chromium:1096230, chromium:1084673, chromium:1106251
Change-Id: Ib6f22de5f96cb7e35fe60730c186cbde7d2905fe
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2360377
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
2020-08-21 21:30:00 +00:00
Tim van der Lippe 992e4b1fa2 Manually update DevTools Chromium DEPS.
This required changes to the `console.log` expectations.

R=sigurds@chromium.org

Change-Id: Ic80a0e6f621c813626013834b3bfb415366135af
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2366781
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-08-21 11:06:19 +00:00
Patrick Brosset d7508751f4 Grid: Transform grid lines and labels based on the current writing mode
The backend now sends the writing-mode value for the highlighted grid.
See CL: https://chromium-review.googlesource.com/c/chromium/src/+/2363050/

By default, grid containers are horizontal-tb, unless the CSS specifies
otherwise. The only other 2 values that can be given by the backend are:
vertical-lr and vertical-rl.
Other values are either deprecated (tb, bt, ...) or not supported yet (sideways)

Based on the writing-mode, the overlay frontend applies a transformation to the
canvas context that draws the grid lines. It then saves this as a matrix so it
can be reused to transform the points where labels are placed (since those are
not part of the canvas).

GIF: https://imgur.com/n3tX2Zm.gif

Bug: 1096971
Change-Id: Ie7ec08850c51170fe973ed50d0787824792bdd16
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2364455
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
2020-08-21 09:02:27 +00:00
Alex Rudenko 5d93c7e064 Move Layout pane to the 3rd position in the sidebar
This CL makes the Layout pane more prominent by moving it to the
3rd position in the sidebar.

Screenshot: https://i.imgur.com/MOwlx6q.png

Bug: 1109177
Change-Id: I4837644d815eee8a57848bd4a92501556d56f4dd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2366732
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
2020-08-21 07:49:37 +00:00
Alex Rudenko 7529de9714 Show grid elements across iframes
This CL adds subscriptions to all DOM models in order to display
grid nodes for all iframes found on the page (including out-of-process
ones).

Bug: 1109177
Change-Id: Ifa4962969793b4e173cd4d15612afd43be957edd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2366795
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-08-21 07:47:57 +00:00
Alex Rudenko fc3bc1bae4 Fix suggest color for certain color combinations
Some color combinations with low contrast cannot be fixed by changing
the luminance alone. This CL adds searching for a color with a different
saturation if the luminance search didn't yield results.

Fixed: 1120223
Change-Id: I114d0ba7a2941958a1fdab051661b13dd1112e59
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2367935
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-08-21 05:38:47 +00:00
Jack Franklin 1e53cb87ed Load runtime stylesheets in to the components server
Change-Id: I0f24656ae941f0ade4a3fd40d024a2420142e068
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2354090
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-08-20 11:39:24 +00:00
Jack Franklin 314b8c8aea Fix empty function bodies in component bridges
If we have a helper method that returns data, TS will moan about there
not actually being a return in the function body. Adding code that
throws an error fixes this and is safe as this bridge code is never
executed, it exists to satisfy our compilers.

Change-Id: Iff34733adac4267ff04aff1ba0bb58a38c71dd6b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2366794
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-08-20 09:54:55 +00:00
Alex Rudenko 3de657afc9 [Metrics] UMA tracking for suggest color feature in Color Picker
This CL adds UMA tracking histogram for the new feature of
automatically fixing low-contrast colors to help answer the questions:

- how often is the feature used?
- what contrast threshold is being primarily used?

Backend CL: https://crrev.com/2360069

Bug: 1093227
Change-Id: I3568358e5b26bc63a7c5b569947ccd1d152bb592
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2360010
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2020-08-20 08:17:24 +00:00
Alex Rudenko 1cb771bfe0 Improve adorner test
Makes use of adorner helpers in the adorner test.

Change-Id: Ide8e93d410d8abad3a9291238eda7b1c25b40eba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2366752
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-08-20 08:03:04 +00:00
Alex Rudenko 320d83cddb Fix LayoutPane icon appearance in dark mode
Fixed the Reveal element icon in the dark mode and, as a drive-by,
extracts LayoutPane's CSS into a separate file (+ 1 problem fixed
by CSS linter).

Bug: 1109177
Change-Id: Iaa02d93aae6f74aab520e70093584870e4fa5c46
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2364356
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-08-20 06:47:24 +00:00
Alex Rudenko 550dc4dab5 Extract node text into separate component
This CL extracts the node text (e.g., tag#id.class1.class2) into
a separate component and uses it in LayoutPane and ElementsBreadcrumbs.

Bug: 1109177
Change-Id: I933e99f4600ff8b59e737f1f5d25405377790395
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2362580
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
2020-08-20 06:32:04 +00:00
Alex Rudenko aca27b0f39 Reland: suggest accessible color
This CL adds a button to the color picker to fix colors with low
contrast + a few issues fixed and more tests compared to the
previous CL.

Design doc: https://goo.gle/devtools-contrast
Video: https://i.imgur.com/Z6PhkTd.mp4
Previous CL: https://crrev.com/c/2334970

Bug: 1093227
Change-Id: I0d0e4bcb01c08f178b03f64e4545481438ebbad9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2362578
Reviewed-by: Jecelyn Yeen‎ <jec@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-08-19 08:09:47 +00:00
Kateryna Prokopenko 314d6b7155 [issues] Get target for each issue individually (instead of main target) to get correct node in case of out of process iframes
We lose information about the target in aggregated issue, so for now create primary key from issue details to get the right target.

Bug: chromium:1115421
Change-Id: I2cde1f3db599ee989e45f36518316ba9693e76ab
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2352726
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@google.com>
2020-08-19 07:32:37 +00:00
Ilya Sherman a46c048cda Pull code for formatting the X-Client-Data header from Chromium/upstream
This is the devtools side of https://chromium-review.googlesource.com/c/chromium/src/+/2360517

R=mathias

Bug: chromium:1103854
Change-Id: I5ec32a4e84a0f873ec5372579728a94f47a83463
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2361093
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Auto-Submit: Ilya Sherman <isherman@chromium.org>
2020-08-19 05:25:27 +00:00
Jack Franklin c6b0252897 Component bridges: error if using TS built-in type
Because the bridge generator won't try to generate built-in types, if
you use one in your component, it won't be replicated in the bridge. So
if we see this let's error loudly.

Change-Id: Ifea063f134e77a66c9d5d2bbb7553e0beb5564db
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2362574
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-08-18 16:54:39 +00:00
Jack Franklin d0022b00cf Improve public methods support in bridges
- Error if a method doesn't have an explicit return type.
- Correctly generate `@return {void}` from a :void annotation
- If a public method returns an interface, add that to the list of
  interfaces to convert.
- Update all tests and fixtures accordingly.

Change-Id: I9b9aba451d04f714951b793faeec8979bac4fb8a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2362567
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-08-18 11:45:38 +00:00
Johan Bay fa025f61cf [e2e] fix flaky console test
This CL attempts to fix a few console tests that sometimes fail if some
of the console messages are slow to appear.

Bug: 1112692
Change-Id: I79d91ce116b63de5bd4f686333e7436de67ac618
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2360375
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Johan Bay <jobay@google.com>
2020-08-18 10:36:48 +00:00
Alex Rudenko 21a9ca3799 Add a button to reveal the element to the Layout pane
Screenshot: https://i.imgur.com/vmq7XEZ.png

Bug: 1109177
Change-Id: Ib23d775890952651681d2e81c00db5d94a9741b8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2360017
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
2020-08-18 07:10:18 +00:00
Adam Raine f46d158df8 Change 'View Trace' button to indicate throttling method
Lighthouse issue:
https://github.com/GoogleChrome/lighthouse/issues/9971

The 'View Trace' button can lead to confusing results when using
simulated throttling because the timings in the original trace do not
match the metric results.

This CL renames the 'View Trace' button to be 'View Original Trace' and
adds a tooltip to clarify the situation.  If active throttling is used
then the button reverts to 'View Trace' and hides the tooltip.

Change-Id: I8ade46c3031dafc381237559dde27181529177fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2339861
Commit-Queue: Adam Raine <asraine@google.com>
Reviewed-by: Connor Clark <cjamcl@chromium.org>
2020-08-17 22:44:37 +00:00
Patrick Brosset 78fa1f578a Remove the previewed class when pressing Escape in the .cls pane
When typing new classes in the .cls pane, they get applied to the
selected element as you type, in order to be previewed live.
However, if you press Escape, the classes go away from the .cls pane
but they stay on the element itself.
They should not.

This change fixes that by making sure we re-apply the active classes
when this happens.
It also adds a new e2e test for the .cls panel.

Gif of the fix: https://imgur.com/BjDiEQY.gif

Bug: 1114726
Change-Id: If5823db63c504e3502513bd09e9a82c0cfa0d612
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2354238
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tony Ross <tross@microsoft.com>
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
2020-08-17 16:01:46 +00:00