Commit Graph
72 Commits
Author SHA1 Message Date
Erik Luo cedf2be6db Revert "DevTools: prepare Computed sidebar for groups"
This reverts commit 2d8ad76070a840ce3821f3d28e55cd952f7640c0.

Reason for revert: Grouping would break alphabetical sort, which is controversial.

Original change's description:
> DevTools: prepare Computed sidebar for groups
> 
> Computed sidebar
> - Removes even/odd striping
> - Extracts a function to build a property's TreeElement
> 
> Bug: 929536
> Change-Id: I727cf1efa5ac65277a046b52575f35102323c38f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1548446
> Reviewed-by: Joey Arhar <jarhar@chromium.org>
> Commit-Queue: Erik Luo <luoe@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#648029}

TBR=luoe@chromium.org,jarhar@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 929536
Change-Id: Icec233a91c07b2b864830df6419690911070101a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1565380
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#650149}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 37893dee61d4f8d4a23c0d23bd36dbd4ef6d893c
2019-04-12 00:59:26 +00:00
James Lissiak 139ecb46a0 DevTools: Issue 948417 - Adding setting for detailed inspect tooltip
This patch adds a new setting to the Elements category which toggles
showing the styles information on the overlay tooltip when the user is
in inspect mode.

You can see the difference enabled by the new setting in the following
screenshot:
https://imgur.com/a/BjQPwe9

This fixes #948417

Bug: 948417
Change-Id: If15bc5d73fb1571079697bfccd9e5a74e975bd59
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1553465
Commit-Queue: James Lissiak <jalissia@microsoft.com>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#648345}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 47e5d9a0f8f988e4d11d27a21dbf4c0414795f25
2019-04-05 21:25:43 +00:00
Erik Luo 247064ee0f DevTools: prepare Computed sidebar for groups
Computed sidebar
- Removes even/odd striping
- Extracts a function to build a property's TreeElement

Bug: 929536
Change-Id: I727cf1efa5ac65277a046b52575f35102323c38f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1548446
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#648029}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2d8ad76070a840ce3821f3d28e55cd952f7640c0
2019-04-05 01:44:27 +00:00
Erik Luo 05a85be4de DevTools: avoid clamped sections when editing long style values
In SSP, a section's height is manually set for performance reasons
(see crbug.com/684341)

This CL measures section height after attaching the prompt, giving
a more accurate measurement.

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

Bug: 949383
Change-Id: I9a293a3052c2801dd791eab75317e4a94dd317c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1552441
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#647585}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 1e24fce975be74f493bc6745cc6ec5856b0b3975
2019-04-04 01:44:54 +00:00
James Lissiak d2f1a2ff9f DevTools: Adding new performance histograms for launch of top 4 tools
This change adds 4 new performance histograms for the DevTools using the
prefix 'DevTools.Launch':
- DevTools.Launch.Console
- DevTools.Launch.Elements
- DevTools.Launch.Network
- DevTools.Launch.Sources

These histograms measure the time between the DevTools window being
shown during 'DevToolsWindow::ToggleDevToolsWindow' and a point in each
tool that corresponds to the 'ready' state as seen by a user. These end
points are unique to each tool but are as follows:
- Console: At the end of the ConsolePrompt constructor
- Elements: At the end of _updateMetrics when the styles panel has
  been populated for the initially selected node
- Network: After the panel is shown
- Sources: After the NetworkNavigatorView has been loaded

These tools were chosen as they represent the most popular in terms of
usage and will allow us to identify any significant performance impact
in the time taken to launch the DevTools when these panels open by
default.

To see time captured by the histograms in terms of a perf trace for
each tool please take a look at the following screenshots:
https://imgur.com/a/rcAgQ8h

In the traces you can see that the end marker for each load is at the
end of the trace near first meaningful paint, and just as the user
will see the content of the tool render fully.

To accomplish the histograms, a new native function has been added to
the DevTools ui bindings/embedder classes called
'recordPerformanceHistogram'. Along with the plumbing and a new helper
function in the frontend javascript Host.UserMetrics file called
'panelLoaded'

