Commit Graph
23 Commits
Author SHA1 Message Date
Tim van der Lippe 2e38eeaf9f Remove all comments with only the unrestricted annotation
The unrestricted annotation is Closure-specific and can be removed.
This patch removes all comments with only the unrestricted annotation
in them.

R=szuend@chromium.org

No-Presubmit: True
Bug: 1011811
Change-Id: Iba0723644f53f5307c3077d341271af86becc32a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2569758
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-02 15:25:32 +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 b570ed0015 Typecheck object_ui/RemoteObjectPreviewFormatter.js with TypeScript
R=szuend@chromium.org

Bug: 1011811
Change-Id: Ife15424facd623ee8b242e1ddd7ed2f4d4c872a7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2529362
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-16 15:49:29 +00:00
Alfonso Castaño dfe8ca30ee Minor fixes in console logic for Trusted Types
Previous CL: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2494803
Screenshot: https://i.imgur.com/WFua1Mi.png
Bug: chromium:1048143
Change-Id: Ib04c6f37ced8305eaf01f72b40fd463a7128c628
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2507109
Commit-Queue: Alfonso Castaño <alcastano@google.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-10-29 13:28:42 +00:00
Alfonso Castaño 20d22cd2dc Improve displaying of Trusted Type objects in the console
Backend changes:
https://chromium-review.googlesource.com/c/chromium/src/+/2494761
https://chromium-review.googlesource.com/c/v8/v8/+/2494706

Screenshot: https://i.imgur.com/WFua1Mi.png
Bug: chromium:1048143
Change-Id: I60d02b98e0609751359c5dfa87665d9a9151931d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2494803
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Alfonso Castaño <alcastano@google.com>
2020-10-28 19:39:48 +00:00
Sigurd Schneider 23c5297dda Remove DOM prototype patching of createTextChild(ren)
Bug: chromium:1011811
Change-Id: I44a66c10efd317dcb7d5a4f58ab4be0fded4b215
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2466182
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-10-13 10:23:48 +00:00
Sigurd Schneider 4766e512c5 Use more precise types in components/
This CL turns a few Element types into HTMLElement types, as callers are
setting title and style properties on those.

Bug: chromium:1011811, chromium:1135143
Change-Id: I7d94c6a386977feb6a899c4944f930704b3b2dd4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2452693
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-10-08 11:39:47 +00:00
Jan Scheffler f1f45a8c14 Migrate front_end/object_ui to devtools_entrypoint
R=aerotwist@chromium.org, jacktfranklin@chromium.org

Bug: 1101738
Change-Id: I32e970380fc80fd25233639242a05bbad63cb120
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2324587
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-29 14:29:44 +00:00
Mathias Bynens 4e7f8d5988 Match V8’s new internal field names
A V8 CL renames some internal fields to match the spec:

- [[PromiseStatus]] → [[PromiseState]]
- [[PromiseValue]] → [[PromiseResult]]
- [[GeneratorStatus]] → [[GeneratorState]]

This patch makes the relevant changes to ensure remote objects are
still formatted the way they were before.

Related CLs:

- V8 CL:
  https://chromium-review.googlesource.com/c/v8/v8/+/2202984
- Chromium CL temporarily disabling affected tests:
  https://chromium-review.googlesource.com/c/chromium/src/+/2203201
- Chromium CL re-enabling affected tests (blocked by this CL):
  https://chromium-review.googlesource.com/c/chromium/src/+/2202900

TBR=tvanderlippe@chromium.org

Bug: v8:10506, v8:5416, chromium:1083872
Fixed: chromium:1083872
Change-Id: Ia683923b63f5af4c9e625c9fa120d3d90386b278
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204104
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
2020-05-18 09:08:33 +00:00
Tim van der Lippe 7ea01c27ab Replace complex single class invocations of createElementWithClass
This applies the following replacement to the codebase:

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

to

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

R=aerotwist@chromium.org

Bug: 1011811, 1077215
Change-Id: Ib6dde6bf4d022c42236023ed49feccb44f68a774
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2176117
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-05-04 12:59:51 +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
Mathias Bynens 23ee1aad0a Reconfigure lint rule w.r.t. quotes
We prefer single quotes by default, but still want to allow double
quotes in cases where that helps avoid quote-escaping, and also want
to allow template literals in cases where string interpolation is
used. For example:

    const a = 'xxx';  // ok
    const b = "xxx";  // not ok, should use single quotes
    const c = "xxx'xxx";  // ok, double quotes avoid an escape sequence
    const d = `xxx`;  // not ok, frivolous use of template literal
    const e = `xxx ${42}`;  // ok

