Commit Graph
23 Commits
Author SHA1 Message Date
Tim van der Lippe 3cc3af34a3 Migrate trimEndWithMaxLength to string-utilities
R=szuend@chromium.org

Bug: 1050549
Change-Id: I084877860b71f086bccd500cea1c3ef77a37f615
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2631116
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-01-19 14:51:47 +00:00
Tim van der Lippe e4d64e7ae0 Remove unrestricted from comments that include other annotations
For all comments that contained both the unrestricted annotation
and any other potential annotation, remove only the unrestricted
annotation.

R=szuend@chromium.org

No-Presubmit: True
Bug: 1011811
Change-Id: I27dd67f657cdb1a9233d768eea81cabe2591f5f7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2569759
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-12-02 15:31:52 +00:00
Mathias Bynens a0d60451e1 Remove custom setImmediate implementation
All of the existing callsites passed only a callback parameter, with
no additional `args` parameters, and so this functionality is
equivalent to the built-in queueMicrotask().

Note that there are some upstream tests that currently still use
setImmediate. These tests are ported in [1], which should be merged
before this patch can land.

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

Bug: chromium:1050549
Change-Id: Iee3d286d38bcb17d9b78ca89f9897e8ca37b6d94
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2554560
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-11-30 14:20:29 +00:00
Jack Franklin a4b6ac8219 [TS] CodeMirrorTextEditor.js
Bug: 1011811
Change-Id: Idad5e01d8d843171541fa5557dc6cdda4c19e155
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2556688
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-11-25 09:28:08 +00:00
Alex Rudenko 83c780d3e8 Enable TypeScript for TextEditorAutocompleteController
Bug: 1011811
Change-Id: I5f112eafafb975e21ae58d431f1923b52840235d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2552505
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-11-20 16:40:02 +00:00
Jack Franklin 8ce2d8d2ed Add dark mode patch option to createShadowRootWithCoreStyles
This CL follows on from https://crrev.com/c/2516345 and adds the
`enableLegacyPatching` flag to `createShadowRootWithCoreStyles`. This
was harder as the function already took optional argumetns so I have
updated it to take an options bag, and then added an additional option.

This CL means that all the sites where we need to add the
`enableLegacyPatching` are done, and we can begin to plan the first
migration away from the legacy patching mode.

Bug: 1122511
Change-Id: I24e5dbb85e654eae28110ccfb603972034548921
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2517566
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-11-04 13:32:28 +00:00
Jack Franklin 9e042a9648 Migrate text_editor and cm to devtools_entrypoint
This was a bit of a bigger CL than intended:

* Added `.d.ts` files to a bunch of CodeMirror files to keep the TS compiler
happy.
* Moved `front_end/cm` to a BUILD.gn and devtools_pre_built. Long term (follow
up CL) we can get rid of `front_end/cm` and have `text_editor` depend on the
third_party CodeMirror directly.
* Migrated text_editor to be a devtools_entrypoint.

Bug: 1101738
Change-Id: Iac61216efa754163a478a3c529ab526ec83b0d13
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2312676
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-28 09:43: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 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 1c2ce43756 Migrate text_editor/ to import cross-module
Bug: 1006759
Change-Id: I0d82c7de8a621661704480dc4fcabe95964aaeca
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2035937
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-04 13:02:11 +00:00
Paul Lewis 8429b45ecf Migrates text_editor/ to ESM internally
Bug: 1006759
Change-Id: Iefaa635004b0ab5c9bdfda314dcbf265de3d2682
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2002598
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-15 17:16:04 +00:00
Tim van der Lippe d1cfda327d Migrate text_editor/ and cm_web_modes/ to ESM
cm_web_modes/ was used both in a worker and in the normal browser
context. However, both formatter_worker/ and text_editor/ included the
relevant files in their scripts array.

The fix is to make cm_web_modes a proper module and import either the
browser (_cm.js) variant or the worker (_headless.js) variant.

Bug: 1006759
Change-Id: I85c6f67102d8ffd94e073850b1ac7adcb289b1b2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1934218
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2019-11-27 14:12:52 +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
Tim van der Lippe ffa7862d4e Update Closure compiler to v20190729
The new compiler caught a lot of pre-existing issues in the codebase.
Sadly, the old compiler version was not smart enough to understand the
new changes. Therefore, the changes have be included in the same CL as
the compiler update.

Most of the changes are related to better handling of prototype and
class inheritance, as well as handling of null/undefined tracking.