When the frontend javascript loads, it will store the initial panel to
be loaded from the preferences. Once that panel has been created and
the appropriate loaded marker has been hit, the duration of the launch
will be calculated using performance.now(). That duration is then sent
to the native code which will fire the appropriate histogram via the
'UMA_HISTOGRAM_TIMES' macros.

The mechanism is similar to the existing one used for enumerated
histograms and can be expanded to fire additional performance histograms
in the future.

Also added a new test for user-metrics to ensure that the panelLoaded
function will correctly record the histograms.

Change-Id: Ib9f0bf80c651231d6d2e308bee36c1a1223f04db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1506388
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Commit-Queue: James Lissiak <jalissia@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#644407}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 296f6b12650bd5e38eaf1fe0987c46910fe2d6eb
2019-03-26 17:36:51 +00:00
Erik Luo f484eb2c6e Reland "DevTools: optimize Styles sidebar for reading property values"
This is a reland of df31273ec872f5f578b4fe92747c7f663c7154a2

Original change's description:
> DevTools: optimize Styles sidebar for reading property values
>
> SSP UI changes
> - Curly brace, Source link color less dark
> - Source links are more aggressively truncated
> - "Inherited from" separators have less noise
>
> Screenshot: https://imgur.com/a/SwpWkGs
>
> Bug: 929536
> Change-Id: I43b2252998f7d723b8ec88f0e908e751fe150c86
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1460448
> Commit-Queue: Erik Luo <luoe@chromium.org>
> Reviewed-by: Joel Einbinder <einbinder@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#642093}

TBR=einbinder@chromium.org

Bug: 929536
Change-Id: I1a67b4243cbe0409337faf7a53c620123cb23a5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1531692
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#642334}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: bc3f154a8e94c37a41f3c4ee858ec9d80ce60b79
2019-03-20 02:41:28 +00:00
Joel Einbinder 258bbc6a86 DevTools: Fix localizability errors in StylesSideBarPane.js
This patch fixes localizability errors found by via
https://chromium-review.googlesource.com/c/chromium/src/+/1524993.

Change-Id: Ie55f153e8621efcfb47d26bac40447cbf72566c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526662
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#642269}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 70260314296bcc2cb589109a9cf99c834c3c2faf
2019-03-19 23:52:15 +00:00
Carlos Knippschild 00e09a7e5d Revert "DevTools: optimize Styles sidebar for reading property values"
This reverts commit df31273ec872f5f578b4fe92747c7f663c7154a2.

Reason for revert: breaking tests in chromium.win/WebKit Win10

Original change's description:
> DevTools: optimize Styles sidebar for reading property values
> 
> SSP UI changes
> - Curly brace, Source link color less dark
> - Source links are more aggressively truncated
> - "Inherited from" separators have less noise
> 
> Screenshot: https://imgur.com/a/SwpWkGs
> 
> Bug: 929536
> Change-Id: I43b2252998f7d723b8ec88f0e908e751fe150c86
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1460448
> Commit-Queue: Erik Luo <luoe@chromium.org>
> Reviewed-by: Joel Einbinder <einbinder@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#642093}

TBR=einbinder@chromium.org,luoe@chromium.org

Change-Id: I31744312f8bd5ff2ad295cc2956cff816d114806
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 929536, 943802
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1530826
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Commit-Queue: Carlos Knippschild <carlosk@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#642221}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a67e3eb195bab80f0e0a711c5e76d2bf6b45a449
2019-03-19 22:32:03 +00:00
Erik Luo e0870a2653 DevTools: optimize Styles sidebar for reading property values
SSP UI changes
- Curly brace, Source link color less dark
- Source links are more aggressively truncated
- "Inherited from" separators have less noise

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

Bug: 929536
Change-Id: I43b2252998f7d723b8ec88f0e908e751fe150c86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1460448
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#642093}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: df31273ec872f5f578b4fe92747c7f663c7154a2
2019-03-19 18:34:43 +00:00
Erik Luo 34400cafe6 DevTools: easier text selection in SSP via drag
Selecting text is important to copy/paste styles from Elements panel.
This CL improves a common case that often results in poor selection.

