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>
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>
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>
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>
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>
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
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