Files
react-native-devtools-frontend/front_end/elements/computedStyleWidgetTree.css
T
Changhao Han 097956ebb5 Improve rendering performance in the Computed Styles pane
Currently the Computed Styles pane renders several hundreds of computed
styles in a single cycle, which means creating, appending, layout-out,
rendering, and painting hundreds of heavily styled <li> items that
contains widgets and children. This can create a visual lag ranging
from ~100ms to ~1s. This CL breaks down these operations into smaller
batches, and queues them using browser's requestIdleCallback to provide
an instant rendering feedback.

tracing before: https://chromedevtools.github.io/timeline-viewer/?loadTimelineFromURL=https://gist.githubusercontent.com/hanselfmu/424153ea140df049800e716031882238/raw/c62f1561cf4f56c1c5c869325015f3d99ab65637/computed_tab_perf_before.json
tracing after: https://chromedevtools.github.io/timeline-viewer/?loadTimelineFromURL=https://gist.github.com/hanselfmu/5fdc43d3ae878aed82e79ff3af3c1ed6/raw/7d5095dfde0236eccafe53ec0fb22356e303afb9/computed_tab_perf_after.json

Bug: chromium:1100148, chromium:1106251, chromium:1093263
Change-Id: Id0acbf91542280b026fdb67e28097bdb445606ea
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2308547
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-07-22 12:30:40 +00:00

159 lines
3.0 KiB
CSS

/*
* Copyright (c) 2017 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
.computed-style-property {
overflow: hidden;
flex: auto;
text-overflow: ellipsis;
}
.computed-style-property .property-name {
width: 16em;
text-overflow: ellipsis;
overflow: hidden;
max-width: 52%;
display: inline-block;
vertical-align: text-top;
}
.computed-style-property .property-value {
margin-left: 2em;
position: relative;
}
.computed-style-property .property-value-text {
overflow: hidden;
text-overflow: ellipsis;
}
.goto-source-icon {
background-color: #5a5a5a;
display: none;
position: absolute;
left: -16px;
top: 0;
}
.goto-source-icon:hover {
background-color: #333;
}
.tree-outline li:hover .goto-source-icon {
display: block;
margin-top: -2px;
}
.computed-style-property-inherited {
opacity: 50%;
}
.trace-link {
user-select: none;
float: right;
padding-left: 1em;
position: relative;
z-index: 1;
}
.property-trace {
text-overflow: ellipsis;
overflow: hidden;
flex-grow: 1;
}
.property-trace-selector {
color: gray;
padding-left: 2em;
}
.property-trace-value {
position: relative;
display: inline-block;
margin-left: 16px;
}
.property-trace-inactive .property-trace-value::before {
position: absolute;
content: ".";
border-bottom: 1px solid rgb(0 0 0 / 35%);
top: 0;
bottom: 5px;
left: 0;
right: 0;
}
.tree-outline li.even-row {
position: relative;
background-color: #f5f5f5;
}
.tree-outline,
.tree-outline ol {
padding-left: 0;
}
.tree-outline li:hover {
background-color: rgb(235 242 252);
cursor: pointer;
}
.tree-outline li::before {
margin-left: 4px;
}
.delimiter {
color: transparent;
}
.delimiter::selection {
color: transparent;
}
.computed-narrow .computed-style-property .property-name,
.computed-narrow .computed-style-property .property-value {
display: inline-block;
width: 100%;
max-width: 100%;
margin-left: 0;
white-space: nowrap;
}
.computed-narrow .computed-style-property {
padding: 2px 0;
display: block;
white-space: normal;
}
.computed-narrow.tree-outline li::before {
margin-top: -14px;
}
@media (forced-colors: active) {
.computed-style-property-inherited {
opacity: 100%;
}
:host-context(.monospace.computed-properties) .tree-outline li:hover {
forced-color-adjust: none;
background-color: Highlight;
}
:host-context(.monospace.computed-properties) .tree-outline:not(.hide-selection-when-blurred) li.parent:hover.selected::before,
:host-context(.monospace.computed-properties) .tree-outline-disclosure li.parent:hover::before,
:host-context(.monospace.computed-properties) .tree-outline li:hover .goto-source-icon {
background-color: HighlightText;
}
:host-context(.monospace.computed-properties) .tree-outline li:hover * {
color: HighlightText;
}
.property-trace-inactive .property-trace-value::before {
content: "";
border-bottom-color: HighlightText !important;
}
}