In the future, 'user-select: contain' may address this.

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

Bug: 929536
Change-Id: I23f7b1a53ad501b491017887feaab63ead2c3705
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1412354
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#642088}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 65fbd9f55d3ecfa38d8c55d4e14746c15ca58c44
2019-03-19 18:31:16 +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 9ad1873637 DevTools: cleanup presentation of user agent styles
In the Styles sidebar pane, user agent style sections:
- Properties within an inherited section that do not contribute to
  the cascade (not inheritable) are hidden.
- Non-matching selector pieces are hidden.

The goal is to reduce visual noise in the UI without affecting style
debugging.

Screenshot: https://imgur.com/a/2s5wIn8

Bug: 929536
Change-Id: Icaea2edcbb8560273469605f263449edd51bade2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1500775
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#638731}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0904d89a819c13da89694b59ab5de08d184845c5
2019-03-07 20:59:27 +00:00
Pavel Feldman 201721f4dc DevTools: do not highlight padding/margin/border while editing it.
Only highlight on hover, clear the highlight once editing starts.

Bug: 935687
Change-Id: I25fe10be549a5c0c37d08aba62688c3472c66354
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1501212
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#637556}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c64725a18d299b917ae2297b4d5adeef0778bcd6
2019-03-05 02:36:14 +00:00
Erik Luo 5629096697 DevTools: selecting text after mousedown should prevent new property
Dragging the cursor in Elements results in a new blank property,
whenever there is no text selection. This is not ideal when users
select text, then unselect text within the same mousedown-up
phase.

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

Bug: 929536
Change-Id: Ic9800dbb5c37d93943154bc4af71dd88965c633a
Reviewed-on: https://chromium-review.googlesource.com/c/1413400
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#635874}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5b83e151c645d1d667cd97da4c14c7cfd82a54b3
2019-02-27 04:40:35 +00:00
Yuki Shiino 8d9f436d04 Bulk-update: Hyperlinks to HTML standard (multipage/... => C/)
This patch updates hyperlinks to HTML standard from
/multipage/chapter-title.html#topics to /C/#topics, which
redirects to /multipage/chapter-title.html#topics.

/C/#topics style is shorter and simpler.

This is a follow-up of https://crrev.com/c/1466543

Change-Id: I1490928bd406fcf50f8da739d0c9862c5cc980ae
Tbr: foolip@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/1469814
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#631633}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b4fa97af9d71e841309c2b2483f04c19c2c92199
2019-02-13 11:02:57 +00:00
Mathias Bynens 6b5621bb77 Improve copy JS path functionality
This patch simplifies DOMPath.js by using CSS.escape to produce
valid CSS identifiers, instead of a custom (and subtly broken)
implementation.

Similarly, instead of custom logic, JSON.stringify is now used to
produce valid JavaScript string literals.

Bug: chromium:930625
Change-Id: I4462cca6b41ae1a0b1232c4517e02fb171bbccad
Reviewed-on: https://chromium-review.googlesource.com/c/1464719
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#631337}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 39d011cffef144bc7cf3d019c248c8032e9fe5d2
2019-02-12 19:36:54 +00:00
Erik Luo 08e147b821 DevTools: use 2 rows for narrow Computed sidebar layouts
Screenshot: https://imgur.com/a/E0g35gC

Bug: 899235
Change-Id: I90c643e48cfb8a7519627cd1446e04da19d09950
Reviewed-on: https://chromium-review.googlesource.com/c/1418502
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#631077}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: de362015ae467b05c3a90b54cfed8c6534776f20
2019-02-12 03:27:11 +00:00
Erik Luo f6956bc49e DevTools: remove flex from Computed widget for copyability
Bug: 899235
Change-Id: Ifb75bcd27cf74e95e4b30511f72d367a349d762b
Reviewed-on: https://chromium-review.googlesource.com/c/1418372
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#630264}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 61ecd6b7214a945d4831e686b461acc8b8e885a2
2019-02-08 10:24:46 +00:00
Erik Luo 4ccccc6aa5 DevTools: fix old shadow dom in DOMLinkifier
Bug: 929561
Change-Id: I98ec6ea3cc6a6de1d82489a737cd5f51f9bc56f0
Reviewed-on: https://chromium-review.googlesource.com/c/1457919
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#629953}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a62e482dc280ffa33572d9dc606cb61208192f5b
2019-02-07 14:02:57 +00:00
Joel Einbinder 274f28bf77 Revert "DevTools: Fix focus when selecting to the left of treeitems"
This reverts commit 9a60a25d0462306a5dcaeb390fbbca9ea22cdb03.

