Commit Graph
36 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
Jack Franklin 75aeca4eb9 [DarkMode] migrate CSSOverviewCompletedView
This CL migrates the CSSOverviewCompletedView.css file to remove any
colour patching.

I've left some colours alone:

1. The icon colours (red/green) because these work fine across both
   light and dark mode.
2. The slight box shadow on the bars because again these work fine. I
   suspect longer term we might want to define some default shadows for
   each theme.

Bug: 1152736
Change-Id: I3959e5e01007541da91b7f91906d74df4008d972
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560251
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-11-30 11:03:03 +00:00
Alex Rudenko 69c377e2ad Add APCA to CSS Overview
Screenshot: https://i.imgur.com/U78yQTJ.png

Bug: 1121900
Change-Id: Id55b8d2a27a44e72db056139df8df71695d08f91
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2562701
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-11-30 09:28:08 +00:00
Alex Rudenko af4d990235 Fix issues in CSS Overview
This CL fixes the issues outlined in the ticket:

- Resets the state when the CSS overview is closed to
prevent the elements from going missing and to synchronise the
scroll state with the selected tab.
- Sets the min-width on the contrast column elements to prevent cramping.

Fixed: 1152692
Change-Id: I66f4ad1b04bb6c64251a8c73ea645fbc125446f0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560235
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-11-25 09:51:38 +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
Jack Franklin 71519f8efb Introduce enableLegacyPatching flag for CSS patching
As part of the dark mode migration we are adding
`enableLegacyPatching:true` to all call sites of `appendStyle` (and
related methods). If a user passes `false` for that flag, no CSS colour
patching will occur.

This CL is therefore a no-op from a user's perspective as we pass `true`
on every call to maintain existing behaviour, but once we start
migrating we will turn the option to `false`. Long term, once all code
is migrated and the old patching is removed, we will remove this flag
entirely once again.

Bug: 1122511
Change-Id: I76b818e83b7d5ee0175e1548759373f53481e0ab
No-Presubmit: True
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2516345
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-03 14:11:46 +00:00
Sigurd Schneider 2ee231d21b Refactor setColumnsVisiblity to use a set of string
Bug: chromium:1011811
Change-Id: I327f03400af59eae14147e2b05b7c9e8c7fe95f1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2510400
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-11-02 12:34:20 +00:00
Sigurd Schneider 5a5b735963 Improve template types in Target/SDKModel
The Target.model method's type can be improved to convey the type of
the result (based on the constructor argument). This CL does just that.
This unlocks more checking down the line. The CL also alters the types
of the observeModel(s) methods, but in a weaker way, as closure is
apparently not able to instantiate the template correctly for method
invocations.

Bug: chromium:1011811
Change-Id: Ic466cfd946c30f3fcfb4ce24a8a0e1bc542e7d3f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2445776
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-05 12:21:48 +00:00
Alex Rudenko b7419b7be1 Add a button to scroll an element into view in CSS Overview
Screenshot: https://i.imgur.com/yj5ZTfE.png

Bug: 1120316
Change-Id: I0f04aa988d9d3c7edc5b2e7311574547e88e02fe
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2436732
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-09-29 12:47:08 +00:00
Alex Rudenko d3ba0ee3a4 Show contrast ratio and preview for each element in CSS Overview
Screenshot: https://i.imgur.com/QaAihyk.png

Bug: 1120316
Change-Id: Ia20d7cec004fff23213a3b8931f86d7e413e4dfd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2428335
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-09-25 14:52:38 +00:00
Sigurd Schneider 2533de14e2 Show initiator URL in developer resources view
Drive-by: Enable TS checking for front_end/developer_resources
Drive-by: Properly export IOModel

Bug: chromium:1069378, chromium:1011811
Change-Id: I50b7ae66067d426c8dda0d8829c35b6f6aa9696e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2428331
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-09-24 14:08:06 +00:00
Alex Rudenko d55e18c512 Add Contrast Issues section to CSS Overview
This CL adds a new section for contrast issues to CSS Overview.
A follow-up CL will add the contrast information for particular
elements in the grid view.

Screenshot: https://i.imgur.com/8tLlJWF.png

Bug: 1120316
Change-Id: I12dcd269454a43567619c811e4107c00dc8ee654
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2421696
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-09-24 07:24:05 +00:00
Andres Olivares 3dcefe4832 [ts] Typecheck css_overview/CSSOverviewCompletedView.js with TypeScript
Bug: chromium:1011811
Change-Id: I15140b5ada12ca6085fdf0a725c8d131dbce4498
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2406193
Commit-Queue: Andres Olivares <andoli@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-14 17:16:48 +00:00
Jan Scheffler e348fe9424 Migrate front_end/css_overview to devtools_entrypoint
R=aerotwist@chromium.org, jacktfranklin@chromium.org

Bug: 1101738
Change-Id: I406acc5e456237fda0d5c6b468f66d6c0b66fbc8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2323621
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-28 19:16:12 +00:00
Sigurd Schneider 11657914d7 [cleanup] Make it clear that DataGrid.createCell creates an HTMLElement
Change-Id: I95a8f0f352220dfcc348fa497e9200b2453d3057
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2270542
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-30 14:46:08 +00:00
Alex Rudenko 91403e7b5c Reuse contrastRatio and rgbaToHsla
This CL extracts contrastRation and rgbaToHsla helpers to ColorUtils
and makes use of the extracted helpers in DevTools and inspector
overlay.

Fixed: 1078267
Change-Id: I467f1a7d7bfae0051cec17a732f62f1cacb5fa66
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2230498
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2020-06-04 07:46:11 +00:00
Mathias Bynens 88e8f15748 Enable no-case-declarations lint rule
Lexical declarations in `case` and `default` clauses are a footgun,
since they are visible in the entire switch block, but they only
get initialized upon assignment, which only happens if the relevant
`case` is actually reached.

