mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-15 17:55:15 -10:00
We used to re-render the component each time the sourcemapService would give us a result for a single frame. Combined with the frame grouping system, this could trigger weird re-layout and might confuse user. What's done in this patch is that when mounting, if a sourcemapService is passed, we don't render anything, and start a race between a delay of 300ms and the sourcemap results for *all* the frames. If we don't have the original frames within 300ms, we render the bundled frames. But, whenever we have the sourcemap results, we trigger a re-render of the component. This gives some room for the sourcemapService to fetch map files without re-ordering things on the screen. A test case is added to ensure we have the expected renders when the sourcemap service takes more time than the inital delay. We already have a case where the sourcemap service resuls are received before the initial delay. We also take this as an opportunity to fix minor CSS issues. Differential Revision: https://phabricator.services.mozilla.com/D12037
110 lines
2.3 KiB
CSS
110 lines
2.3 KiB
CSS
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
/**
|
|
* SmartTrace Component
|
|
* Styles for React component at `devtools/client/shared/components/SmartTrace.js`
|
|
*/
|
|
|
|
.frames ul {
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
display: inline-grid;
|
|
grid-template-columns: auto auto 1fr;
|
|
grid-column-gap: 8px;
|
|
}
|
|
|
|
.frames .frame {
|
|
display: contents;
|
|
cursor: pointer;
|
|
white-space: normal;
|
|
}
|
|
|
|
.frames .title {
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
grid-column: 1 / 2;
|
|
color: var(--console-output-color);
|
|
}
|
|
|
|
.frames .location {
|
|
color: var(--frame-link-source);
|
|
grid-column: -1 / -2;
|
|
/* Force the location to be on one line and crop at start */
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
direction: rtl;
|
|
}
|
|
|
|
.frames .location .line {
|
|
color: var(--frame-link-line-color);
|
|
}
|
|
|
|
.frames ul .frame:hover .location {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
/******* Group styles *******/
|
|
.frames .frames-group,
|
|
.frames .frames-group .group {
|
|
display: contents;
|
|
}
|
|
|
|
.frames-group .frames-list .frame {
|
|
padding-inline-start: 16px;
|
|
display: block;
|
|
grid-column: 1 / -1;
|
|
}
|
|
|
|
.frames-list {
|
|
grid-column: 1 / -1;
|
|
margin-block-start: 2px;
|
|
}
|
|
|
|
.frames .frames-list .frame:first-of-type {
|
|
border-top: 1px solid var(--theme-splitter-color);
|
|
padding-block-start: 4px;
|
|
}
|
|
|
|
.frames .frames-list .frame:last-of-type {
|
|
margin-block-end: 4px;
|
|
border-bottom: 1px solid var(--theme-splitter-color);
|
|
}
|
|
|
|
.frames ul .frames-group.expanded,
|
|
.frames ul .frames-group.expanded .location {
|
|
color: var(--theme-highlight-blue);
|
|
}
|
|
|
|
.frames ul .frames-group.expanded .react path {
|
|
fill: var(--theme-highlight-blue);
|
|
}
|
|
|
|
.frames ul .frames-group.expanded .badge {
|
|
color: var(--theme-highlight-blue);
|
|
}
|
|
|
|
.badge {
|
|
background: var(--theme-toolbar-background-hover);
|
|
color: var(--theme-body-color);
|
|
border-radius: 8px;
|
|
padding: 1px 4px;
|
|
font-size: 0.9em;
|
|
display: inline-block;
|
|
text-align: center;
|
|
cursor: default;
|
|
}
|
|
|
|
.annotation-logo {
|
|
display: inline-block;
|
|
width: 12px;
|
|
margin-inline-start: 4px;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
:root.theme-dark .annotation-logo:not(.angular) svg path {
|
|
fill: var(--theme-highlight-blue);
|
|
}
|