Reason for revert: This broke a lot of focus related logic
in the Elements panel

Bug: 920518

Original change's description:
> DevTools: Fix focus when selecting to the left of treeitems
> 
> The mousedown listener in ElementsTreeOutline was moving focus, but
> not consuming the event. The event then propagated to the treeoutline
> element itself, which stole focus.
> 
> Change-Id: I2de2001175f4029cd94880297c460ff4c90b845a
> Reviewed-on: https://chromium-review.googlesource.com/c/1387688
> Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
> Commit-Queue: Joel Einbinder <einbinder@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#618423}

TBR=pfeldman@chromium.org,einbinder@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I1407655b9a6ca03a2f110f87b7b9d2f98795ef53
Reviewed-on: https://chromium-review.googlesource.com/c/1450512
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#628528}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: bb79864925df7a5c7b61bcb1d35696e0fcbd6eb2
2019-02-02 00:20:01 +00:00
Joel Einbinder b64f5cef66 DevTools: Remove 1px of dead space between elements tree items
There was 1px of margin on items in the elements tree outline. If that
area was clicked, selecting a new element would fail.

Change-Id: I62c3aeb814759349c05582ac6b23309901e6d98e
Reviewed-on: https://chromium-review.googlesource.com/c/1387453
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#628193}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 12e6395ca993404b881e17c0e7540dd0bd197e75
2019-02-01 01:44:36 +00:00
Pavel Feldman db31091348 DevTools: graduate the experiments enabled by default, they are real code now.
Change-Id: Id95cb9f5e843223b9c7dd761e4b98bd1c902c66f
Reviewed-on: https://chromium-review.googlesource.com/c/1444139
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#627247}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a384d97e21177dc3849eafa97b3757e249350019
2019-01-30 00:31:20 +00:00
Joel Einbinder 7fbe24c094 DevTools: Convert to Shadow DOM and Custom Elements v1
Bug: 685385
Change-Id: I027e84d8003b7799492211d5fcf8348cd91fd799
Reviewed-on: https://chromium-review.googlesource.com/c/1422962
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#625513}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b00e6ea1c9b4db5d743c7c204b1f63abf89e0398
2019-01-24 05:19:01 +00:00
Pavel Feldman fc99cdcabc DevTools: brush up the overlay highlight plumbing.
Change-Id: I116e087daf4bf14ec40f28299841b99190a62f7c
Reviewed-on: https://chromium-review.googlesource.com/c/1422389
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#624426}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: da0aaf703699e2a2e90ebd162cf3b9f53514b483
2019-01-19 02:38:14 +00:00
Pavel Feldman 9794185e8d DevTools: make 'area screenshot' mode explicit, polish the surrounding overlay-related scenarios.
Change-Id: I7674326f6b715e85eca8485bc683ef3e5f5a54da
Reviewed-on: https://chromium-review.googlesource.com/c/1419819
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#624362}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b942396a040f49e9f727855563f8605131582522
2019-01-18 23:50:47 +00:00
Pavel Feldman 682d03172f DevTools: refactor a11y front-end code.
Change-Id: Ic1d1f17f49ec2ac4d5031a0f29fde053b9ebb7a6
Reviewed-on: https://chromium-review.googlesource.com/c/1410385
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#622880}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 67deb8f0d5964a8bf7c73baf72b60d28ca09296e
2019-01-15 23:55:26 +00:00
Erik Luo 884fa98b14 DevTools: context-aware console.clear, element.hide shortcuts
Before, pressing 'H' or 'Ctrl+L' on ANY panel would perform the
action (hide selected element, clear console). This CL makes both
shortcuts execute only when the respective panel/view is showing.

