Commit Graph
23 Commits
Author SHA1 Message Date
Vidal Guillermo Diazleal Ortega 83edb474b3 [Loc] Migrate Sources to Localization V2
- Migrate sources to use Localization V2 APIs.
- Removed sources grdps

Tested with en-XL.json
https://imgur.com/a/vDrfTAv

Bug: 1136655
Change-Id: I01d4fcdc3f115e9edb3fae933c7d5c6b9ffb77c0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2692743
Commit-Queue: Vidal Diazleal <vidorteg@microsoft.com>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2021-02-16 19:14:49 +00:00
Sigurd Schneider cb2d45671e Enforce naming convention for properties
This CL enforces general camelCase naming for properties,
with the following exceptions:
  - public properties are allowed to have a leading underscore until
    we've migrated them (they were probably introduced by the
    JSDOC -> TS automated script).
  - static readonly class properties must use CONSTANT_CASE. For
    non-static readonly class properties camelCase is enforced,
    and I think this gives the right intuition.

Bug: chromium:1057042
Change-Id: I482b5b7cfe2b856e83fba8b78be222d60761db19
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2692210
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-02-15 09:21:50 +00:00
Patrick Brosset 73316d8aa2 Fix regression where color-picker isn't anchored on the color swatch
This bug comes from the fact that SwatchPopoverHelper expects an element
to anchor the color-picker to.
That element used to be the old color swatch component, which had a way
to get a reference to the icon element (the little colored square).

The new color swatch component doesn't expose its internal DOM structure
like the old one did, and it's probably better to keep it this way.
So the SwatchPopoverHelper is now getting the entire color swatch
component element as an anchor, causing it to position the color picker
at its center (so instead of pointing to the colored square, it points
to somewhere within the text).

In this change, I made it so the new color swatch component exposes a
public method that returns the AnchorBox instance that
SwatchPopoverHelper needs.

Before: https://imgur.com/eUJrvCk.png

After: https://imgur.com/SAk8dyO.png

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

These usages have been manually audited using the following regexes:

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

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

A follow-up CL will clean up the getters.

R=jacktfranklin@chromium.org

Bug: 1150762
No-presubmit: True
Change-Id: I5928e75c70293531849e0576f4fb2a2a8b3e02d2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2555060
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-11-23 17:16:46 +00:00
Tim van der Lippe 2e4ad365f6 Remove bridge files from inline_editor
Since inline_editor is now TS-only, the bridge files are no
longer necessary.

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

Bug: 1011811
Change-Id: I081dc8653aa255892f785fd847d81cd550535696
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2546922
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
2020-11-18 14:57:08 +00:00
Yang Guo 7e2e326a0e [ts] Typecheck BezierEditor.js
Bug: 1011811
Change-Id: I3d3b6eaaa0c87c95b85a2be59351ebceb2b36773
R=tvanderlippe@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2512229
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-02 12:52:32 +00:00
Patrick Brosset 7b2a3361a5 Fix color-swatch regression in Sources panel
The color-swatch component was refactored in bug 1137438 and this
introduced a bug in the Sources panel where editing colors in
stylesheets using the color picker doesn't work anymore.

with this change, we now make sure the text for the swatch is available
as textContent, but hidden from the codemirror text editor, and we
re-wire the swatch-click event to show the picker.

Bug: 1141875
Change-Id: Idd811397ffaca9e5f4a2c54a7d6e2c163398c8c8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2495210
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Tony Ross <tross@microsoft.com>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-10-26 09:24:55 +00:00
Alex Rudenko 4504e3a359 Show icons explaining flexbox-direction:row in Styles panel
This CL adds an icon for the flex-direction: row property that
shows up when editing the styles. The icon is automatically rotated
based on the element's direction. The feature is behind a new experiment
flag called cssFlexboxFeatures.

Video: https://i.imgur.com/EE9LKj1.mp4
Backend CL for metrics: https://crrev.com/c/2485268

Bug: 1139945
Change-Id: I674215f62b2de6fd2f14884974eda186ad39ce3e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2485081
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-10-23 13:34:31 +00:00
Patrick Brosset 284a5933e2 Refactor the ColorSwatch to use TypeScript and LitHTML web component
This will make it possible to reuse this component in other new-style
web components like CSSVarSwatch (which, today, duplicates the logic).

The ColorSwatch has a number of different consumers today that require
different things from it. I looked at all these consumers and based on
them defined an API that should work for everything:
- renderColor: which accepts either a parsed color or a string to be
parsed as well as an optional format (or flag to use the format from the
user settings) and an optional tooltip.
- swatch-click event: to alert consumers when the swatch is clicked, so
they can hook up the colorpicker to it.
- format-changed event: to alert consumers when the swatch is
shift-clicked so they can react to the new format.

This component has 1 slot that consumers can use to display the color
value as text.
This is useful mostly for the Styles pane. Indeed, the way properties
are edited in that pane relies on them having an available textContent.
So the color string needs to be in the light DOM, not only in the shadow
DOM.
This is why you'll see the slotted element being updated when the format
changes.

Bug: 1137438
Change-Id: I27b757e63a54be2899d9d6b0e94d1af54f3ee22d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2480042
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Shane Clifford <shanejc@microsoft.com>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
2020-10-23 08:04:21 +00:00
Jack Lynch 726aef930d Partial reland: Remove dependencies on ShortcutsScreen
This CL was reverted here due to a crash: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2485079

The cause of the crash is that devtools_ui_bindings limits histogram
enums to 99 items and the previous iteration of this CL increased the
number of items in KeyboardShortcutAction to 105, so any use of the
KeyboardShortcutFired histogram would result in the "Terminating
renderer for bad IPC message, reason 18" error. I've got a CL up here
[1] to raise the limit, but in the meantime, I've left the last seven
actions out.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2488561

