Commit Graph
27 Commits
Author SHA1 Message Date
Jack Franklin 49a9481a74 Lint color usage in background and border-* properties.
The list of CSS properties we check for colors wasn't thorough and
didn't include `border-left/right/top/bottom` or `background` on its
own. This CL fixes that and disables the rule for any current
violations.

Bug: 1152736
Change-Id: Ic732d653fdfab0462a04dc891bcece1f44e5d471
No-Presubmit: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2676157
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2021-02-05 15:39:39 +00:00
Jack Franklin 8064d3ba7a Lint against non-theme-color variables
This CL turns on the use_theme_colors stylelint rule which enforces that
any colors use variables defined in our codebase.

There are many, many violations, unsurprisingly (about 1500), so for now
I have disabled every single violation. The goal of the dark mode
migration will be in part to remove all violations of this rule.

Additionally, new code going forwards should adhere to the rule and not
add the comment to disable the warning.

Bug: 1152736
Change-Id: I51372724ea51485daef3d4f75b7d3f60a7c8016f
No-Presubmit: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2671323
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-02-03 11:02:09 +00:00
Jack Franklin 0d88cbb6fd Ban named-colors in our CSS
Used
https://css-tricks.com/snippets/css/named-colors-and-hex-equivalents/ as
the reference and did a bunch of find and replaces. Should be no visible
changes; have checked by running DevTools locally and looking for
anything that looks off.

Note that system colors (e.g. HighlightText) are still permitted.

Fixed: chromium:1171775
Bug: chromium:1104187
Change-Id: I99c281886822deb5a5292ac8691a4f2f9e026428
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2656243
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2021-02-01 09:33:45 +00:00
Jack Franklin fd9dfaa5e7 [Dark mode] replace #fff background-color
This CL searches for CSS that matches:

- background: #fff
- background: #ffffff
- background: #white
- background-color: #fff
- background-color: #ffffff
- background-color: #white

And replaces the declaration with var(--color-background) from the new
set of color variables.

Bug: 1152736
Change-Id: Ia0575ccfa4e23c92fd4f83e6c911236dbb893fea
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2577559
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-01-11 16:18:06 +00:00
Peter Marshall 9a3d85fa0b css: Use :focus-visible instead of our custom data-keyboard-focus
https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible

:focus-visible is basically the exact same functionality as the custom
data-keyboard-focus attribute that devtools maintains. This CL converts
all of our uses of data-keyboard-focus in CSS to use :focus-visible.

This has no intended behaviour change although it's possible there are
small differences in our implementation vs. the web platform one, so
this might cause some regression with focus styles for keyboard
interaction.

I tested a few of these manually to verify they still do the same thing.

The CSS linter was unhappy about the ordering of some rules due to
specificity-ordering checks, so there is some re-ordering too.

A follow-up CL will remove our implementation of data-keyboard-focus.

Change-Id: Ifc273f7d82e16ea07e24ed2d1faa6f794a12501d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2352236
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Kalon Hinds <kahinds@microsoft.com>
Reviewed-by: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
2020-08-24 07:58:42 +00:00
Simon Zünd 7acac32cb4 Fix stylelint-config-standard issues in console/consoleView.css
consoleView.css only needed some selectors reordered.

R=mathias@chromium.org

Bug: chromium:1083142
Change-Id: I6aa5edf4b48c3b095f760d988add397253aee9e3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2259838
Commit-Queue: Simon Zünd <szuend@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Auto-Submit: Simon Zünd <szuend@chromium.org>
2020-06-23 08:55:16 +00:00
Mathias Bynens ca9fa2d73f Consistently format CSS color and opacity values
- Prefer the modern comma-free CSS color function syntax over the
  legacy syntax. [1]
- Explicitly use the `deg` suffix for angle values in colors, to
  clarify the range.
- Explicitly use the `%` suffix for percentages instead of formatting
  the value as a number, again to clarify the range.