This allows 'Ctrl+L' to focus Omnibox when Console is not visible.

Bug: 915676
Change-Id: Ie5ef04786fcd240a393524f429cb45a3951cd5d0
Reviewed-on: https://chromium-review.googlesource.com/c/1405701
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#622211}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a858d1d9aa7a2043f87f538d6d61aa174c3fbe01
2019-01-11 23:22:39 +00:00
Pavel Feldman 7ad5b27948 DevTools: follow up to the selection color update:
- don't force the icon colors on the tree outline with light selection.
- use material colors for selection and buttons.

Bug: 850500
Change-Id: Iaba73dfb6ac762b3d5b1c374e1f1e7e3664cf41d
Reviewed-on: https://chromium-review.googlesource.com/c/1399567
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#620592}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c4afae7755c91545afd726ad3d6865fd74fd7de9
2019-01-08 03:01:00 +00:00
Erik Luo bf8429cb94 DevTools: only hide highlight when active property is set
When highlighting the active property, we used to always hide the
overlay highlight, even if no active property was being highlighted.
This CL checks that we do not hide unrelated highlights.

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

Bug: 918957
Change-Id: I118369e64af4062994221a5a79e8b0e16989b665
Reviewed-on: https://chromium-review.googlesource.com/c/1394986
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#620002}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6e4a073a3d8c968a1f7c9af7e6c2f6a47e959151
2019-01-04 18:26:43 +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
Pavel Feldman efab8cc944 DevTools: highlight relevant box model quads when editing padding/margin/border.
Change-Id: I51c33464af8991fbcd7c94bf1cdbc5869eb5f43a
Reviewed-on: https://chromium-review.googlesource.com/c/1388746
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#618689}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 4fbc5af23dad1e53127a4829ae206c263cc5ceda
2018-12-22 00:42:20 +00:00
Pavel Feldman 01243d6ab9 DevTools: do not steal focus from the styles sidebar while editing.
Bug: 917477
Change-Id: Ibf881ccc9577a6aa380c07b613042395567fb39d
Reviewed-on: https://chromium-review.googlesource.com/c/1388751
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#618645}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f01e9f40e7d86bb59fe09456d673de7ba19d9c11
2018-12-21 22:42:45 +00:00
Joel Einbinder 82dd655278 DevTools: Fix focus when selecting to the left of treeitems
The mousedown listener in ElementsTreeOutline was moving focus, but
not consuming the event. The event then propagated to the treeoutline
element itself, which stole focus.

Change-Id: I2de2001175f4029cd94880297c460ff4c90b845a
Reviewed-on: https://chromium-review.googlesource.com/c/1387688
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#618423}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9a60a25d0462306a5dcaeb390fbbca9ea22cdb03
2018-12-21 01:21:28 +00:00
Erik Luo 31c21f6ba7 DevTools: fix flickering, unwanted node highlight in Elements
Panel switching and page reloading could trigger re-focusing the
ElementsTreeOutline, producing unwanted node overlays.

In this CL
- Trees highlight nodes when selection changes (pre-Nov behavior),
  instead of highlight on focusin
- Hide node highlight when focus moves to non-highlightable elements
- Console will use a custom method to select and ensure the node is
  highlighted

Bug: 913084
Change-Id: I8b56b77c0aa8c34f5f7a819434510d549b139650
Reviewed-on: https://chromium-review.googlesource.com/c/1368770
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#616197}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3905efccbdcf2eb872d1c6a2ba652a58c12486f5
2018-12-13 03:39:39 +00:00
Erik Luo 42fd2c8fca DevTools: iterate on keyboard focused styles
- Focus color is now 'blue', closer to the background color of a
  focused console message.
- In both Objects and Nodes, focus highlight's width fits tightly
  around the text content.

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