To ensure that such lexical declarations only apply to the current
`case` (which is usually the intention), `case` clauses containing
them should be wrapped in curly braces to create an explicit block.

More information:
https://eslint.org/docs/rules/no-case-declarations

Change-Id: I63d9341fcd76d4b9ce8281bd0e6573b886577f08
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2119685
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-03-25 15:26:13 +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
Tim van der Lippe 7946bbcb95 Migrate css_overview/ to import cross-module
Bug: 1006759
Change-Id: I2130d4ba17bb592090c202cfe2b97da2558e72ea
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2054544
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-13 17:06:10 +00:00
Tim van der Lippe 9d0cb5f9ee Migrate css_overview/ to ESM internally
Bug: 1006759
Change-Id: I9119e12293f3765cae9432201d7e94f11352e552
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1993340
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-09 14:58:01 +00:00
Michael Liao 18769f2106 [Common - Data Grids]: bundling data grid parameters + Adding required name field for all data grids
Issue:
- Data grids in DevTools do not have an aria-label
- There are a ton of DataGrid parameters and adding one is messy

Changes:
- Naming all data grids
- Created DataGrid.Datagrid.Parameters type to hold data grid parameters (including a required gridName field)

Bug: 963183
Change-Id: I83b130d468fb80034be264b45b86b799f650e978
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1891652
Commit-Queue: Michael Liao <michael.liao@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2019-12-12 19:12:26 +00:00
Paul Lewis 4da3b30c38 Migrates css_overview/ to esm
Bug: 1006759
Change-Id: Idf78688fa354b7e169edd508667dd2e298eacea4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1928914
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2019-11-21 14:37:54 +00:00
Paul Lewis c11e7a988a [CSS Overview] Updates strings
TBR=tvanderlippe@chromium.org
Change-Id: I0a338816b94787bfecd8565e65bde82e3942f3e3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1903470
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-07 14:44:45 +00:00
Paul Lewis 66a15fc97e [CSS Overview] Tweaks font info styles
This adds striping to help differentiate between different blocks of
font information, and changes the font weights a little so that they
are slightly differentiated.

Change-Id: Ib3d6033719bbcf476b8067637e1e4ca12d8a7311
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1903468
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2019-11-07 11:44:45 +00:00
Paul Lewis 7d10a733de [CSS Overview] Adds font info
Change-Id: Ia7ed1eccd6a3440e3dbf5b1e98b887ffdaf2b574
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1901387
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2019-11-07 11:04:05 +00:00
Paul Lewis ed808ce4cf [CSS Overview] Updates UI
Change-Id: Ifdc7645399b9a5b8dd5d13c8d4dacaf8a67fc5bd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1899518
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2019-11-06 14:44:25 +00:00
Paul Lewis aae7b10cff [CSS Overview] Adds support for vertical-align
Change-Id: I1c8b16be97b057b705d2d31a7ed5da25ca815a46
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1890672
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2019-10-30 16:28:56 +00:00
Paul Lewis b63ee70a8e [CSS Overview] Renames fragment
This CL renames an incorrectly-named fragment, which prevented
the sidebar nav from working.

TBR=tvanderlippe@chromium.org
Change-Id: I8683685be3602efa07762ecaa2e1e23139f27c54
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1886824
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-10-29 15:50:37 +00:00
Paul Lewis a3dcbf3e3a [CSS Overview] Tidies styles; adds localized string
TBR=tvanderlippe@chromium.org
Change-Id: I8b7f3ecde8f05f728245fbb32421a977b48a33a6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1886822
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2019-10-29 15:24:02 +00:00
Paul Lewis 8aef901f3f [CSSOverview] Add unused rules
This is the first pass at adding unused rules to the CSS Overview.
The CL adds support for checking width & height to inline elements
as well as position values to static elements. Further CLs will
add additional checks for other cases, e.g. the use of flex or grid
values against non-flex and non-grid elements respectively.

Change-Id: I2fb4fd557d67065a5753587624195920c22b3edc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1886818
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2019-10-29 14:36:57 +00:00
Paul Lewis 12bc63edcd [CSS Overview] Adds support for fill and border colors.
Change-Id: Iea5c20d1a7b6c3ae6673053e05ff52faee48e69f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1875709
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2019-10-23 12:00:20 +00:00
Paul Lewis de0224ccdd [CSS Overview] Uses snapshot; adds element highlight
Change-Id: If58dd20c6f4b3c8f730b39c48c14826e402018a0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1873759
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2019-10-23 09:55:00 +00:00
Paul Lewis 8db3fa83ed [DevTools] Sorts colors descending by luminance
Change-Id: Ibe628e70b3d53db9ca132378c2da2ac42cd7746c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1847337
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#704570}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a755f70431371a3f37046067253f33758d4b4ed5
2019-10-10 11:55:53 +00:00
Paul Lewis ebc4719819 [DevTools] Adds media queries to CSS Overview
Bug: 1007284
Change-Id: I8c24adddf91da3bd621b61db6eac49233b8a1db4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849671
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#704192}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 193ed603a6eaec431f9d0f339f697ab03f99c838
2019-10-09 15:06:41 +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
Paul Lewis 8cddf9931f [DevTools] Adds CSS Overview Panel
Creates a panel that steps through the page to build statistics on CSS
used, such as colors, fonts, specificity, and other items of note.

Note: this is a DevTools experiment.

Bug: 1007284
Change-Id: Ib8d8b2af6bb65d6ff4816ca23b48b76980cd80db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1806736
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#700745}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0e4a3c81f343d15e2121280d332659778ad07323
2019-09-27 16:40:07 +00:00