Commit Graph
37 Commits
Author SHA1 Message Date
Tim van der Lippe 79960a9c04 Typecheck sources/UISourceCodeFrame.js with TypeScript
R=szuend@chromium.org

Bug: 1011811
Change-Id: I832ef16ba413d096378f6d71f17b8962958f66dd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2450030
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-07 15:15:55 +00:00
Tim van der Lippe 7f2002c598 [globals] self.runtime
Migrate all usages of self.runtime to Root.Runtime.Runtime.instance().

This also requires various type updates, as now Closure/TypeScript
can better understand the code and discover issues.

R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: Ice07aa0ca959e61a6acdf4618b9a272d8c1096b8
Fixed: 1081614
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2434339
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-29 10:52:39 +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
Peter Marshall 05d1104645 Enable lineWiseCopyCut CodeMirror option for the Sources panel
This was disabled in response to a bug being filed against the Elements
panel after clicking 'Edit As HTML' on an element. When editing an
element as HTML, the window that appears doesn't look like an editor
and users probably aren't expecting 'editor-like' shortcuts like this.
(crbug.com/470435)

The sources panel is an editor (and looks like one) so we restore the
ctrl-x or ctrl-c behavior there, which is to cut or copy the current
line when there is no selection and the shortcut is used. These shorcuts
work the same way in VS Code.

Bug: chromium:1066415
Fixed: chromium:800028
Change-Id: I1a5f16705900c9caf14099d079dca2154bbb0ec6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204101
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-05-15 13:50:36 +00:00
Tim van der Lippe 773bf1e671 Fix placeholder height for live console expressions
It turns out we are poking into CodeMirror internals and implicitly
relying on its styling. In https://github.com/codemirror/CodeMirror/pull/5963
a selector on a `pre` element in CodeMirror was updated to be more
specific. We were implicitly relying on this styling, as we inject
`pre` elements as placeholders for these console live expressions.

Therefore, add these classes explicitly to make sure the height
is correct. For future changes, we should remove the poking of
internals and also more frequently update CodeMirror so that
it is easier to bisect what the culprit is.

R=bmeurer@chromium.org

Fixed: 1074197
Change-Id: Ia49e4d97605b5fcd6c17b83d124a3f39a42a294c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2168880
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-29 09:39:55 +00:00
Benedikt Meurer 3244d968e1 [CodeMirror] roll CodeMirror to 5.53.2
Also fix instructions and roll_codemirror.py script, and add the
new `wast.js` web mode for WebAssembly disassembly (which is going
to be hooked up in a follow up CL).

Bug: chromium:1042721
Change-Id: I2f14934b48528439b707538a64dfff4c2ac846e1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2159505
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
2020-04-23 10:11:09 +00:00
Paul Lewis 2d7d65c5e8 [global] Remaps self.Common.settings
This CL changes references to self.Common.settings (the global
instance of SDK.Common.Settings) over to
Common.Settings.Settings.instance(). To keep both TypeScript and
Closure happy we must make a method on the Settings class itself,
since it only allows private constructors to be accessed by static
methods on the class.

Bug: 1058320
Change-Id: I04afc8caf64acf29cdda13ef03ad05cfff4786a1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2091450
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-16 22:04:07 +00:00
Jack Franklin 1be909c149 Create NumberUtilities and move constrain in
Bug: 1050549
Change-Id: I3d7d5e21c65a3c66fc9d1a30a61e26fedcc4ada1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2085172
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-04 14:00:05 +00:00
Tim van der Lippe e2418436c0 Remove typedefs from {source_frame,sources,text_editor,text_utils}-legacy.js
Bug: 1006759
Change-Id: I4c972b7714850b2c7064a1dc9ab5b675be5d5917
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2056849
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-18 14:16:57 +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 4b64b3f263 [Global] Remap refs to Common.moduleSetting
Bug: 1006759
Change-Id: Ia45ef0fd0b97588ca23a8d784c0564050b0bbf4c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016748
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 12:00:20 +00:00
Brian Cui 564dcf4c07 DevTools: Add Sources setting option: Allow/Disallow scrolling past end of file
NOTE: this is a reupload of CL 1838270, targeting the new separate
DevTools repository.

https://chromium-review.googlesource.com/c/chromium/src/+/1838270

This PR addresses customer feedback received regarding scrolling
behavior for files viewed in the Sources tab. Currently, users are able
to scroll beyond the end of file, for all files at least two lines or
more in length. However, for extra-small files, this behavior is awkward
as the entire file fits inside the editor and scrolling is not needed.