Bug: 865674
Change-Id: Ie0fb14897dc855cd7713b2ce6ba0328ef205fc7a
Reviewed-on: https://chromium-review.googlesource.com/c/1368842
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#615792}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 073bc1736e62d826520b6d1a746e72b95a797345
2018-12-12 02:31:56 +00:00
Erik Luo 88fb01cb61 DevTools: revealing existing nodes should expand children limit
To reveal and select a node, we would call 'onpopulate' on all of its
ancestors without a TreeElement, which ensured that the node's own
TreeElement would be constructed.

When a parent has 500+ children, extra nodes are lazily built after
clicking a "Show more" button. To allow revealing hidden nodes,
this CL expands the limit if a parent is already populated.

Bug: 890632
Change-Id: Ia7b916c21baf5b35dbce8a26eca1681c9bb0b243
Reviewed-on: https://chromium-review.googlesource.com/c/1320569
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#613231}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: eda6f1d4f188141803cf61559826f9582d2b95b0
2018-12-03 20:43:29 +00:00
Pavel Feldman f5b981ac75 DevTools: wire add folder to workspace through the action system.
Change-Id: I12c8ed2052b171ab91658fd9f734117f18fc826b
Reviewed-on: https://chromium-review.googlesource.com/c/1354688
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#612547}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 07714205bcf970324d5fcf31275d76dc7ec7bb26
2018-11-30 03:42:08 +00:00
Erik Luo 4d3ca59cdb DevTools: do not highlight selected node on DevTools focus
Switching windows or using the Element picker may focus the DevTools
area with relatedTarget=null. In these cases, re-applying node
highlight is not needed.

Bug: 905252
Change-Id: Ie3ae228c9cc404f16598ff428d9e593bb90e33e5
Reviewed-on: https://chromium-review.googlesource.com/c/1336910
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#608541}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: bb1a4687d53112eba231613f92d018c116850eaf
2018-11-15 22:17:45 +00:00
Erik Luo df3a26ce8d DevTools: fix internal error on updating unwired element tree
The main ElementsTreeOutline in ElementsPanel is wired to DOMModel
updates, but ETOutlines in Console / elsewhere are not.

In the unwired case, nodes in the tree may have null `children()`.
This can result in internal errors.

Bug: 896445
Change-Id: Ie903fdddb76b31a5460ce2dd4b753be7ba7eeb56
Reviewed-on: https://chromium-review.googlesource.com/c/1286860
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#607419}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3cef24e0462f8521e4e5341196b0beba9d505cf7
2018-11-13 01:42:56 +00:00
Andrey Lushnikov c197ddf043 DevTools: copy JS path
This patch introduces a new 'Copy js path' option to the context
menu that allows to get a JavaScript reference to the object
in the DOM Tree. This comes handy when dealing with Shadow DOM
trees.

R=dgozman

Change-Id: I07a77597f88b6cc500baed8ae9ee097b35d79b4f
Reviewed-on: https://chromium-review.googlesource.com/c/1300756
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#606723}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: be8b1dc6dcc9c479f3df1aa11bf542e3a9790ae7
2018-11-09 03:25:59 +00:00
Erik Luo cc14b81085 DevTools: prevent tab focus for console objects
Focused Objects in Console will now have tabIndex -1 instead of 0.

Bug: 865674
Change-Id: I382576e1b5ec5ca0bc1c62b8ff0d998c73b18474
Reviewed-on: https://chromium-review.googlesource.com/c/1275266
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#605123}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: fd1d5501044ecd67a133c505ee98029c452d5b0a
2018-11-03 01:33:09 +00:00
Erik Luo fc6a630571 DevTools: navigable ElementsTreeOutline in Console
Introduces a common interface between ElementsTreeOutlines and
ObjectPropertiesSections. This allows both to be keyboard navigable
in Console.

