memory.css 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  3. * You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. /* CSS Variables specific to this panel that aren't defined by the themes */
  5. .theme-dark {
  6. --cell-border-color: rgba(255,255,255,0.15);
  7. --cell-border-color-light: rgba(255,255,255,0.1);
  8. --focus-cell-border-color: rgba(255,255,255,0.5);
  9. --row-alt-background-color: rgba(86, 117, 185, 0.15);
  10. --row-hover-background-color: rgba(86, 117, 185, 0.25);
  11. }
  12. .theme-light {
  13. --cell-border-color: rgba(0,0,0,0.15);
  14. --cell-border-color-light: rgba(0,0,0,0.1);
  15. --focus-cell-border-color: rgba(0,0,0,0.3);
  16. --row-alt-background-color: rgba(76,158,217,0.1);
  17. --row-hover-background-color: rgba(76,158,217,0.2);
  18. }
  19. html, body, #app, #memory-tool {
  20. height: 100%;
  21. }
  22. #memory-tool {
  23. /**
  24. * Flex: contains two children: .devtools-toolbar and #memory-tool-container,
  25. * which need to be laid out vertically. The toolbar has a fixed height and
  26. * the container needs to flex to fill out all remaining vertical space.
  27. */
  28. display: flex;
  29. flex-direction: column;
  30. --sidebar-width: 185px;
  31. /**
  32. * If --heap-tree-row-height changes, be sure to change HEAP_TREE_ROW_HEIGHT
  33. * in `devtools/client/memory/components/heap.js`.
  34. */
  35. --heap-tree-row-height: 18px;
  36. --heap-tree-header-height: 18px;
  37. }
  38. /**
  39. * Toolbar
  40. */
  41. .devtools-toolbar {
  42. /**
  43. * Flex: contains several children, which need to be laid out horizontally,
  44. * and aligned vertically in the middle of the container.
  45. */
  46. display: flex;
  47. align-items: center;
  48. }
  49. .devtools-toolbar > .toolbar-group:nth-of-type(1) {
  50. /**
  51. * We want this to be exactly at a `--sidebar-width` distance from the
  52. * toolbar's start boundary. A `.devtools-toolbar` has a 3px start padding.
  53. */
  54. flex: 0 0 calc(var(--sidebar-width) - 4px);
  55. border-inline-end: 1px solid var(--theme-splitter-color);
  56. margin-inline-end: 5px;
  57. padding-right: 1px;
  58. }
  59. .devtools-toolbar > .toolbar-group {
  60. /**
  61. * Flex: contains several children, which need to be laid out horizontally,
  62. * and aligned vertically in the middle of the container.
  63. */
  64. display: flex;
  65. align-items: center;
  66. flex: 1;
  67. white-space: nowrap;
  68. overflow: hidden;
  69. text-overflow: ellipsis;
  70. }
  71. .devtools-toolbar > .toolbar-group > label {
  72. /**
  73. * Flex: contains form controls and text, which need to be laid out
  74. * horizontally, vertically aligned in the middle of the container.
  75. */
  76. display: flex;
  77. align-items: center;
  78. margin-inline-end: 5px;
  79. }
  80. .devtools-toolbar > .toolbar-group > label.display-by > span {
  81. margin-inline-end: 5px;
  82. }
  83. .devtools-toolbar > .toolbar-group > label.label-by > span {
  84. margin-inline-end: 5px;
  85. }
  86. .devtools-toolbar > label {
  87. margin-inline-end: 5px;
  88. }
  89. #select-view {
  90. margin-inline-start: 5px;
  91. }
  92. #take-snapshot::before {
  93. background-image: url(images/command-screenshot.svg);
  94. }
  95. #clear-snapshots::before {
  96. background-image: url(chrome://devtools/skin/images/clear.svg);
  97. }
  98. #diff-snapshots::before {
  99. background-image: url(chrome://devtools/skin/images/diff.svg);
  100. }
  101. #import-snapshot::before {
  102. background-image: url(chrome://devtools/skin/images/import.svg);
  103. }
  104. #record-allocation-stacks-label,
  105. #pop-view-button-label {
  106. border-inline-end: 1px solid var(--theme-splitter-color);
  107. padding-inline-end: 5px;
  108. }
  109. .spacer {
  110. flex: 1;
  111. }
  112. #filter {
  113. align-self: stretch;
  114. margin: 2px;
  115. }
  116. /**
  117. * Container (sidebar + main panel)
  118. */
  119. #memory-tool-container {
  120. /**
  121. * Flex: contains two children: .list (sidebar) and #heap-view (main panel),
  122. * which need to be laid out horizontally. The sidebar has a fixed width and
  123. * the main panel needs to flex to fill out all remaining horizontal space.
  124. */
  125. display: flex;
  126. /**
  127. * Flexing to fill out remaining vertical space. The preceeding sibling is
  128. * the toolbar. @see #memory-tool.
  129. */
  130. flex: 1;
  131. overflow: hidden;
  132. }
  133. /**
  134. * Sidebar
  135. */
  136. .list {
  137. width: var(--sidebar-width);
  138. min-width: var(--sidebar-width);
  139. overflow-y: auto;
  140. margin: 0;
  141. padding: 0;
  142. background-color: var(--theme-sidebar-background);
  143. border-inline-end: 1px solid var(--theme-splitter-color);
  144. }
  145. .snapshot-list-item {
  146. /**
  147. * Flex: contains several children, which need to be laid out vertically.
  148. */
  149. display: flex;
  150. flex-direction: column;
  151. color: var(--theme-body-color);
  152. border-bottom: 1px solid rgba(128,128,128,0.15);
  153. padding: 8px;
  154. cursor: default;
  155. }
  156. .snapshot-list-item.selected {
  157. background-color: var(--theme-selection-background);
  158. color: var(--theme-selection-color);
  159. }
  160. .snapshot-list-item.selected ::-moz-selection {
  161. background-color: var(--theme-selection-color);
  162. color: var(--theme-selection-background);
  163. }
  164. .snapshot-list-item .snapshot-info {
  165. display: flex;
  166. justify-content: space-between;
  167. font-size: 90%;
  168. }
  169. .snapshot-list-item .snapshot-title {
  170. display: flex;
  171. justify-content: space-between;
  172. }
  173. .snapshot-list-item .save {
  174. text-decoration: underline;
  175. cursor: pointer;
  176. }
  177. .snapshot-list-item .delete {
  178. cursor: pointer;
  179. position: relative;
  180. min-height: 1em;
  181. min-width: 1.3em;
  182. }
  183. .snapshot-list-item.selected .delete::before {
  184. filter: invert(1);
  185. }
  186. .snapshot-list-item .delete::before {
  187. background-image: url("chrome://devtools/skin/images/close.svg");
  188. background-position: 0.2em 0;
  189. }
  190. .snapshot-list-item > .snapshot-title {
  191. margin-bottom: 14px;
  192. }
  193. .snapshot-list-item > .snapshot-title > input[type=checkbox] {
  194. margin: 0;
  195. margin-inline-end: 5px;
  196. }
  197. .snapshot-list-item > .snapshot-state,
  198. .snapshot-list-item > .snapshot-totals {
  199. font-size: 90%;
  200. color: var(--theme-body-color-alt);
  201. }
  202. .snapshot-list-item.selected > .snapshot-state,
  203. .snapshot-list-item.selected > .snapshot-totals {
  204. /* Text inside a selected item should not be custom colored. */
  205. color: inherit !important;
  206. }
  207. /**
  208. * Main panel
  209. */
  210. .vbox {
  211. display: flex;
  212. flex-direction: column;
  213. width: 100%;
  214. height: 100%;
  215. overflow: auto;
  216. padding: 0;
  217. margin: 0;
  218. }
  219. .vbox > * {
  220. flex: 1;
  221. /**
  222. * By default, flex items have min-width: auto;
  223. * (https://drafts.csswg.org/css-flexbox/#min-size-auto)
  224. */
  225. min-width: 0;
  226. }
  227. #heap-view {
  228. /**
  229. * Flex: contains a .heap-view-panel which needs to fill out all the
  230. * available space, horizontally and vertically.
  231. */;
  232. display: flex;
  233. /**
  234. * Flexing to fill out remaining horizontal space. The preceeding sibling
  235. * is the sidebar. @see #memory-tool-container.
  236. */
  237. flex: 1;
  238. background-color: var(--theme-body-background);
  239. /**
  240. * By default, flex items have min-width: auto;
  241. * (https://drafts.csswg.org/css-flexbox/#min-size-auto)
  242. */
  243. min-width: 0;
  244. font-size: 90%;
  245. }
  246. #heap-view > .heap-view-panel {
  247. /**
  248. * Flex: can contain several children, including a tree with a header and
  249. * multiple rows, all of which need to be laid out vertically. When the
  250. * tree is visible, the header has a fixed height and tree body needs to flex
  251. * to fill out all remaining vertical space.
  252. */
  253. display: flex;
  254. flex-direction: column;
  255. /**
  256. * Flexing to fill out remaining horizontal space. @see #heap-view.
  257. */
  258. flex: 1;
  259. /**
  260. * By default, flex items have min-width: auto;
  261. * (https://drafts.csswg.org/css-flexbox/#min-size-auto)
  262. */
  263. min-width: 0;
  264. }
  265. #heap-view > .heap-view-panel > .snapshot-status,
  266. #heap-view > .heap-view-panel > .take-snapshot,
  267. #heap-view .empty,
  268. #shortest-paths-select-node-msg {
  269. margin: auto;
  270. margin-top: 65px;
  271. font-size: 120%;
  272. }
  273. #heap-view > .heap-view-panel > .take-snapshot {
  274. padding: 5px;
  275. }
  276. #heap-view > .heap-view-panel[data-state="snapshot-state-error"] pre {
  277. background-color: var(--theme-body-background);
  278. margin: 20px;
  279. padding: 20px;
  280. }
  281. /**
  282. * Heap tree view header
  283. */
  284. .header {
  285. /**
  286. * Flex: contains several span columns, all of which need to be laid out
  287. * horizontally. All columns except the last one have percentage widths, and
  288. * the last one needs to flex to fill out all remaining horizontal space.
  289. */
  290. display: flex;
  291. color: var(--theme-body-color);
  292. background-color: var(--theme-tab-toolbar-background);
  293. border-bottom: 1px solid var(--cell-border-color);
  294. flex: 0;
  295. }
  296. .header > span,
  297. #shortest-paths-header {
  298. text-overflow: ellipsis;
  299. line-height: var(--heap-tree-header-height);
  300. justify-content: center;
  301. justify-self: center;
  302. white-space: nowrap;
  303. }
  304. .header > span {
  305. overflow: hidden;
  306. }
  307. .header > .heap-tree-item-name {
  308. justify-content: flex-start;
  309. }
  310. #shortest-paths {
  311. background-color: var(--theme-body-background);
  312. overflow: hidden;
  313. height: 100%;
  314. width: 100%;
  315. }
  316. #shortest-paths-select-node-msg {
  317. justify-self: center;
  318. }
  319. /**
  320. * Heap tree view body
  321. */
  322. .tree {
  323. /**
  324. * Flexing to fill out remaining vertical space. @see .heap-view-panel
  325. */
  326. flex: 1;
  327. overflow-y: auto;
  328. background-color: var(--theme-body-background);
  329. }
  330. .tree-node {
  331. height: var(--heap-tree-row-height);
  332. line-height: var(--heap-tree-row-height);
  333. cursor: default;
  334. }
  335. .children-pointer {
  336. padding-inline-end: 5px;
  337. }
  338. .children-pointer:dir(rtl) {
  339. transform: scaleX(-1);
  340. }
  341. /**
  342. * Heap tree view columns
  343. */
  344. .heap-tree-item {
  345. /**
  346. * Flex: contains several span columns, all of which need to be laid out
  347. * horizontally. All columns except the last one have percentage widths, and
  348. * the last one needs to flex to fill out all remaining horizontal space.
  349. */
  350. display: flex;
  351. }
  352. .tree-node-odd {
  353. background-color: var(--row-alt-background-color);
  354. }
  355. .tree-node:hover {
  356. background-color: var(--row-hover-background-color);
  357. }
  358. .heap-tree-item.focused {
  359. background-color: var(--theme-selection-background);
  360. color: var(--theme-selection-color);
  361. }
  362. .heap-tree-item.focused ::-moz-selection {
  363. background-color: var(--theme-selection-color);
  364. color: var(--theme-selection-background);
  365. }
  366. .heap-tree-item-individuals,
  367. .heap-tree-item-bytes,
  368. .heap-tree-item-count,
  369. .heap-tree-item-total-bytes,
  370. .heap-tree-item-total-count {
  371. /**
  372. * Flex: contains several subcolumns, which need to be laid out horizontally.
  373. * These subcolumns may have specific widths or need to flex.
  374. */
  375. display: flex;
  376. /* Make sure units/decimals/... are always vertically aligned to right in both LTR and RTL locales */
  377. text-align: right;
  378. border-inline-end: var(--cell-border-color) 1px solid;
  379. }
  380. .heap-tree-item-count,
  381. .heap-tree-item-total-count,
  382. .heap-tree-item-bytes,
  383. .heap-tree-item-total-bytes {
  384. width: 10%;
  385. /*
  386. * Provision for up to 19 characters:
  387. *
  388. * GG_MMM_KKK_BBB_100%
  389. * | ||| |
  390. * '------------'|'--'
  391. * 14 ch for 10s | 4 ch for the largest % we will
  392. * of GB and | normally see: "100%"
  393. * spaces every |
  394. * 3 digits |
  395. * |
  396. * A space between the number and percent
  397. */
  398. min-width: 19ch;
  399. }
  400. .heap-tree-item-name {
  401. /**
  402. * Flex: contains an .arrow and some text, which need to be laid out
  403. * horizontally, vertically aligned in the middle of the container.
  404. */
  405. display: flex;
  406. align-items: center;
  407. /**
  408. * Flexing to fill out remaining vertical space.
  409. * @see .header and .heap-tree-item */
  410. flex: 1;
  411. padding-inline-start: 5px;
  412. }
  413. /**
  414. * Heap tree view subcolumns
  415. */
  416. .heap-tree-number,
  417. .heap-tree-percent,
  418. .heap-tree-item-name {
  419. white-space: nowrap;
  420. }
  421. .heap-tree-number {
  422. padding: 0 3px;
  423. flex: 1;
  424. color: var(--theme-content-color3);
  425. /* Make sure number doesn't appear backwards on RTL locales */
  426. direction: ltr;
  427. }
  428. .heap-tree-percent {
  429. padding-inline-start: 3px;
  430. padding-inline-end: 3px;
  431. }
  432. .heap-tree-number,
  433. .heap-tree-percent {
  434. font-family: var(--monospace-font-family);
  435. }
  436. .heap-tree-percent {
  437. width: 4ch;
  438. }
  439. .heap-tree-item.focused .heap-tree-number,
  440. .heap-tree-item.focused .heap-tree-percent {
  441. color: inherit;
  442. }
  443. .heap-tree-item-individuals {
  444. width: 38px;
  445. min-width: 20px;
  446. overflow: hidden;
  447. margin: 0;
  448. }
  449. .heap-tree-item-individuals > button {
  450. height: 10px;
  451. width: 32px;
  452. /* Override default styles for toolbar buttons to fix entire row height. */
  453. margin: 0 auto !important;
  454. padding: 0;
  455. }
  456. /**
  457. * Tree map
  458. */
  459. .tree-map-container {
  460. width: 100%;
  461. height: 100%;
  462. position: relative;
  463. overflow: hidden;
  464. }
  465. /**
  466. * Heap tree errors.
  467. */
  468. .error::before {
  469. content: "";
  470. display: inline-block;
  471. width: 12px;
  472. height: 12px;
  473. max-height: 12px;
  474. background-image: url(chrome://devtools/skin/images/webconsole.svg);
  475. background-size: 72px 60px;
  476. background-position: -24px -24px;
  477. background-repeat: no-repeat;
  478. margin: 0px;
  479. margin-top: 2px;
  480. margin-inline-end: 5px;
  481. }
  482. .theme-light .error::before {
  483. background-image: url(chrome://devtools/skin/images/webconsole.svg#light-icons);
  484. }
  485. /**
  486. * Frame View components
  487. */
  488. .separator,
  489. .not-available,
  490. .heap-tree-item-address {
  491. opacity: .5;
  492. margin-left: .5em;
  493. margin-right: .5em;
  494. }
  495. .heap-tree-item-address {
  496. font-family: monospace;
  497. }
  498. .no-allocation-stacks {
  499. border-color: var(--theme-splitter-color);
  500. border-style: solid;
  501. border-width: 0px 0px 1px 0px;
  502. text-align: center;
  503. padding: 5px;
  504. }
  505. /**
  506. * Dagre-D3 graphs
  507. */
  508. svg {
  509. --arrow-color: var(--theme-splitter-color);
  510. --text-color: var(--theme-body-color-alt);
  511. }
  512. .theme-dark svg {
  513. --arrow-color: var(--theme-body-color-alt);
  514. }
  515. svg #arrowhead {
  516. /* !important is needed to override inline style */
  517. fill: var(--arrow-color) !important;
  518. }
  519. .edgePath path {
  520. stroke-width: 1px;
  521. fill: none;
  522. stroke: var(--arrow-color);
  523. }
  524. g.edgeLabel rect {
  525. fill: var(--theme-body-background);
  526. }
  527. g.edgeLabel tspan {
  528. fill: var(--text-color);
  529. }
  530. .nodes rect {
  531. stroke-width: 1px;
  532. stroke: var(--theme-splitter-color);
  533. fill: var(--theme-toolbar-background);
  534. }
  535. text {
  536. font-size: 1.25em;
  537. fill: var(--text-color);
  538. /* Make sure text stays inside its container in RTL locales */
  539. direction: ltr;
  540. }