As it turns out, this behavior is a feature. It is also present in
some other text editors, like VSCode. The purpose of scrolling past EOF
is to enable developers to scroll lines to the top of the file, even if
those lines are near the end of the file. After an informal discussion
with my peers, some prefer this feature, while others find it
unintuitive and distracting (myself included).

This change adds a new checkbox toggle option to the Sources setting:
"Allow scrolling past end of file"

When enabled (by default), the behavior is the same as it is now: users
may scroll beyond the end of file for all files >2 lines in length.

When disabled, the user may only scroll to the last line in the file,
and a scrollbar does NOT appear if the entire file fits inside the
editor. (When the editor is resized, a scrollbar appears as needed).

Animated GIF demo: https://i.imgur.com/zJytuf1.gif

Remark: the scroll past EoF feature is not native to CodeMirror and is
a Chromium specific customization for the Sources tab.

Bug: 998270
Change-Id: I79d11cf68c105aabe407269819f0495adfba44b7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1872878
Reviewed-by: Fabio Rocha <fabio.rocha@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Commit-Queue: Brian Cui <brcui@microsoft.com>
2020-01-21 22:38:23 +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
Jack Lynch 9542a8be14 Fix accessibility issues in the Changes editor
This change makes the Changes drawer editor more accessible by adding a
gutter column with +/- symbols on added or deleted rows, respectively.
This information was previously conveyed only through color, a WCAG
violation.

In order to communicate whether a line is an addition or deletion to
screen reader users, I created a new code mirror input style that
prepends 'Addition:' or 'Deletion:' to the text that screen readers read
out for each diff line. This solution was settled on after discussing it
with other devs working on accessibility in order to avoid implementing
something more complex like VS Code's screen reader diff experience [1].

Screenshot: https://gyazo.com/8fe95b563a9e74d0d8b1a88900876c2a

[1] https://github.com/Microsoft/vscode/issues/17263#issuecomment-305701496

Bug: 963183
Change-Id: Ieeab30b8058fb36ef3a0d9ef4beac52419f6dc33
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1891836
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
2019-12-31 21:42:27 +00:00
Tim van der Lippe 5958eb836f Migrate cm_modes/ to ESM
This also makes cm_modes/ non-remote and uses proper dynamic imports to
load the code (rather than an `eval`). This increases the binary size by
104 KB from 11756K to 11860K which is an increase of 0.8%.

The stylus cm_mode has been removed. This mode was the largest mode
(30KB), seems unmaintained [1] and this syntax is likely rarely used (if
at all). It is unclear how often the other modes are installed and used.

Additionally, I discovered a promise race in the plugin installation. In
the full application this is not noticeable, as by default all code
mirror modes are lazily loaded (verified they still work with Markdown,
Java file and the regular js/cc files). However, in the test it was not
properly awaiting the plugin loading.

Perform the async-await plumbing to make sure the promise is resolved
before the test continues execution.

roll CodeMirror

[1]: https://github.com/codemirror/CodeMirror/commits/master/mode/stylus

Bug:1006759,1011466
Change-Id: If4d81d01318e08a63faaffee8b0cc9ab5954d4c6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1928924
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-27 14:58:02 +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 e3595942b0 Migrate platform/ to ESM
- Change Multimap to Platform.Multimap
- Importscripts in workers. This means that the file does not export any
utilities, but we will need to clean that up later.

Bug: 1006759
Change-Id: I91d45febebfc597f0d0b5c6a017c26f6b12b84b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832218
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#702111}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d704d799ac695e03ef367102c2a870e4a5f239e9
2019-10-02 18:15:32 +00:00
Tim van der Lippe 99e59b8c29 Migrate Runtime.js to ESM
Introduce a new namespace "Root" to be able to disambiguate between
Runtime the namespace and Runtime the object.

roll CodeMirror
The above line is necessary to fix the presubmit, which complains
about CodeMirror changes. This is only updating a type reference.

Bug: 1006759
Change-Id: I04941d9f18649701060e3035f7eeb2ef3abb51e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829708
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#701257}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 17cc008cf6ad28c6e8c07c638a1b380ca30e7f79
2019-09-30 20:00:59 +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
Jan Scheffler d3ae7f38bf [devtools] Enables emacsy shortcuts for editor
This patch adds the emacsy shortcuts to the editor again.