Bug: 865674
Change-Id: I405d161692147374827918cce2369d129620a9fd
Reviewed-on: https://chromium-review.googlesource.com/c/1275225
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#604855}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: de8a9c26f6a4e28bc14e613e0d97cae69aef749b
2018-11-02 06:48:52 +00:00
Erik Luo 1617c3f2d0 [DevTools] Element trees should focus on select, highlight on focus
Bug: 865674
Change-Id: I42c6a50ca475615179ccd33bd1c8efb1549f1d69
Reviewed-on: https://chromium-review.googlesource.com/c/1300415
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#604709}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6d8ff26fcfe69dfbfb8e687169f362fec1834600
2018-11-01 21:15:18 +00:00
Erik Luo 54fdd918a2 [DevTools] turn Common.Renderer into UI.Renderer
Clients will need to render a generic object/DOMNode, and
be able to call `select()` to select the first child in the
resulting TreeOutline. This CL:
- Turns Common.Renderer > UI.Renderer
- Returns a tree, so interested clients can use it

Bug: 865674
Change-Id: Id877537a3c8713b99d34e6a4558037e0c8b3a111
Reviewed-on: https://chromium-review.googlesource.com/c/1298023
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#604637}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3ea41c834168b61e1e2c1b32d23d1775f9ddbe71
2018-11-01 17:57:01 +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
Oriol Brufau 23e7fc0c85 [css-logical] Use standard logical properties in /third_party/blink
Bug 850000 added standard logical properties and aliased prefixed ones
to them. The prefixed properties are still used in various places, but
the standard ones should be used instead. This patch replaces all the
uses in /third_party/blink

Spec: https://drafts.csswg.org/css-logical/#box

BUG=862141

Change-Id: I4d50faa5071ce735931488990d6c2275e57932f7
Reviewed-on: https://chromium-review.googlesource.com/c/1163785
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Original-Commit-Position: refs/heads/master@{#600531}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2976bc70cae2f802321faf3087573229e851bb0c
2018-10-17 20:07:31 +00:00
Joel Einbinder aa5d8239f8 [DevTools] fix(styles): color contrast info for css variables
Bug: 860286
Change-Id: Iec7cf205d6b240cb54b113690e61414e12685df9
Reviewed-on: https://chromium-review.googlesource.com/c/1278160
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#599378}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 548c459fb7741b83bd517b12882f533b04a5513e
2018-10-12 22:17:09 +00:00
Joel Einbinder ea8dc3d352 [DevTools] fix(elements): preserve active text highlight on contextmenu
Previously we would listen to a blur event coming out of the HTML editor
to know when to commit the text. To prevent an internal focus change
we would cancel mousedown events inside the editor. This confused
codemirror, which expects focus to have moved after a right click
and messed up its text selection color.

This patch removes the mousedown canceling, and checks relatedTarget
on the focus event to only commit when focus leaves the editor.

Bug: 894372
Change-Id: Id29f26c75d9f5a12c52679c3cd947987d2b8779e
Reviewed-on: https://chromium-review.googlesource.com/c/1277810
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#599015}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a62fbc18b5720d0653ef2c023510c340d1d9b42d
2018-10-11 23:48:01 +00:00
Joel Einbinder 75a2178b0a DevTools: Don't start editing the selector if there is a selection
If the user is trying to select the text of a css selector, we should
not interrupt them by editing the selector. This is consistent with
what we do for css properties.

Bug: 880269
Change-Id: I9ed162ba478195c9c9f2601347ee644c42aea39e
Reviewed-on: https://chromium-review.googlesource.com/c/1269521
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#597959}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 05ecf99c77cb8f76366ef504845a4e7bc761c7be
2018-10-09 17:14:57 +00:00
Erik Luo 76fe06cff6 DevTools: report correct image sizes in popover
Instead of showing offset, naturalW/H in image preview popover,
- Rendered size: better than 'offset', which includes unwanted
  padding, border.
- Intrinsic size: based on the natural size when loaded by DevTools
  without any density descriptor, also the original resource size.

OffsetW/H is no longer shown, but info available in the box model
and overlay highlight.

Bug: 788114, 801218
Change-Id: I6ec08c5bcd62c0cb3d8815a1d7079cccb022ef5d
Reviewed-on: https://chromium-review.googlesource.com/c/1256072
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#597404}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a73757aba48e30c90833b13576c15fba83c90f77
2018-10-06 03:42:35 +00:00