Per https://github.com/eslint/eslint/issues/12976, setting
the `allowTemplateLiterals` option for the `quotes` lint rule to
`false` gives us the desired behavior.

Note that the above lint rules are auto-fixed when running the linter;
there should be no need to manually make any changes to appease the
linter.

Per review feedback, this patch also removes the following escape
sequences for printable non-ASCII symbols:

- U+00D7 → ×
- U+2026 → …
- U+2019 → ’

Chromium CL temporarily updating test expectations:
https://chromium-review.googlesource.com/c/chromium/src/+/2083147

Cq-Depend: chromium:2083147
Bug: chromium:1057042
Change-Id: Id6bec3f96ca694d2fbc07dd8629fce305a58df8a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2082372
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Mathias Bynens <mathias@chromium.org>
2020-03-02 16:18:16 +00:00
Mathias Bynens f06e8c0758 Enable no-else-return lint rule with autofix
This rule matches the Chromium-wide coding style.

Bug: chromium:1057042

Change-Id: I21ad946227ca7344146abace1d2f6146b3a6c207
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2078924
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-28 14:17:07 +00:00
Tim van der Lippe 64a94d8105 Migrate object_ui/ to import cross-module
Bug: 1006759
Change-Id: Ic6a53e6183e3621771c019c4c9692c072f812736
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019123
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-24 12:13:48 +00:00
Paul Lewis d85dc3874a Migrates object_ui/ to ESM internally
Bug: 1006759
Change-Id: I958134ba20988888e9fd1377c30eec5bd9cac2ed
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1994973
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-14 18:34:58 +00:00
Tim van der Lippe c96ccd99f0 Remove unused globals
By using the script in crrev.com/c/devtools/devtools-frontend/+/1942289
we can prune all globals that are not actually global. Most of these are
internal private variables that are now module-scoped. Some variables
were also completely unused, which ESLint nicely reported.

Change-Id: I43689ac7544ad1239acc7d0eeec4dcd563d7fea9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1942290
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-29 16:38:40 +00:00
Tim van der Lippe 3574172dc4 Migrate object_ui/ to ESM
Bug:1006759
Change-Id: Ib6726f32d5424dc615055ea7ea2b1658fc44b2c4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1928920
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-21 15:49:14 +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
Mathias Bynens 7d8cd346b8 [devtools] Fix property order mismatch
Previously, there was a property order mismatch between the DevTools
Console Preview and the expanded view. For example:

       input> ({ c: 1, b: 1, a: 1 })
     preview> {c: 1, b: 1, a: 1}
    expanded> {a: 1, b: 1, c: 1, __proto__: Object}

This patch removes the confusing mismatch as follows:

       input> ({ c: 1, b: 1, a: 1 })
     preview> {c: 1, b: 1, a: 1}
    expanded> {c: 1, b: 1, a: 1, __proto__: Object}

The core change happens in ObjectPropertiesSection.js. The test
expectations are updated accordingly (note that for each test, only
the order in which properties/values are printed changes). The patch
also includes a drive-by change across files unifying the way U+00A0
is escaped in string literals.

Screenshot: https://goo.gle/devtools-property-order-mismatch

BUG=989514

Change-Id: I102afcbd107100a52e0932401429a3fa8db99eaf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1806457
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#697200}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: dcc366c27c78ce40ca6f05ac8000528896b4549a
2019-09-17 13:32:10 +00:00
Yang Guo d9d6b557ff DevTools: use default Array.p.sort for stable sort
R=szuend@chromium.org

Change-Id: Ibef42325a778acd4d513e3c038a76fbb266a36c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1748890
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#686346}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b4b1049cc10ba771cb134487e850f945ffc8d618
2019-08-13 08:36:34 +00:00
Joel Einbinder e95b2d4cd5 DevTools: Show private properties in the object properties section
This patch adds private class properties to the list of expanded
properties object properties, and orders them properly in the
object preview.

https://i.imgur.com/DDswaiZ.png

Change-Id: I78c995bc9168a08d22bd69f93e1ded324a191a88
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1630014
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#666933}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2a2a6dc55caa33f524f49025028c3ceb428c2909
2019-06-07 00:38:19 +00:00
Erik Luo 157299825a DevTools: generalize preview without side effect builder
Introduces JavaScriptREPL, a utility that includes
- Logic used by EagerEval for building side-effect-free previews
- Console prompt's preprocessing logic
  (object literal wrapping and top level await)

Bug: 849875
Change-Id: Ie8146435fced9ebf440b43c225d25ef145416247
Reviewed-on: https://chromium-review.googlesource.com/1145911
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#577341}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f8ffab5d79243cb7de978d17669e8decdb9141df
2018-07-23 23:48:44 +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