Change-Id: I3941a3a240a4d09c4945e1e20d2521090ef837c9
Bug: 991710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762081
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
Auto-Submit: Tim van der Lippe <tvanderlippe@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#696761}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ca93474213278e32e36d6ace1474c56884030757
2019-09-16 12:07:12 +00:00
Erik Luo 0e3795d175 DevTools: provide preset values in CSS autocomplete
Some properties including filter/*gradient have functions as values.
CSS autocomplete shows their function names as suggestions
(blur, brightness). In this CL, autocomplete suggests full preset
samples (blur(1px)) so that intermediate suggestions apply visibly
meaningful changes to the page.

Bug: 931145
Change-Id: I4f693b200cb49f5fdf8f428c03154e136c7a8ed2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1466284
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#640575}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: beaedbdb329d74e1d1b9a0166508e0a3f7f632f5
2019-03-14 01:39:04 +00:00
Erik Luo 025f3f7d7d DevTools: trim visible autocomplete hint text
Bug: 867940
Change-Id: If4fdb0c6f0e5a9eab22de9b05e226d215de73026
Reviewed-on: https://chromium-review.googlesource.com/c/1262963
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#597350}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 88be57bdf9195e03cf6040911e505addc1d799d8
2018-10-05 22:32:12 +00:00
Joel Einbinder 7ddfa6c277 DevTools: Don't overwrite unprocessed lines in TextEditorAutocomplete
CodeMirror change events can be batched, so multiple before change
events can happen before a change. If a line has not been processed
yet, we shouldn't overwrite it on the intermediate beforechange
or words can be left behind in the dictionary.

Change-Id: I056d95a85870cb1a5d25797159bad01628848edf
Reviewed-on: https://chromium-review.googlesource.com/1083213
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#563818}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: df8ba004326cd0a2182b002b29475111d7737a05
2018-06-01 21:56:02 +00:00
Joel Einbinder 13157addd1 DevTools: Have the console SuggestBox prefer top when eager eval is on
This should make the suggest box obscure eager eval less often.

Change-Id: I60573ed142947daa005f648c13d1c3a32f8d492b
Reviewed-on: https://chromium-review.googlesource.com/1048025
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#558097}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a5f5f164294fd4d330f9b6f758d8b73056684838
2018-05-12 02:16:37 +00:00
Joel Einbinder 2fc0fb7ea3 DevTools: Give argument hints in the console prompt
https://i.imgur.com/Y3OlPM2.png

Change-Id: Ic1d9ef1d47ff93ce77bfc3ae7173689bccf0cb2c
Reviewed-on: https://chromium-review.googlesource.com/1031096
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#557030}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 66bdf19b13c9a1dffbd47121101e0b8aedde3495
2018-05-09 00:43:10 +00:00
Erik Luo 6f5c111941 DevTools: convert below prompt experiment into setting
The new setting is in the toolbar behind the gear.
Screenshot: https://imgur.com/a/09myIJH

Bug: 810176
Change-Id: Ifbd2a2bfc6712e2f2415e384c040f5520b1e2347
Reviewed-on: https://chromium-review.googlesource.com/1045180
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#556734}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 93eb26e6cbda0437be38d2d4f00f0ab2b9b411c1
2018-05-08 08:59:22 +00:00
Joel Einbinder b6b043b39d DevTools: Use current suggestion for eager eval
Change-Id: I4079e769b46f16d3635c25276beb832ced10107b
Reviewed-on: https://chromium-review.googlesource.com/1041076
Reviewed-by: Erik Luo <luoe@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#556594}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ef612396f8ca20e7070b770cb39293bf0882f462
2018-05-07 22:58:13 +00:00
Joel Einbinder cb4688dbaa DevTools: Select console suggestions with enter
* Enter accepts the current suggestion in the console.

* History suggestions are not auto-selected. The user must use the
  arrow keys or manually click to select them now.

Previously we worried about that the user would accidentally select a
suggestion in the console when they actually wanted to run the command
as is. Due to recent improvements in autocomplete, this is less of a
problem. Autocomplete showing up on an already complete expression
should be extremely rare. The only exception is history completions,
which are no longer autoselected.

Change-Id: Id9d567ae69f4c29c63e875a1f3285448adbd7ce3
Reviewed-on: https://chromium-review.googlesource.com/1026838
Reviewed-by: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#555609}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ca3ac226e566791986bb6451bdfcb02d661c6eb8
2018-05-02 23:29:16 +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