This CL removes all dependencies on ShortcutsScreen in preparation for
its removal. Since CSSPlugin and TransformController actually store
their shortcuts in ShortcutsScreen, those shortcuts have to be moved
into the module.jsons so that they can be managed by ShortcutRegistry,
as most other shortcuts in the DevTools are.

Custom shortcuts explainer: https://docs.google.com/document/d/1oOPSWPxCHvMoBZ0Fw9jwFZt6gP4lrsrsl8DEAp-Hy7o/edit#

Bug: 174309, 1140386
Change-Id: Ieea11b88634bb523bcebd6c144c95d54a0b2b3a8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2488914
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-10-21 19:06:05 +00:00
Alex Rudenko 94ba82d9a2 Revert "Remove dependencies on ShortcutsScreen"
This reverts commit 99620c4bfc.

Reason for revert: crbug.com/1140386

Original change's description:
> Remove dependencies on ShortcutsScreen
>
> This CL removes all dependencies on ShortcutsScreen in preparation for
> its removal. Since CSSPlugin and TransformController actually store
> their shortcuts in ShortcutsScreen, those shortcuts have to be moved
> into the module.jsons so that they can be managed by ShortcutRegistry,
> as most other shortcuts in the DevTools are.
>
> enums.xml changes to match userMetrics changes: https://chromium-review.googlesource.com/c/chromium/src/+/2464047
>
> Custom shortcuts explainer: https://docs.google.com/document/d/1oOPSWPxCHvMoBZ0Fw9jwFZt6gP4lrsrsl8DEAp-Hy7o/edit#
>
> Bug: 174309
> Change-Id: I5d9ae2e28c555c88c5549fb830575b36878e0f96
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2472674
> Commit-Queue: Jack Lynch <jalyn@microsoft.com>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>

TBR=mathias@chromium.org,Rob.Paveza@microsoft.com,jalyn@microsoft.com,tvanderlippe@chromium.org

Change-Id: Ia0b49ea0e53405863e4ed7ee3f0163554d3c4643
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 174309
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2485079
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-10-20 06:59:53 +00:00
Jack Lynch 99620c4bfc Remove dependencies on ShortcutsScreen
This CL removes all dependencies on ShortcutsScreen in preparation for
its removal. Since CSSPlugin and TransformController actually store
their shortcuts in ShortcutsScreen, those shortcuts have to be moved
into the module.jsons so that they can be managed by ShortcutRegistry,
as most other shortcuts in the DevTools are.

enums.xml changes to match userMetrics changes: https://chromium-review.googlesource.com/c/chromium/src/+/2464047

Custom shortcuts explainer: https://docs.google.com/document/d/1oOPSWPxCHvMoBZ0Fw9jwFZt6gP4lrsrsl8DEAp-Hy7o/edit#

Bug: 174309
Change-Id: I5d9ae2e28c555c88c5549fb830575b36878e0f96
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2472674
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-19 18:14:39 +00:00
Tim van der Lippe a674296415 Typecheck sources/CSSPlugin.js with TypeScript
R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: Ie0de2db9ad33e5d9635336d9a6717cc6939d9226
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2443090
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-10-02 08:29:20 +00:00
Jan Scheffler e1a1b0fbbf Migrate front_end/sources to devtools_entrypoint
R=aerotwist@chromium.org, jacktfranklin@chromium.org

Bug: 1101738
Change-Id: I79bcbb35ccf48f6336cde80858f0177427703795
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2332224
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
2020-07-31 14:33:20 +00:00
Tim van der Lippe 93b57c3bbc Remove prototype wrangling for String formatters
They are now moved to the StringUtilities file. Sadly, `String.sprintf`
is still used in the TestRunners that can't use ES modules.

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

Bug: 1050549
Change-Id: Ia7b38dc212282a9800ee8c3083dac7f4a5e046e1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2067057
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-02-20 18:15:46 +00:00
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 fbbf981a34 Migrate sources/ to import cross-module
Bug: 1006759
Change-Id: I9b91ba0c24a14ca4d30cf3dd4469d5e162bc96db
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2054548
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-13 17:11:00 +00:00
Paul Lewis 39944955e0 Migrates sources/ to ESM internally
Bug: 1006759
Change-Id: Ie1ca01eaadde94191431217f297b108dde5e8adf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2002596
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-22 17:15:48 +00:00
Tim van der Lippe 8987f8f14e Migrate sources/ to ESM
Bug: 1006759
Change-Id: I509e05a6e4f4c974dbcdd8224f0439d7b1b98aec
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1985672
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-06 12:57:13 +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
Joel Einbinder d5fcd15e71 DevTools: Cleanup DebuggerPlugin
This patch merges some variables together which were seperate inf
JavaScriptSourceFrame, takes @unrestricted off of the plugins, and
renames JavaScriptSourceFrame to DebuggerPlugin where appropriate in
tests.

Bug: 778043
Change-Id: If1d86f46afff1bf0af328090a15a5a1bc92726d7
Reviewed-on: https://chromium-review.googlesource.com/1015650
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#552218}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ffc418d98575770088e992d1e88bcd95d6395bea
2018-04-20 00:41:09 +00:00
Joel Einbinder 52829ed75d DevTools: JavaScriptSourceFrame -> DebuggerPlugin
This moves JavaScriptSourceFrame into a plugin, and completes
the plugin initiative.

Bug: 778043
Change-Id: I5908cfe46650fd50524a08b2e402d8ac6ce77cc9
Reviewed-on: https://chromium-review.googlesource.com/889692
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#551193}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0920b5eecf51ca3b520098d09ef65460acba3407
2018-04-17 00:47:45 +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