Bug: chromium:983874
Change-Id: I8423fad0b0fde6ac83487189092edc8f9c66c095
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1806737
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#697510}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0cba9023f762656df94d07f8afc1bc94bf3840f2
2019-09-18 08:18:10 +00:00
Paul Lewis dee141a632 DevTools: Have CodeMirror observe default indentation value.
CodeMirror currently gets handed a default indent size of 4 spaces, and the
indentation setting is ignored. This patch updates the CodeMirror config to use
the value in the settings, and observes changes to its value.

Bug: 977394
Change-Id: I1ddaeaa788378e37a88da1d7f42659bbe386dd57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1674092
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#696792}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d3be8efb8e3700d72b6a75e1078b54e2b17e8c15
2019-09-16 14:46:04 +00:00
Kalon Hinds 6b24092a44 DevTools: Make CodeMirror file line context accessible
This patch adds current line number and file line number range to the
GoToLine dialog in the Sources tool. This allows vision impaired people
to know their location in a file via ctrl+g. The UI affordance is
similar to the experience in VSCode.

Before: https://i.imgur.com/D3thzu4.png
After: https://i.imgur.com/SHttcdD.gif

Bug: 963183
Change-Id: I72fbc64b7e916438dfb1f3db883cc34f2a7e00b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1660789
Commit-Queue: Kalon Hinds <kahinds@microsoft.com>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#683048}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d767fe74d910eced9b198b02befed483ca8e1ccd
2019-08-01 02:44:31 +00:00
John Emau d3bef01745 DevTools: Improve console live expressions accessible name
Added option to configure code mirrors accessible name then set console
live expressions accessible name to "Live expression editor".
Before it read "Code editor" which is the same as the primary console input.

Screenshot: https://i.imgur.com/GZDwP3F.png
Bug: 963183
Change-Id: Ie3fd3206953c54df31d6abeaeca7e5f7ad0dabee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1628224
Reviewed-by: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: John Emau <johnemau@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#666359}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5635f819724970444c02fef12e0656a9872c7c0d
2019-06-05 18:08:40 +00:00
Erik Luo 2288e9c2b8 DevTools: visually indicate when prompt text is incomplete
- Prompt's '>' icon is dimmed when pressing 'Enter' would
  not evaluate (instead insert newline)
- Icon moves from ConsoleView to ConsolePrompt
- Drive-by: removes obsolete styles related to pins

Screenshot: https://imgur.com/a/GNrOadJ

Bug: none
Change-Id: Ia22c905154b78495138a0eaf954a2bc88de9a9c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1548578
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#650508}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9aeaec54a33cc368987b9b0a3004c3ad46f3edb1
2019-04-12 23:18:42 +00:00
Junyi Xiao 89142cffe3 DevTools: add a shortcut to toggle tab indentation for CodeMirror editor
Accessibility testing revealed that there are tab traps in all of the text editors including read only ones. Once keyboard users tab into the editor, they cannot tab out the editor.

This change adds a shortcut to disable/re-enable tab for indentation, which allows keyboard users continue to use tab to navigate to next UI component.

Settings Shortcuts page screenshot: https://imgur.com/a/qeOjGoB

Change-Id: I026a5a9c47407634a78c2ccf1a0bc532baa39e07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1545200
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Junyi Xiao <juxiao@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#649901}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 27ff38b767bc1659a596830b864acf60850e6bd0
2019-04-11 16:01:38 +00:00
Pavel Feldman 33b4091e40 DevTools: migrate to the light selection color to achieve 4.5+ contrast ratio.
Bug: 850500
Change-Id: Iccf9ca5fe088aa09d46dc4dd3344be79f28013a8
Reviewed-on: https://chromium-review.googlesource.com/c/1388027
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#618701}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6b6debfc317059bbe69de528507b9b397333a612
2018-12-22 01:08:02 +00:00
Joel Einbinder c9861428f5 DevTools: Use geometry instead of CSS for code folding hover
The previous CL's CSS hack incorrectly cut off breakpoints, caused the
gutter to be transparent when scrolling code horizontally, and made
closed folding triangles invisible.

Bug: 328431
Change-Id: Iba9482efd4bfd13d750580746f5507dadd0c73b2
Reviewed-on: https://chromium-review.googlesource.com/c/1380557
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#617362}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 87b1e4b4c4908281cb602c44f4a757fd653ec4b4
2018-12-18 03:26:45 +00:00
Joel Einbinder bbaf38311d DevTools: Code Folding
This adds the ability to collapse sections of code in the Sources and
Network panels.

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

Bug: 328431