[1]: https://twitter.com/mathias/status/1253242715304857601
[2]: https://goo.gle/devtools-css-color

Bug: chromium:1083142
Fixed: chromium:1073885
Change-Id: I8e1582a2dee3553a61df88564051ea84c2011d76
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2209091
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Mathias Bynens <mathias@chromium.org>
2020-05-19 16:50:26 +00:00
Mathias Bynens b0c1f4bce2 Fix stylelint-config-standard violations
Bug: chromium:1083142
Change-Id: I5ea4cc5d0f83e52856383ba37a47472e33eb19a2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204113
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-05-15 17:05:27 +00:00
Kham Udom a0f0b26dc5 High contrast fix on Console view pane
The foreground color will change to HighlightText when focused and
selected. The anchors are also visible and will change when focused.

Before: https://imgur.com/a/j8KJ5jK
After: https://imgur.com/a/6J4fplz

Bug: 1048378
Change-Id: Iebdb29d917fde274ea0876327a55815eba6ac022
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2068904
Commit-Queue: Kham Udom <khamu@microsoft.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-02-25 01:16:23 +00:00
Kham Udom 6a142bd33f High contrast fix in Console tools panel
Fixed the hover and keyboard focus state on console Sidebar
to make sure the background is highlight color and the icons
and text are highlight text color.
Console view gets an update to fix keyboard focus. Icons, texts
and links are highlight text color when focused.
Update the drop down button and drop down menu by adding a
border and and also fix the hover state on the drop down menu items.

Before: https://imgur.com/a/SVNuGLx
After: https://imgur.com/a/0l5Edhi https://imgur.com/a/OpxsFOs

Bug: 1048378
Change-Id: Ia6d51e1a2c39dc7e5031d437c832d7dcd94e4fea
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2023169
Commit-Queue: Kham Udom <khamu@microsoft.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-02-05 16:02:08 +00:00
Mathias Bynens 9680e2e8b0 Drop -webkit-user-select in favor of user-select
Bug: chromium:1031475
Change-Id: Ibbf222135c97e79ae3be816216fec9675d643952
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1953613
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
2019-12-06 10:31:53 +00:00
James Lissiak 042827fcdd DevTools: Fix Console Live Expression CSS
This patch updates the css for the console pin pane so that it never
exceeds 50% of the outer window.

Issue 884137 shows that when the console window height is small, the
live expression pane can overflow the console input pane making it
impossible to type into the console. This is due to the pin pane css
setting a max-height of 200px regardless of the height of the outer
window.

The fix is to update the css so that pane has a max height of 50% but
the inner container uses 200px so that it will have a height of the
smaller of the two. Allowing users to always see the input area.

See: https://imgur.com/a/GS8yA8h


Bug: 884137
Change-Id: I85337f7391a882ca107a30be2bf5c2a12f261787
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1837527
Reviewed-by: John Emau <John.Emau@microsoft.com>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: James Lissiak <jalissia@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#703449}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7df70dbd0f8d39c40d3347f592666bb3e3ab98d2
2019-10-07 20:46:20 +00:00
Erik Luo 840be6b88d DevTools: fix stick-to-bottom for Console with keyboard navigation
Keyboard navigation in Console presents new interactions that our
stick-to-bottom (STB) logic should care about.

Prompt
- Before, STB only cared about TextChanged events, but now cares
  about focusin, since users can Tab from messages to prompt

Objects
- Expanding an object results in noticeable scroll-anchoring jumps,
  STB should turn off due to expanding. Expanding a small object
  that can fit in viewport should guarantee it is visible.

Bug: 865674
Change-Id: I47872110d4bf2261b4940b565f8c926333b66836
Reviewed-on: https://chromium-review.googlesource.com/c/1330350
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#613239}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: cc2fb34c6c8a513781dc7d78e827f340605681e9
2018-12-03 20:54:27 +00:00
Erik Luo 85c1d22222 DevTools: fix Console stick-to-bottom on load, enter
Fixes 2 stick to bottom cases
- Prompt has text, but is scrolled out of view. User presses 'Enter'.
  Browsers usually scroll an field into view on input events, but
  Console preventsDefault to avoid adding a newline. Now, we will
  emulate the scroll.
