1 | const inspectorCommands = require('./InspectorBackendCommands');
|
2 | import * as debuggerDomains from '.';
|
3 | import { attachCSSInspectorCommandCallbacks } from './devtools-elements';
|
4 | let CSSDomainDebugger = class CSSDomainDebugger {
|
5 | constructor() {
|
6 | this.events = new inspectorCommands.CSSDomain.CSSFrontend();
|
7 | this.commands = {};
|
8 | attachCSSInspectorCommandCallbacks(this.commands);
|
9 |
|
10 |
|
11 | this.enable();
|
12 | }
|
13 | get enabled() {
|
14 | return this._enabled;
|
15 | }
|
16 | enable() {
|
17 | if (debuggerDomains.getCSS()) {
|
18 | throw new Error('One CSSDomainDebugger may be enabled at a time.');
|
19 | }
|
20 | else {
|
21 | debuggerDomains.setCSS(this);
|
22 | }
|
23 | this._enabled = true;
|
24 | }
|
25 | |
26 |
|
27 |
|
28 | disable() {
|
29 | if (debuggerDomains.getCSS() === this) {
|
30 | debuggerDomains.setCSS(null);
|
31 | }
|
32 | this._enabled = false;
|
33 | }
|
34 | getMatchedStylesForNode(params) {
|
35 | return {};
|
36 | }
|
37 |
|
38 | getInlineStylesForNode(params) {
|
39 | return {};
|
40 | }
|
41 |
|
42 | getComputedStyleForNode(params) {
|
43 | return {
|
44 | computedStyle: this.commands.getComputedStylesForNode(params.nodeId),
|
45 | };
|
46 | }
|
47 |
|
48 | getPlatformFontsForNode(params) {
|
49 | return {
|
50 | fonts: [
|
51 | {
|
52 |
|
53 | familyName: 'Standard Font',
|
54 |
|
55 | isCustomFont: false,
|
56 |
|
57 | glyphCount: 0,
|
58 | },
|
59 | ],
|
60 | };
|
61 | }
|
62 |
|
63 | getStyleSheetText(params) {
|
64 | return null;
|
65 | }
|
66 | };
|
67 | CSSDomainDebugger = __decorate([
|
68 | inspectorCommands.DomainDispatcher('CSS'),
|
69 | __metadata("design:paramtypes", [])
|
70 | ], CSSDomainDebugger);
|
71 | export { CSSDomainDebugger };
|
72 |
|
\ | No newline at end of file |