Change-Id: I88e44d86c7fd2e6dbf076cc734aa538836516cf0
Reviewed-on: https://chromium-review.googlesource.com/c/1014386
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#616885}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9e5bce11314b18020acc24e078f2ccc723be3867
2018-12-15 00:05:35 +00:00
Erik Luo 0941a4462e DevTools: update breakpoint editor UI
Initial, basic UI for switching between breakpoint types.

Bug: 700519
Change-Id: Ic2c6fe2e0608ca481f0f32861d6c12ec8fbd619e
Reviewed-on: https://chromium-review.googlesource.com/c/1344919
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#614954}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3a2d091d43212bce947b34c824813dc6fbeadb48
2018-12-08 05:55:22 +00:00
Erik Luo 9855f610a0 DevTools: do not handle input key shortcuts when editing
Typing 'h' in text inputs with 'maxLength' may produce key events
without producing the 'input' event. This scenario leads DevTools to
allow shortcut-defined actions that are normally suppressed.

This CL replaces suppression logic with a simpler condition:
"if a key might trigger input, and we are editing, do not run action"

Bug: 833340
Change-Id: I75c5c0dd49c9f5b1624122345459438fc1d976f3
Reviewed-on: https://chromium-review.googlesource.com/c/1265837
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#600859}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a51492da19a2a90fc44f5b0df3151e2f5c6c8346
2018-10-18 19:11:30 +00:00
Erik Luo b625683d2c DevTools: allow ShiftTab to focus away from CodeMirror
CodeMirror text editors try to reduce indentation on 'Shift+Tab'.
However, this consumes the key event, preventing focus from leaving,
even if nothing changed.

This CL allows focus to leave when we are sure that no indentation
should change. Shift+Tab can now move focus from Console prompt to
toolbar and from SourceFrame's editor to the Sources TabbedPane.

Bug: none
Change-Id: I3660a48fe1c30a0972e2908514ee44fba7a51132
Reviewed-on: https://chromium-review.googlesource.com/1142519
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#577406}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8a6319931dea70b9adef40972160583fe1547446
2018-07-24 02:16:04 +00:00
Joel Einbinder 83fc76e621 DevTools: Follow Lighthouse's a11y suggestions
Running Lighthouse on DevTools lead to these changes:
 * Label our <select> toolbar items
 * Don't use tabIndex=1 for our canvas elements
 * Don't use li items in the network panel
 * add lang=en to our html tags

Change-Id: I9fef3d731dbbcbb56c3f73d81fd5669d65fa9827
Reviewed-on: https://chromium-review.googlesource.com/1093399
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#566195}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 237b755cd007b58b585ad34137353e11e2bc3ccd
2018-06-11 23:19:47 +00:00
Joel Einbinder f5ea74e541 DevTools: Make CodeMirror accessible
This overrides the default CodeMirror input logic to put more text in
the textarea.

CodeMirror uses an offscreen <textarea> to detect input. Due to
inconsistencies in the many browsers it supports, it simplifies things
by regularly checking if something is in the <textarea>, adding those
characters to the document, and then clearing the <textarea>. This
breaks assistive technology that wants to read from CodeMirror,
because the <textarea> that they interact with is constantly empty.

Because we target up-to-date Chrome, we can guarantee consistent
input events. This lets us leave the current line from the editor in
our <textarea>. CodeMirror still expects a mostly empty <textarea>, so
we pass CodeMirror a fake <textarea> that only contains the user's input.

Change-Id: I025a1937bfd66fa574fd692da079a5888d9cb529
Reviewed-on: https://chromium-review.googlesource.com/1020193
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#564347}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d06dd5982b810b4c3576388ef3a31f060685dff7
2018-06-05 02:14:19 +00:00
Joel Einbinder d7595c7afb DevTools: Auto pretty print in sources panel experiment
Change-Id: Ib16be938e7df8c90f02da1211f350d172c34ebff
Reviewed-on: https://chromium-review.googlesource.com/1047949
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#558766}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6cc4917ff46b654205b4aa1700c049c14d2ebabd
2018-05-15 17:41:54 +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 5d6cc6eeaa DevTools: SourceFrame pretty print improvements
I extracted out some improvements to inplace pretty print in
SourceFrame from my sources auto pretty print patch.

* Line numbers become blue when pretty print is active
* Selection is properly scrolled into view when pretty print is toggled

Change-Id: Ib1cf8f0a15b8495594ecf121cef8786d8cfd0f16
Reviewed-on: https://chromium-review.googlesource.com/1044878
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#556318}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d893a023c6a2ad473795fc680170c2a018eedab3
2018-05-05 06:29:47 +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