- Page logs a ton of messages, Console opened for the first time.
  CodeMirror asynchronously resized prompt height on load, which
  broke stick to bottom. This CL changes layout so that prompt
  height does not grow on editor load.

Bug: 863664
Change-Id: Ia25a71100d9a895d4c8c710b36ba1d8b76d76990
Reviewed-on: https://chromium-review.googlesource.com/c/1321575
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#605936}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 60802eced856d89133f211ef29df6124f29401bd
2018-11-07 02:43:25 +00:00
Joel Einbinder 3d04d2fb80 DevTools: Fix 1px gap on the console group nesting level marker
The border was missing a pixel, and so didn't look like a solid line.

https://imgur.com/a/jjEPH9g

Change-Id: I647953188d2029670851201cb7b2d43e09cf37d1
Reviewed-on: https://chromium-review.googlesource.com/1244113
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#594091}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9c42caf6fcee6bc19f1202f0b5c19c43eb140f69
2018-09-25 20:53:21 +00:00
Erik Luo b5bfff4b5d DevTools: do not focus prompt on Console message click
With keyboard navigation experiment enabled,

- Switch viewport's focus proxy from `element` > `_contentElement`
- Clicking a message will select it
- Click-selection applies "blue" highlight, except when a user
  expands objects, groups, or traces
- Move focus from log > prompt when user types on 'keydown'
- Better distinguish events below prompt (geometry works with
  MouseEvents, but not FocusEvents)
- Stick to bottom when prompt gains focus

Bug: 865674
Change-Id: I473bcdf714408406b0ce7a49772589daf3cbe9cb
Reviewed-on: https://chromium-review.googlesource.com/1171814
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#592669}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 1d9c78149597bc68797982d9ac6294f9595fcd9f
2018-09-20 02:52:39 +00:00
Erik Luo 39452ffb18 DevTools: allow Console message keyboard navigation
This makes Consoles messages focusable and navigable using:
ArrowUp/Down/Left/Right, Home, End

Screenshot: https://imgur.com/a/6JWY0iU

Bug: 865674
Change-Id: I4166bf4d8d57856c6d1f7d51ef29e2dea0c088eb
Reviewed-on: https://chromium-review.googlesource.com/1144453
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#588237}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8fce8ab13eba5c18c14e308a9821d0675e0a4a1e
2018-09-01 01:08:07 +00:00
Erik Luo 58ffb33d9f DevTools: fix console dark theme regression
Recently, Console message border colors became CSS variables, which
are preserved in dark theme by default. This CL fixes the regression
by giving explicit dark colors.

Screenshot: https://imgur.com/a/7Hj2GXb

Bug: none
Change-Id: Ib62c8ffa0454303e35699f1d1c70e398a185d52a
Reviewed-on: https://chromium-review.googlesource.com/1159208
Commit-Queue: Erik Luo <luoe@chromium.org>
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#579979}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 09236caff0505fbe95f28d6b07ca391002c360bd
2018-08-01 23:02:46 +00:00
Erik Luo 4b002328ab DevTools: [console-stability] more precise viewport
Simplify visible index calculation and tests by
- Remove padding on viewport container
- Remove negative margin (was on error/warning logs)

Improve visible index / scrollItemIntoView() precision by
- Rebuild cumulative heights even if each message is slightly off
- No need to scroll last item into view if it is fully visible
- Perform extra scroll on scroll into view in case items above
  were larger than expected
- Message height measurements now include wrapper's border

Bug: 865674
Change-Id: Id4abad0e40a971dff9accbc7b904427ea02f728c
Reviewed-on: https://chromium-review.googlesource.com/1144254
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#579175}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8ee170a089cd03e7f0b7ab6982174d15d0180f8a
2018-07-30 21:23:31 +00:00
Erik Luo fa544813dc DevTools: split out consolePrompt.css, fix matching bracket style
- Splits out prompt styles into consolePrompt.css
- Do not show background/border on matching brackets if the
  CodeMirror container is not focused

Bug: none
Change-Id: I1955e07ca3289a6781097d0c99467c51336403b9
Reviewed-on: https://chromium-review.googlesource.com/1153468
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#579136}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 60fc08c17da4f858739220886c4899ef846cc4bc
2018-07-30 20:03:54 +00:00
Erik Luo 625f4ac8c8 DevTools: fix console/timeline toolbar overlap
UI.Toolbars give 'flex: none' to their shadow :host. In [1], an extra
element was placed in between the Toolbar and the flex container,
breaking the 'flex: none'.

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

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

Bug: 860476
Change-Id: If12df76e2bf711c93acee8df5d7f0bbb0a5a868d
Reviewed-on: https://chromium-review.googlesource.com/1139049
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#575536}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 4030d08e852df100f4f2d84e96401a797cf28150
2018-07-17 03:18:31 +00:00
Erik Luo 6294d3b496 DevTools: pinned expressions in console
Part 1: introduce pins behind an experiment.
- Prompt has 'pin' button to add current expression to pins
- Pin pane sticks to the top of the Console, with max height
- Pins have multiline editors and a value preview that shows
  "not available" when there is an error

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

Bug: 849875
Change-Id: Ib0b8bafd97551f823ff8b64d13c5259f42328994
Reviewed-on: https://chromium-review.googlesource.com/1087509
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#574740}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 589cdcb33ef96770a2c3e4a9c76ee439d1e2e56e
2018-07-12 21:54:16 +00:00
Erik Luo 5fb33bda7b DevTools: use expandable fragment for long Object property values
Screenshot: https://imgur.com/a/FUh1E91

Bug: 754216
Change-Id: Id7f04637f85ad776e4c61b0cedf500351723342d
Reviewed-on: https://chromium-review.googlesource.com/1081677
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#564286}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d96b9f46eafdd0145393b5fe3e188e9bedb2da72
2018-06-04 23:23:52 +00:00
Erik Luo 6355f4d04a DevTools: make settings toolbar button always visible
- Settings gear icon in Console and Performance are always visible
- Console's 'N hidden' text is also always visible

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

Bug: none
Change-Id: I60d08361ab8ee52f4dd86020039e3e7d105667f4
Reviewed-on: https://chromium-review.googlesource.com/1080036
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#563520}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0a643b4cd5ed6be2b661c08e100c6b8310c19e4b
2018-06-01 03:32:24 +00:00
Erik Luo 89efea3187 DevTools: add runtime experiment for prompt
Bug: 810176
Change-Id: Ic78c5e6ef5557067679f3f4ed2dcf6b76f1ee8e2
Reviewed-on: https://chromium-review.googlesource.com/1014348
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#553228}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: cc91acb0e25cada9b9506da8c405c06cb7526074
2018-04-24 19:19:58 +00:00
Erik Luo 0f7f85b790 DevTools: add space-below-prompt experiment
- Adds an empty 15px space directly below the Console
  prompt's editor.
- Updates "isScrolledToBottom" logic in Console to account
  for the new space. Without this update, typing on the
  prompt's last line will not "jump + stick to bottom"
  as expected.

With this CL, overlay scrollbars (e.g. on Mac), should
never cover the prompt's editor.

Bug: 725249
Change-Id: Ib0167f6919d5b9942e7f2dc4d8cf0c15fc9368df
Reviewed-on: https://chromium-review.googlesource.com/965020
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#551222}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 06e046ba940fb6dffe3bbed45b85fb840b4a9194
2018-04-17 03:06:58 +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