parsek-cdp 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- parsek_cdp/__init__.py +55 -0
- parsek_cdp/_logging.py +49 -0
- parsek_cdp/cdp/__init__.py +247 -0
- parsek_cdp/cdp/accessibility/__init__.py +15 -0
- parsek_cdp/cdp/accessibility/events.py +35 -0
- parsek_cdp/cdp/accessibility/functions.py +202 -0
- parsek_cdp/cdp/accessibility/types.py +235 -0
- parsek_cdp/cdp/animation/__init__.py +15 -0
- parsek_cdp/cdp/animation/events.py +52 -0
- parsek_cdp/cdp/animation/functions.py +140 -0
- parsek_cdp/cdp/animation/types.py +113 -0
- parsek_cdp/cdp/audits/__init__.py +15 -0
- parsek_cdp/cdp/audits/events.py +21 -0
- parsek_cdp/cdp/audits/functions.py +95 -0
- parsek_cdp/cdp/audits/types.py +1051 -0
- parsek_cdp/cdp/autofill/__init__.py +15 -0
- parsek_cdp/cdp/autofill/events.py +27 -0
- parsek_cdp/cdp/autofill/functions.py +64 -0
- parsek_cdp/cdp/autofill/types.py +108 -0
- parsek_cdp/cdp/backgroundservice/__init__.py +15 -0
- parsek_cdp/cdp/backgroundservice/events.py +40 -0
- parsek_cdp/cdp/backgroundservice/functions.py +59 -0
- parsek_cdp/cdp/backgroundservice/types.py +63 -0
- parsek_cdp/cdp/bluetoothemulation/__init__.py +15 -0
- parsek_cdp/cdp/bluetoothemulation/events.py +70 -0
- parsek_cdp/cdp/bluetoothemulation/functions.py +247 -0
- parsek_cdp/cdp/bluetoothemulation/types.py +120 -0
- parsek_cdp/cdp/browser/__init__.py +15 -0
- parsek_cdp/cdp/browser/events.py +46 -0
- parsek_cdp/cdp/browser/functions.py +350 -0
- parsek_cdp/cdp/browser/types.py +158 -0
- parsek_cdp/cdp/cachestorage/__init__.py +15 -0
- parsek_cdp/cdp/cachestorage/events.py +13 -0
- parsek_cdp/cdp/cachestorage/functions.py +126 -0
- parsek_cdp/cdp/cachestorage/types.py +89 -0
- parsek_cdp/cdp/cast/__init__.py +15 -0
- parsek_cdp/cdp/cast/events.py +38 -0
- parsek_cdp/cdp/cast/functions.py +77 -0
- parsek_cdp/cdp/cast/types.py +23 -0
- parsek_cdp/cdp/console/__init__.py +15 -0
- parsek_cdp/cdp/console/events.py +22 -0
- parsek_cdp/cdp/console/functions.py +36 -0
- parsek_cdp/cdp/console/types.py +30 -0
- parsek_cdp/cdp/css/__init__.py +15 -0
- parsek_cdp/cdp/css/events.py +79 -0
- parsek_cdp/cdp/css/functions.py +788 -0
- parsek_cdp/cdp/css/types.py +742 -0
- parsek_cdp/cdp/debugger/__init__.py +15 -0
- parsek_cdp/cdp/debugger/events.py +164 -0
- parsek_cdp/cdp/debugger/functions.py +663 -0
- parsek_cdp/cdp/debugger/types.py +171 -0
- parsek_cdp/cdp/deviceaccess/__init__.py +15 -0
- parsek_cdp/cdp/deviceaccess/events.py +30 -0
- parsek_cdp/cdp/deviceaccess/functions.py +54 -0
- parsek_cdp/cdp/deviceaccess/types.py +28 -0
- parsek_cdp/cdp/deviceorientation/__init__.py +15 -0
- parsek_cdp/cdp/deviceorientation/events.py +13 -0
- parsek_cdp/cdp/deviceorientation/functions.py +35 -0
- parsek_cdp/cdp/deviceorientation/types.py +10 -0
- parsek_cdp/cdp/dom/__init__.py +15 -0
- parsek_cdp/cdp/dom/events.py +228 -0
- parsek_cdp/cdp/dom/functions.py +1033 -0
- parsek_cdp/cdp/dom/types.py +293 -0
- parsek_cdp/cdp/domdebugger/__init__.py +15 -0
- parsek_cdp/cdp/domdebugger/events.py +13 -0
- parsek_cdp/cdp/domdebugger/functions.py +155 -0
- parsek_cdp/cdp/domdebugger/types.py +57 -0
- parsek_cdp/cdp/domsnapshot/__init__.py +15 -0
- parsek_cdp/cdp/domsnapshot/events.py +13 -0
- parsek_cdp/cdp/domsnapshot/functions.py +111 -0
- parsek_cdp/cdp/domsnapshot/types.py +312 -0
- parsek_cdp/cdp/domstorage/__init__.py +15 -0
- parsek_cdp/cdp/domstorage/events.py +60 -0
- parsek_cdp/cdp/domstorage/functions.py +79 -0
- parsek_cdp/cdp/domstorage/types.py +30 -0
- parsek_cdp/cdp/emulation/__init__.py +15 -0
- parsek_cdp/cdp/emulation/events.py +17 -0
- parsek_cdp/cdp/emulation/functions.py +688 -0
- parsek_cdp/cdp/emulation/types.py +305 -0
- parsek_cdp/cdp/eventbreakpoints/__init__.py +15 -0
- parsek_cdp/cdp/eventbreakpoints/events.py +13 -0
- parsek_cdp/cdp/eventbreakpoints/functions.py +41 -0
- parsek_cdp/cdp/eventbreakpoints/types.py +10 -0
- parsek_cdp/cdp/extensions/__init__.py +15 -0
- parsek_cdp/cdp/extensions/events.py +13 -0
- parsek_cdp/cdp/extensions/functions.py +118 -0
- parsek_cdp/cdp/extensions/types.py +19 -0
- parsek_cdp/cdp/fedcm/__init__.py +15 -0
- parsek_cdp/cdp/fedcm/events.py +45 -0
- parsek_cdp/cdp/fedcm/functions.py +93 -0
- parsek_cdp/cdp/fedcm/types.py +72 -0
- parsek_cdp/cdp/fetch/__init__.py +15 -0
- parsek_cdp/cdp/fetch/events.py +82 -0
- parsek_cdp/cdp/fetch/functions.py +215 -0
- parsek_cdp/cdp/fetch/types.py +81 -0
- parsek_cdp/cdp/filesystem/__init__.py +15 -0
- parsek_cdp/cdp/filesystem/events.py +13 -0
- parsek_cdp/cdp/filesystem/functions.py +36 -0
- parsek_cdp/cdp/filesystem/types.py +54 -0
- parsek_cdp/cdp/headlessexperimental/__init__.py +15 -0
- parsek_cdp/cdp/headlessexperimental/events.py +13 -0
- parsek_cdp/cdp/headlessexperimental/functions.py +77 -0
- parsek_cdp/cdp/headlessexperimental/types.py +24 -0
- parsek_cdp/cdp/heapprofiler/__init__.py +15 -0
- parsek_cdp/cdp/heapprofiler/events.py +65 -0
- parsek_cdp/cdp/heapprofiler/functions.py +193 -0
- parsek_cdp/cdp/heapprofiler/types.py +57 -0
- parsek_cdp/cdp/indexeddb/__init__.py +15 -0
- parsek_cdp/cdp/indexeddb/events.py +13 -0
- parsek_cdp/cdp/indexeddb/functions.py +232 -0
- parsek_cdp/cdp/indexeddb/types.py +120 -0
- parsek_cdp/cdp/input/__init__.py +15 -0
- parsek_cdp/cdp/input/events.py +25 -0
- parsek_cdp/cdp/input/functions.py +361 -0
- parsek_cdp/cdp/input/types.py +87 -0
- parsek_cdp/cdp/inspector/__init__.py +15 -0
- parsek_cdp/cdp/inspector/events.py +41 -0
- parsek_cdp/cdp/inspector/functions.py +27 -0
- parsek_cdp/cdp/inspector/types.py +10 -0
- parsek_cdp/cdp/io/__init__.py +15 -0
- parsek_cdp/cdp/io/events.py +13 -0
- parsek_cdp/cdp/io/functions.py +77 -0
- parsek_cdp/cdp/io/types.py +13 -0
- parsek_cdp/cdp/layertree/__init__.py +15 -0
- parsek_cdp/cdp/layertree/events.py +36 -0
- parsek_cdp/cdp/layertree/functions.py +178 -0
- parsek_cdp/cdp/layertree/types.py +104 -0
- parsek_cdp/cdp/log/__init__.py +15 -0
- parsek_cdp/cdp/log/events.py +22 -0
- parsek_cdp/cdp/log/functions.py +54 -0
- parsek_cdp/cdp/log/types.py +57 -0
- parsek_cdp/cdp/media/__init__.py +15 -0
- parsek_cdp/cdp/media/events.py +87 -0
- parsek_cdp/cdp/media/functions.py +27 -0
- parsek_cdp/cdp/media/types.py +101 -0
- parsek_cdp/cdp/memory/__init__.py +15 -0
- parsek_cdp/cdp/memory/events.py +13 -0
- parsek_cdp/cdp/memory/functions.py +164 -0
- parsek_cdp/cdp/memory/types.py +71 -0
- parsek_cdp/cdp/mixins/__init__.py +21 -0
- parsek_cdp/cdp/mixins/datatype.py +123 -0
- parsek_cdp/cdp/mixins/event.py +78 -0
- parsek_cdp/cdp/mixins/namespace.py +31 -0
- parsek_cdp/cdp/network/__init__.py +15 -0
- parsek_cdp/cdp/network/events.py +726 -0
- parsek_cdp/cdp/network/functions.py +734 -0
- parsek_cdp/cdp/network/types.py +1247 -0
- parsek_cdp/cdp/overlay/__init__.py +15 -0
- parsek_cdp/cdp/overlay/events.py +54 -0
- parsek_cdp/cdp/overlay/functions.py +407 -0
- parsek_cdp/cdp/overlay/types.py +328 -0
- parsek_cdp/cdp/page/__init__.py +15 -0
- parsek_cdp/cdp/page/events.py +416 -0
- parsek_cdp/cdp/page/functions.py +1081 -0
- parsek_cdp/cdp/page/types.py +1088 -0
- parsek_cdp/cdp/performance/__init__.py +15 -0
- parsek_cdp/cdp/performance/events.py +24 -0
- parsek_cdp/cdp/performance/functions.py +63 -0
- parsek_cdp/cdp/performance/types.py +22 -0
- parsek_cdp/cdp/performancetimeline/__init__.py +15 -0
- parsek_cdp/cdp/performancetimeline/events.py +22 -0
- parsek_cdp/cdp/performancetimeline/functions.py +30 -0
- parsek_cdp/cdp/performancetimeline/types.py +85 -0
- parsek_cdp/cdp/preload/__init__.py +15 -0
- parsek_cdp/cdp/preload/events.py +116 -0
- parsek_cdp/cdp/preload/functions.py +25 -0
- parsek_cdp/cdp/preload/types.py +267 -0
- parsek_cdp/cdp/profiler/__init__.py +15 -0
- parsek_cdp/cdp/profiler/events.py +64 -0
- parsek_cdp/cdp/profiler/functions.py +134 -0
- parsek_cdp/cdp/profiler/types.py +105 -0
- parsek_cdp/cdp/pwa/__init__.py +15 -0
- parsek_cdp/cdp/pwa/events.py +13 -0
- parsek_cdp/cdp/pwa/functions.py +196 -0
- parsek_cdp/cdp/pwa/types.py +45 -0
- parsek_cdp/cdp/runtime/__init__.py +15 -0
- parsek_cdp/cdp/runtime/events.py +123 -0
- parsek_cdp/cdp/runtime/functions.py +552 -0
- parsek_cdp/cdp/runtime/types.py +319 -0
- parsek_cdp/cdp/schema/__init__.py +15 -0
- parsek_cdp/cdp/schema/events.py +13 -0
- parsek_cdp/cdp/schema/functions.py +32 -0
- parsek_cdp/cdp/schema/types.py +22 -0
- parsek_cdp/cdp/security/__init__.py +15 -0
- parsek_cdp/cdp/security/events.py +64 -0
- parsek_cdp/cdp/security/functions.py +66 -0
- parsek_cdp/cdp/security/types.py +168 -0
- parsek_cdp/cdp/serviceworker/__init__.py +15 -0
- parsek_cdp/cdp/serviceworker/events.py +43 -0
- parsek_cdp/cdp/serviceworker/functions.py +115 -0
- parsek_cdp/cdp/serviceworker/types.py +95 -0
- parsek_cdp/cdp/storage/__init__.py +15 -0
- parsek_cdp/cdp/storage/events.py +288 -0
- parsek_cdp/cdp/storage/functions.py +571 -0
- parsek_cdp/cdp/storage/types.py +656 -0
- parsek_cdp/cdp/systeminfo/__init__.py +15 -0
- parsek_cdp/cdp/systeminfo/events.py +13 -0
- parsek_cdp/cdp/systeminfo/functions.py +75 -0
- parsek_cdp/cdp/systeminfo/types.py +132 -0
- parsek_cdp/cdp/target/__init__.py +15 -0
- parsek_cdp/cdp/target/events.py +109 -0
- parsek_cdp/cdp/target/functions.py +424 -0
- parsek_cdp/cdp/target/types.py +83 -0
- parsek_cdp/cdp/tethering/__init__.py +15 -0
- parsek_cdp/cdp/tethering/events.py +22 -0
- parsek_cdp/cdp/tethering/functions.py +35 -0
- parsek_cdp/cdp/tethering/types.py +10 -0
- parsek_cdp/cdp/tracing/__init__.py +15 -0
- parsek_cdp/cdp/tracing/events.py +61 -0
- parsek_cdp/cdp/tracing/functions.py +119 -0
- parsek_cdp/cdp/tracing/types.py +81 -0
- parsek_cdp/cdp/webaudio/__init__.py +15 -0
- parsek_cdp/cdp/webaudio/events.py +184 -0
- parsek_cdp/cdp/webaudio/functions.py +51 -0
- parsek_cdp/cdp/webaudio/types.py +155 -0
- parsek_cdp/cdp/webauthn/__init__.py +15 -0
- parsek_cdp/cdp/webauthn/events.py +69 -0
- parsek_cdp/cdp/webauthn/functions.py +214 -0
- parsek_cdp/cdp/webauthn/types.py +96 -0
- parsek_cdp/core/__init__.py +18 -0
- parsek_cdp/core/browser.py +240 -0
- parsek_cdp/core/browser_context.py +58 -0
- parsek_cdp/core/element.py +405 -0
- parsek_cdp/core/feature.py +376 -0
- parsek_cdp/core/frame.py +351 -0
- parsek_cdp/core/pagable.py +175 -0
- parsek_cdp/core/page.py +163 -0
- parsek_cdp/core/target.py +490 -0
- parsek_cdp/features/__init__.py +14 -0
- parsek_cdp/features/request_listener/__init__.py +256 -0
- parsek_cdp/features/request_listener/events.py +48 -0
- parsek_cdp/features/request_listener/types.py +235 -0
- parsek_cdp/generate.py +642 -0
- parsek_cdp/parsek/__init__.py +18 -0
- parsek_cdp/parsek/events.py +38 -0
- parsek_cdp/parsek/types.py +36 -0
- parsek_cdp/py.typed +0 -0
- parsek_cdp-0.1.0.dist-info/METADATA +277 -0
- parsek_cdp-0.1.0.dist-info/RECORD +242 -0
- parsek_cdp-0.1.0.dist-info/WHEEL +5 -0
- parsek_cdp-0.1.0.dist-info/licenses/LICENSE +201 -0
- parsek_cdp-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,788 @@
|
|
|
1
|
+
"""Commands for the CSS domain (generated)."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Literal, Optional
|
|
6
|
+
|
|
7
|
+
from ..mixins.datatype import DataType, FieldMeta, encode
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from .types import (
|
|
11
|
+
CSSAnimationStyle,
|
|
12
|
+
CSSAtRule,
|
|
13
|
+
CSSComputedStyleProperty,
|
|
14
|
+
CSSContainerQuery,
|
|
15
|
+
CSSFunctionRule,
|
|
16
|
+
CSSKeyframesRule,
|
|
17
|
+
CSSLayerData,
|
|
18
|
+
CSSMedia,
|
|
19
|
+
CSSPositionTryRule,
|
|
20
|
+
CSSProperty,
|
|
21
|
+
CSSPropertyRegistration,
|
|
22
|
+
CSSPropertyRule,
|
|
23
|
+
CSSRule,
|
|
24
|
+
CSSScope,
|
|
25
|
+
CSSStyle,
|
|
26
|
+
CSSSupports,
|
|
27
|
+
ComputedStyleExtraFields,
|
|
28
|
+
InheritedAnimatedStyleEntry,
|
|
29
|
+
InheritedPseudoElementMatches,
|
|
30
|
+
InheritedStyleEntry,
|
|
31
|
+
PlatformFontUsage,
|
|
32
|
+
PseudoElementMatches,
|
|
33
|
+
RuleMatch,
|
|
34
|
+
RuleUsage,
|
|
35
|
+
SelectorList,
|
|
36
|
+
SourceRange,
|
|
37
|
+
StyleDeclarationEdit,
|
|
38
|
+
Value,
|
|
39
|
+
)
|
|
40
|
+
from ..dom.types import NodeId as DOM_NodeId
|
|
41
|
+
from ..dom.types import PseudoType as DOM_PseudoType
|
|
42
|
+
from ..dom.types import StyleSheetId as DOM_StyleSheetId
|
|
43
|
+
from ..page.types import FrameId as Page_FrameId
|
|
44
|
+
|
|
45
|
+
@dataclass
|
|
46
|
+
class AddRuleReturn(DataType):
|
|
47
|
+
"""Return value of :meth:`CSS.add_rule`."""
|
|
48
|
+
rule: CSSRule
|
|
49
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
50
|
+
FieldMeta('rule', 'rule', False, 'object', ref='CSS.CSSRule'),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@dataclass
|
|
55
|
+
class CollectClassNamesReturn(DataType):
|
|
56
|
+
"""Return value of :meth:`CSS.collect_class_names`."""
|
|
57
|
+
class_names: List[str]
|
|
58
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
59
|
+
FieldMeta('class_names', 'classNames', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@dataclass
|
|
64
|
+
class CreateStyleSheetReturn(DataType):
|
|
65
|
+
"""Return value of :meth:`CSS.create_style_sheet`."""
|
|
66
|
+
style_sheet_id: DOM_StyleSheetId
|
|
67
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
68
|
+
FieldMeta('style_sheet_id', 'styleSheetId', False, 'primitive'),
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
@dataclass
|
|
73
|
+
class GetBackgroundColorsReturn(DataType):
|
|
74
|
+
"""Return value of :meth:`CSS.get_background_colors`."""
|
|
75
|
+
background_colors: Optional[List[str]] = None
|
|
76
|
+
computed_font_size: Optional[str] = None
|
|
77
|
+
computed_font_weight: Optional[str] = None
|
|
78
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
79
|
+
FieldMeta('background_colors', 'backgroundColors', True, 'array', inner=FieldMeta('', '', False, 'primitive')),
|
|
80
|
+
FieldMeta('computed_font_size', 'computedFontSize', True, 'primitive'),
|
|
81
|
+
FieldMeta('computed_font_weight', 'computedFontWeight', True, 'primitive'),
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
@dataclass
|
|
86
|
+
class GetComputedStyleForNodeReturn(DataType):
|
|
87
|
+
"""Return value of :meth:`CSS.get_computed_style_for_node`."""
|
|
88
|
+
computed_style: List[CSSComputedStyleProperty]
|
|
89
|
+
extra_fields: ComputedStyleExtraFields
|
|
90
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
91
|
+
FieldMeta('computed_style', 'computedStyle', False, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.CSSComputedStyleProperty')),
|
|
92
|
+
FieldMeta('extra_fields', 'extraFields', False, 'object', ref='CSS.ComputedStyleExtraFields'),
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
@dataclass
|
|
97
|
+
class ResolveValuesReturn(DataType):
|
|
98
|
+
"""Return value of :meth:`CSS.resolve_values`."""
|
|
99
|
+
results: List[str]
|
|
100
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
101
|
+
FieldMeta('results', 'results', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
@dataclass
|
|
106
|
+
class GetLonghandPropertiesReturn(DataType):
|
|
107
|
+
"""Return value of :meth:`CSS.get_longhand_properties`."""
|
|
108
|
+
longhand_properties: List[CSSProperty]
|
|
109
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
110
|
+
FieldMeta('longhand_properties', 'longhandProperties', False, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.CSSProperty')),
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
@dataclass
|
|
115
|
+
class GetInlineStylesForNodeReturn(DataType):
|
|
116
|
+
"""Return value of :meth:`CSS.get_inline_styles_for_node`."""
|
|
117
|
+
inline_style: Optional[CSSStyle] = None
|
|
118
|
+
attributes_style: Optional[CSSStyle] = None
|
|
119
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
120
|
+
FieldMeta('inline_style', 'inlineStyle', True, 'object', ref='CSS.CSSStyle'),
|
|
121
|
+
FieldMeta('attributes_style', 'attributesStyle', True, 'object', ref='CSS.CSSStyle'),
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
@dataclass
|
|
126
|
+
class GetAnimatedStylesForNodeReturn(DataType):
|
|
127
|
+
"""Return value of :meth:`CSS.get_animated_styles_for_node`."""
|
|
128
|
+
animation_styles: Optional[List[CSSAnimationStyle]] = None
|
|
129
|
+
transitions_style: Optional[CSSStyle] = None
|
|
130
|
+
inherited: Optional[List[InheritedAnimatedStyleEntry]] = None
|
|
131
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
132
|
+
FieldMeta('animation_styles', 'animationStyles', True, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.CSSAnimationStyle')),
|
|
133
|
+
FieldMeta('transitions_style', 'transitionsStyle', True, 'object', ref='CSS.CSSStyle'),
|
|
134
|
+
FieldMeta('inherited', 'inherited', True, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.InheritedAnimatedStyleEntry')),
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
@dataclass
|
|
139
|
+
class GetMatchedStylesForNodeReturn(DataType):
|
|
140
|
+
"""Return value of :meth:`CSS.get_matched_styles_for_node`."""
|
|
141
|
+
inline_style: Optional[CSSStyle] = None
|
|
142
|
+
attributes_style: Optional[CSSStyle] = None
|
|
143
|
+
matched_css_rules: Optional[List[RuleMatch]] = None
|
|
144
|
+
pseudo_elements: Optional[List[PseudoElementMatches]] = None
|
|
145
|
+
inherited: Optional[List[InheritedStyleEntry]] = None
|
|
146
|
+
inherited_pseudo_elements: Optional[List[InheritedPseudoElementMatches]] = None
|
|
147
|
+
css_keyframes_rules: Optional[List[CSSKeyframesRule]] = None
|
|
148
|
+
css_position_try_rules: Optional[List[CSSPositionTryRule]] = None
|
|
149
|
+
active_position_fallback_index: Optional[int] = None
|
|
150
|
+
css_property_rules: Optional[List[CSSPropertyRule]] = None
|
|
151
|
+
css_property_registrations: Optional[List[CSSPropertyRegistration]] = None
|
|
152
|
+
css_at_rules: Optional[List[CSSAtRule]] = None
|
|
153
|
+
parent_layout_node_id: Optional[DOM_NodeId] = None
|
|
154
|
+
css_function_rules: Optional[List[CSSFunctionRule]] = None
|
|
155
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
156
|
+
FieldMeta('inline_style', 'inlineStyle', True, 'object', ref='CSS.CSSStyle'),
|
|
157
|
+
FieldMeta('attributes_style', 'attributesStyle', True, 'object', ref='CSS.CSSStyle'),
|
|
158
|
+
FieldMeta('matched_css_rules', 'matchedCSSRules', True, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.RuleMatch')),
|
|
159
|
+
FieldMeta('pseudo_elements', 'pseudoElements', True, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.PseudoElementMatches')),
|
|
160
|
+
FieldMeta('inherited', 'inherited', True, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.InheritedStyleEntry')),
|
|
161
|
+
FieldMeta('inherited_pseudo_elements', 'inheritedPseudoElements', True, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.InheritedPseudoElementMatches')),
|
|
162
|
+
FieldMeta('css_keyframes_rules', 'cssKeyframesRules', True, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.CSSKeyframesRule')),
|
|
163
|
+
FieldMeta('css_position_try_rules', 'cssPositionTryRules', True, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.CSSPositionTryRule')),
|
|
164
|
+
FieldMeta('active_position_fallback_index', 'activePositionFallbackIndex', True, 'primitive'),
|
|
165
|
+
FieldMeta('css_property_rules', 'cssPropertyRules', True, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.CSSPropertyRule')),
|
|
166
|
+
FieldMeta('css_property_registrations', 'cssPropertyRegistrations', True, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.CSSPropertyRegistration')),
|
|
167
|
+
FieldMeta('css_at_rules', 'cssAtRules', True, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.CSSAtRule')),
|
|
168
|
+
FieldMeta('parent_layout_node_id', 'parentLayoutNodeId', True, 'primitive'),
|
|
169
|
+
FieldMeta('css_function_rules', 'cssFunctionRules', True, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.CSSFunctionRule')),
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
@dataclass
|
|
174
|
+
class GetEnvironmentVariablesReturn(DataType):
|
|
175
|
+
"""Return value of :meth:`CSS.get_environment_variables`."""
|
|
176
|
+
environment_variables: Dict[str, Any]
|
|
177
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
178
|
+
FieldMeta('environment_variables', 'environmentVariables', False, 'primitive'),
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
@dataclass
|
|
183
|
+
class GetMediaQueriesReturn(DataType):
|
|
184
|
+
"""Return value of :meth:`CSS.get_media_queries`."""
|
|
185
|
+
medias: List[CSSMedia]
|
|
186
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
187
|
+
FieldMeta('medias', 'medias', False, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.CSSMedia')),
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
@dataclass
|
|
192
|
+
class GetPlatformFontsForNodeReturn(DataType):
|
|
193
|
+
"""Return value of :meth:`CSS.get_platform_fonts_for_node`."""
|
|
194
|
+
fonts: List[PlatformFontUsage]
|
|
195
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
196
|
+
FieldMeta('fonts', 'fonts', False, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.PlatformFontUsage')),
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
@dataclass
|
|
201
|
+
class GetStyleSheetTextReturn(DataType):
|
|
202
|
+
"""Return value of :meth:`CSS.get_style_sheet_text`."""
|
|
203
|
+
text: str
|
|
204
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
205
|
+
FieldMeta('text', 'text', False, 'primitive'),
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
@dataclass
|
|
210
|
+
class GetLayersForNodeReturn(DataType):
|
|
211
|
+
"""Return value of :meth:`CSS.get_layers_for_node`."""
|
|
212
|
+
root_layer: CSSLayerData
|
|
213
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
214
|
+
FieldMeta('root_layer', 'rootLayer', False, 'object', ref='CSS.CSSLayerData'),
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
@dataclass
|
|
219
|
+
class GetLocationForSelectorReturn(DataType):
|
|
220
|
+
"""Return value of :meth:`CSS.get_location_for_selector`."""
|
|
221
|
+
ranges: List[SourceRange]
|
|
222
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
223
|
+
FieldMeta('ranges', 'ranges', False, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.SourceRange')),
|
|
224
|
+
)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
@dataclass
|
|
228
|
+
class TakeComputedStyleUpdatesReturn(DataType):
|
|
229
|
+
"""Return value of :meth:`CSS.take_computed_style_updates`."""
|
|
230
|
+
node_ids: List[DOM_NodeId]
|
|
231
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
232
|
+
FieldMeta('node_ids', 'nodeIds', False, 'array', inner=FieldMeta('', '', False, 'primitive')),
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
@dataclass
|
|
237
|
+
class SetPropertyRulePropertyNameReturn(DataType):
|
|
238
|
+
"""Return value of :meth:`CSS.set_property_rule_property_name`."""
|
|
239
|
+
property_name: Value
|
|
240
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
241
|
+
FieldMeta('property_name', 'propertyName', False, 'object', ref='CSS.Value'),
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
@dataclass
|
|
246
|
+
class SetKeyframeKeyReturn(DataType):
|
|
247
|
+
"""Return value of :meth:`CSS.set_keyframe_key`."""
|
|
248
|
+
key_text: Value
|
|
249
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
250
|
+
FieldMeta('key_text', 'keyText', False, 'object', ref='CSS.Value'),
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
@dataclass
|
|
255
|
+
class SetMediaTextReturn(DataType):
|
|
256
|
+
"""Return value of :meth:`CSS.set_media_text`."""
|
|
257
|
+
media: CSSMedia
|
|
258
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
259
|
+
FieldMeta('media', 'media', False, 'object', ref='CSS.CSSMedia'),
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
@dataclass
|
|
264
|
+
class SetContainerQueryTextReturn(DataType):
|
|
265
|
+
"""Return value of :meth:`CSS.set_container_query_text`."""
|
|
266
|
+
container_query: CSSContainerQuery
|
|
267
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
268
|
+
FieldMeta('container_query', 'containerQuery', False, 'object', ref='CSS.CSSContainerQuery'),
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
@dataclass
|
|
273
|
+
class SetSupportsTextReturn(DataType):
|
|
274
|
+
"""Return value of :meth:`CSS.set_supports_text`."""
|
|
275
|
+
supports: CSSSupports
|
|
276
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
277
|
+
FieldMeta('supports', 'supports', False, 'object', ref='CSS.CSSSupports'),
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
@dataclass
|
|
282
|
+
class SetScopeTextReturn(DataType):
|
|
283
|
+
"""Return value of :meth:`CSS.set_scope_text`."""
|
|
284
|
+
scope: CSSScope
|
|
285
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
286
|
+
FieldMeta('scope', 'scope', False, 'object', ref='CSS.CSSScope'),
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
@dataclass
|
|
291
|
+
class SetRuleSelectorReturn(DataType):
|
|
292
|
+
"""Return value of :meth:`CSS.set_rule_selector`."""
|
|
293
|
+
selector_list: SelectorList
|
|
294
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
295
|
+
FieldMeta('selector_list', 'selectorList', False, 'object', ref='CSS.SelectorList'),
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
@dataclass
|
|
300
|
+
class SetStyleSheetTextReturn(DataType):
|
|
301
|
+
"""Return value of :meth:`CSS.set_style_sheet_text`."""
|
|
302
|
+
source_map_url: Optional[str] = None
|
|
303
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
304
|
+
FieldMeta('source_map_url', 'sourceMapURL', True, 'primitive'),
|
|
305
|
+
)
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
@dataclass
|
|
309
|
+
class SetStyleTextsReturn(DataType):
|
|
310
|
+
"""Return value of :meth:`CSS.set_style_texts`."""
|
|
311
|
+
styles: List[CSSStyle]
|
|
312
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
313
|
+
FieldMeta('styles', 'styles', False, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.CSSStyle')),
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
@dataclass
|
|
318
|
+
class StopRuleUsageTrackingReturn(DataType):
|
|
319
|
+
"""Return value of :meth:`CSS.stop_rule_usage_tracking`."""
|
|
320
|
+
rule_usage: List[RuleUsage]
|
|
321
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
322
|
+
FieldMeta('rule_usage', 'ruleUsage', False, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.RuleUsage')),
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
@dataclass
|
|
327
|
+
class TakeCoverageDeltaReturn(DataType):
|
|
328
|
+
"""Return value of :meth:`CSS.take_coverage_delta`."""
|
|
329
|
+
coverage: List[RuleUsage]
|
|
330
|
+
timestamp: float
|
|
331
|
+
__FIELDS__: ClassVar[tuple] = (
|
|
332
|
+
FieldMeta('coverage', 'coverage', False, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.RuleUsage')),
|
|
333
|
+
FieldMeta('timestamp', 'timestamp', False, 'primitive'),
|
|
334
|
+
)
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
class CSS:
|
|
338
|
+
"""Commands of the CSS domain, bound to a target."""
|
|
339
|
+
|
|
340
|
+
def __init__(self, target: Any) -> None:
|
|
341
|
+
self._target = target
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
async def add_rule(self, *, style_sheet_id: DOM_StyleSheetId, rule_text: str, location: SourceRange, node_for_property_syntax_validation: Optional[DOM_NodeId] = None) -> AddRuleReturn:
|
|
345
|
+
"""
|
|
346
|
+
Inserts a new rule with the given `ruleText` in a stylesheet with given `styleSheetId`, at the
|
|
347
|
+
position specified by `location`.
|
|
348
|
+
:param style_sheet_id: The css style sheet identifier where a new rule should be inserted.
|
|
349
|
+
:param rule_text: The text of a new rule.
|
|
350
|
+
:param location: Text position of a new rule in the target style sheet.
|
|
351
|
+
:param node_for_property_syntax_validation: NodeId for the DOM node in whose context custom property declarations for registered properties should be
|
|
352
|
+
validated. If omitted, declarations in the new rule text can only be validated statically, which may produce
|
|
353
|
+
incorrect results if the declaration contains a var() for example.
|
|
354
|
+
"""
|
|
355
|
+
_params: Dict[str, Any] = {}
|
|
356
|
+
_params['styleSheetId'] = encode(FieldMeta('', '', False, 'primitive'), style_sheet_id)
|
|
357
|
+
_params['ruleText'] = encode(FieldMeta('', '', False, 'primitive'), rule_text)
|
|
358
|
+
_params['location'] = encode(FieldMeta('', '', False, 'object', ref='CSS.SourceRange'), location)
|
|
359
|
+
if node_for_property_syntax_validation is not None:
|
|
360
|
+
_params['nodeForPropertySyntaxValidation'] = encode(FieldMeta('', '', False, 'primitive'), node_for_property_syntax_validation)
|
|
361
|
+
_result = await self._target.send('CSS.addRule', _params)
|
|
362
|
+
return AddRuleReturn.from_json(_result)
|
|
363
|
+
|
|
364
|
+
async def collect_class_names(self, *, style_sheet_id: DOM_StyleSheetId) -> CollectClassNamesReturn:
|
|
365
|
+
"""
|
|
366
|
+
Returns all class names from specified stylesheet.
|
|
367
|
+
:param style_sheet_id:
|
|
368
|
+
"""
|
|
369
|
+
_params: Dict[str, Any] = {}
|
|
370
|
+
_params['styleSheetId'] = encode(FieldMeta('', '', False, 'primitive'), style_sheet_id)
|
|
371
|
+
_result = await self._target.send('CSS.collectClassNames', _params)
|
|
372
|
+
return CollectClassNamesReturn.from_json(_result)
|
|
373
|
+
|
|
374
|
+
async def create_style_sheet(self, *, frame_id: Page_FrameId, force: Optional[bool] = None) -> CreateStyleSheetReturn:
|
|
375
|
+
"""
|
|
376
|
+
Creates a new special "via-inspector" stylesheet in the frame with given `frameId`.
|
|
377
|
+
:param frame_id: Identifier of the frame where "via-inspector" stylesheet should be created.
|
|
378
|
+
:param force: If true, creates a new stylesheet for every call. If false,
|
|
379
|
+
returns a stylesheet previously created by a call with force=false
|
|
380
|
+
for the frame's document if it exists or creates a new stylesheet
|
|
381
|
+
(default: false).
|
|
382
|
+
"""
|
|
383
|
+
_params: Dict[str, Any] = {}
|
|
384
|
+
_params['frameId'] = encode(FieldMeta('', '', False, 'primitive'), frame_id)
|
|
385
|
+
if force is not None:
|
|
386
|
+
_params['force'] = encode(FieldMeta('', '', False, 'primitive'), force)
|
|
387
|
+
_result = await self._target.send('CSS.createStyleSheet', _params)
|
|
388
|
+
return CreateStyleSheetReturn.from_json(_result)
|
|
389
|
+
|
|
390
|
+
async def disable(self) -> None:
|
|
391
|
+
"""Disables the CSS agent for the given page."""
|
|
392
|
+
_params: Dict[str, Any] = {}
|
|
393
|
+
_result = await self._target.send('CSS.disable', _params)
|
|
394
|
+
return None
|
|
395
|
+
|
|
396
|
+
async def enable(self) -> None:
|
|
397
|
+
"""
|
|
398
|
+
Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been
|
|
399
|
+
enabled until the result of this command is received.
|
|
400
|
+
"""
|
|
401
|
+
_params: Dict[str, Any] = {}
|
|
402
|
+
_result = await self._target.send('CSS.enable', _params)
|
|
403
|
+
return None
|
|
404
|
+
|
|
405
|
+
async def force_pseudo_state(self, *, node_id: DOM_NodeId, forced_pseudo_classes: List[str]) -> None:
|
|
406
|
+
"""
|
|
407
|
+
Ensures that the given node will have specified pseudo-classes whenever its style is computed by
|
|
408
|
+
the browser.
|
|
409
|
+
:param node_id: The element id for which to force the pseudo state.
|
|
410
|
+
:param forced_pseudo_classes: Element pseudo classes to force when computing the element's style.
|
|
411
|
+
"""
|
|
412
|
+
_params: Dict[str, Any] = {}
|
|
413
|
+
_params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
|
|
414
|
+
_params['forcedPseudoClasses'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'primitive')), forced_pseudo_classes)
|
|
415
|
+
_result = await self._target.send('CSS.forcePseudoState', _params)
|
|
416
|
+
return None
|
|
417
|
+
|
|
418
|
+
async def force_starting_style(self, *, node_id: DOM_NodeId, forced: bool) -> None:
|
|
419
|
+
"""
|
|
420
|
+
Ensures that the given node is in its starting-style state.
|
|
421
|
+
:param node_id: The element id for which to force the starting-style state.
|
|
422
|
+
:param forced: Boolean indicating if this is on or off.
|
|
423
|
+
"""
|
|
424
|
+
_params: Dict[str, Any] = {}
|
|
425
|
+
_params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
|
|
426
|
+
_params['forced'] = encode(FieldMeta('', '', False, 'primitive'), forced)
|
|
427
|
+
_result = await self._target.send('CSS.forceStartingStyle', _params)
|
|
428
|
+
return None
|
|
429
|
+
|
|
430
|
+
async def get_background_colors(self, *, node_id: DOM_NodeId) -> GetBackgroundColorsReturn:
|
|
431
|
+
""":param node_id: Id of the node to get background colors for."""
|
|
432
|
+
_params: Dict[str, Any] = {}
|
|
433
|
+
_params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
|
|
434
|
+
_result = await self._target.send('CSS.getBackgroundColors', _params)
|
|
435
|
+
return GetBackgroundColorsReturn.from_json(_result)
|
|
436
|
+
|
|
437
|
+
async def get_computed_style_for_node(self, *, node_id: DOM_NodeId) -> GetComputedStyleForNodeReturn:
|
|
438
|
+
"""
|
|
439
|
+
Returns the computed style for a DOM node identified by `nodeId`.
|
|
440
|
+
:param node_id:
|
|
441
|
+
"""
|
|
442
|
+
_params: Dict[str, Any] = {}
|
|
443
|
+
_params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
|
|
444
|
+
_result = await self._target.send('CSS.getComputedStyleForNode', _params)
|
|
445
|
+
return GetComputedStyleForNodeReturn.from_json(_result)
|
|
446
|
+
|
|
447
|
+
async def resolve_values(self, *, values: List[str], node_id: DOM_NodeId, property_name: Optional[str] = None, pseudo_type: Optional[DOM_PseudoType] = None, pseudo_identifier: Optional[str] = None) -> ResolveValuesReturn:
|
|
448
|
+
"""
|
|
449
|
+
Resolve the specified values in the context of the provided element.
|
|
450
|
+
For example, a value of '1em' is evaluated according to the computed
|
|
451
|
+
'font-size' of the element and a value 'calc(1px + 2px)' will be
|
|
452
|
+
resolved to '3px'.
|
|
453
|
+
If the `propertyName` was specified the `values` are resolved as if
|
|
454
|
+
they were property's declaration. If a value cannot be parsed according
|
|
455
|
+
to the provided property syntax, the value is parsed using combined
|
|
456
|
+
syntax as if null `propertyName` was provided. If the value cannot be
|
|
457
|
+
resolved even then, return the provided value without any changes.
|
|
458
|
+
:param values: Cascade-dependent keywords (revert/revert-layer) do not work.
|
|
459
|
+
:param node_id: Id of the node in whose context the expression is evaluated
|
|
460
|
+
:param property_name: Only longhands and custom property names are accepted.
|
|
461
|
+
:param pseudo_type: Pseudo element type, only works for pseudo elements that generate
|
|
462
|
+
elements in the tree, such as ::before and ::after.
|
|
463
|
+
:param pseudo_identifier: Pseudo element custom ident.
|
|
464
|
+
"""
|
|
465
|
+
_params: Dict[str, Any] = {}
|
|
466
|
+
_params['values'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'primitive')), values)
|
|
467
|
+
_params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
|
|
468
|
+
if property_name is not None:
|
|
469
|
+
_params['propertyName'] = encode(FieldMeta('', '', False, 'primitive'), property_name)
|
|
470
|
+
if pseudo_type is not None:
|
|
471
|
+
_params['pseudoType'] = encode(FieldMeta('', '', False, 'enum', ref='DOM.PseudoType'), pseudo_type)
|
|
472
|
+
if pseudo_identifier is not None:
|
|
473
|
+
_params['pseudoIdentifier'] = encode(FieldMeta('', '', False, 'primitive'), pseudo_identifier)
|
|
474
|
+
_result = await self._target.send('CSS.resolveValues', _params)
|
|
475
|
+
return ResolveValuesReturn.from_json(_result)
|
|
476
|
+
|
|
477
|
+
async def get_longhand_properties(self, *, shorthand_name: str, value: str) -> GetLonghandPropertiesReturn:
|
|
478
|
+
"""
|
|
479
|
+
:param shorthand_name:
|
|
480
|
+
:param value:
|
|
481
|
+
"""
|
|
482
|
+
_params: Dict[str, Any] = {}
|
|
483
|
+
_params['shorthandName'] = encode(FieldMeta('', '', False, 'primitive'), shorthand_name)
|
|
484
|
+
_params['value'] = encode(FieldMeta('', '', False, 'primitive'), value)
|
|
485
|
+
_result = await self._target.send('CSS.getLonghandProperties', _params)
|
|
486
|
+
return GetLonghandPropertiesReturn.from_json(_result)
|
|
487
|
+
|
|
488
|
+
async def get_inline_styles_for_node(self, *, node_id: DOM_NodeId) -> GetInlineStylesForNodeReturn:
|
|
489
|
+
"""
|
|
490
|
+
Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM
|
|
491
|
+
attributes) for a DOM node identified by `nodeId`.
|
|
492
|
+
:param node_id:
|
|
493
|
+
"""
|
|
494
|
+
_params: Dict[str, Any] = {}
|
|
495
|
+
_params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
|
|
496
|
+
_result = await self._target.send('CSS.getInlineStylesForNode', _params)
|
|
497
|
+
return GetInlineStylesForNodeReturn.from_json(_result)
|
|
498
|
+
|
|
499
|
+
async def get_animated_styles_for_node(self, *, node_id: DOM_NodeId) -> GetAnimatedStylesForNodeReturn:
|
|
500
|
+
"""
|
|
501
|
+
Returns the styles coming from animations & transitions
|
|
502
|
+
including the animation & transition styles coming from inheritance chain.
|
|
503
|
+
:param node_id:
|
|
504
|
+
"""
|
|
505
|
+
_params: Dict[str, Any] = {}
|
|
506
|
+
_params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
|
|
507
|
+
_result = await self._target.send('CSS.getAnimatedStylesForNode', _params)
|
|
508
|
+
return GetAnimatedStylesForNodeReturn.from_json(_result)
|
|
509
|
+
|
|
510
|
+
async def get_matched_styles_for_node(self, *, node_id: DOM_NodeId) -> GetMatchedStylesForNodeReturn:
|
|
511
|
+
"""
|
|
512
|
+
Returns requested styles for a DOM node identified by `nodeId`.
|
|
513
|
+
:param node_id:
|
|
514
|
+
"""
|
|
515
|
+
_params: Dict[str, Any] = {}
|
|
516
|
+
_params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
|
|
517
|
+
_result = await self._target.send('CSS.getMatchedStylesForNode', _params)
|
|
518
|
+
return GetMatchedStylesForNodeReturn.from_json(_result)
|
|
519
|
+
|
|
520
|
+
async def get_environment_variables(self) -> GetEnvironmentVariablesReturn:
|
|
521
|
+
"""Returns the values of the default UA-defined environment variables used in env()"""
|
|
522
|
+
_params: Dict[str, Any] = {}
|
|
523
|
+
_result = await self._target.send('CSS.getEnvironmentVariables', _params)
|
|
524
|
+
return GetEnvironmentVariablesReturn.from_json(_result)
|
|
525
|
+
|
|
526
|
+
async def get_media_queries(self) -> GetMediaQueriesReturn:
|
|
527
|
+
"""Returns all media queries parsed by the rendering engine."""
|
|
528
|
+
_params: Dict[str, Any] = {}
|
|
529
|
+
_result = await self._target.send('CSS.getMediaQueries', _params)
|
|
530
|
+
return GetMediaQueriesReturn.from_json(_result)
|
|
531
|
+
|
|
532
|
+
async def get_platform_fonts_for_node(self, *, node_id: DOM_NodeId) -> GetPlatformFontsForNodeReturn:
|
|
533
|
+
"""
|
|
534
|
+
Requests information about platform fonts which we used to render child TextNodes in the given
|
|
535
|
+
node.
|
|
536
|
+
:param node_id:
|
|
537
|
+
"""
|
|
538
|
+
_params: Dict[str, Any] = {}
|
|
539
|
+
_params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
|
|
540
|
+
_result = await self._target.send('CSS.getPlatformFontsForNode', _params)
|
|
541
|
+
return GetPlatformFontsForNodeReturn.from_json(_result)
|
|
542
|
+
|
|
543
|
+
async def get_style_sheet_text(self, *, style_sheet_id: DOM_StyleSheetId) -> GetStyleSheetTextReturn:
|
|
544
|
+
"""
|
|
545
|
+
Returns the current textual content for a stylesheet.
|
|
546
|
+
:param style_sheet_id:
|
|
547
|
+
"""
|
|
548
|
+
_params: Dict[str, Any] = {}
|
|
549
|
+
_params['styleSheetId'] = encode(FieldMeta('', '', False, 'primitive'), style_sheet_id)
|
|
550
|
+
_result = await self._target.send('CSS.getStyleSheetText', _params)
|
|
551
|
+
return GetStyleSheetTextReturn.from_json(_result)
|
|
552
|
+
|
|
553
|
+
async def get_layers_for_node(self, *, node_id: DOM_NodeId) -> GetLayersForNodeReturn:
|
|
554
|
+
"""
|
|
555
|
+
Returns all layers parsed by the rendering engine for the tree scope of a node.
|
|
556
|
+
Given a DOM element identified by nodeId, getLayersForNode returns the root
|
|
557
|
+
layer for the nearest ancestor document or shadow root. The layer root contains
|
|
558
|
+
the full layer tree for the tree scope and their ordering.
|
|
559
|
+
:param node_id:
|
|
560
|
+
"""
|
|
561
|
+
_params: Dict[str, Any] = {}
|
|
562
|
+
_params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
|
|
563
|
+
_result = await self._target.send('CSS.getLayersForNode', _params)
|
|
564
|
+
return GetLayersForNodeReturn.from_json(_result)
|
|
565
|
+
|
|
566
|
+
async def get_location_for_selector(self, *, style_sheet_id: DOM_StyleSheetId, selector_text: str) -> GetLocationForSelectorReturn:
|
|
567
|
+
"""
|
|
568
|
+
Given a CSS selector text and a style sheet ID, getLocationForSelector
|
|
569
|
+
returns an array of locations of the CSS selector in the style sheet.
|
|
570
|
+
:param style_sheet_id:
|
|
571
|
+
:param selector_text:
|
|
572
|
+
"""
|
|
573
|
+
_params: Dict[str, Any] = {}
|
|
574
|
+
_params['styleSheetId'] = encode(FieldMeta('', '', False, 'primitive'), style_sheet_id)
|
|
575
|
+
_params['selectorText'] = encode(FieldMeta('', '', False, 'primitive'), selector_text)
|
|
576
|
+
_result = await self._target.send('CSS.getLocationForSelector', _params)
|
|
577
|
+
return GetLocationForSelectorReturn.from_json(_result)
|
|
578
|
+
|
|
579
|
+
async def track_computed_style_updates_for_node(self, *, node_id: Optional[DOM_NodeId] = None) -> None:
|
|
580
|
+
"""
|
|
581
|
+
Starts tracking the given node for the computed style updates
|
|
582
|
+
and whenever the computed style is updated for node, it queues
|
|
583
|
+
a `computedStyleUpdated` event with throttling.
|
|
584
|
+
There can only be 1 node tracked for computed style updates
|
|
585
|
+
so passing a new node id removes tracking from the previous node.
|
|
586
|
+
Pass `undefined` to disable tracking.
|
|
587
|
+
:param node_id:
|
|
588
|
+
"""
|
|
589
|
+
_params: Dict[str, Any] = {}
|
|
590
|
+
if node_id is not None:
|
|
591
|
+
_params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
|
|
592
|
+
_result = await self._target.send('CSS.trackComputedStyleUpdatesForNode', _params)
|
|
593
|
+
return None
|
|
594
|
+
|
|
595
|
+
async def track_computed_style_updates(self, *, properties_to_track: List[CSSComputedStyleProperty]) -> None:
|
|
596
|
+
"""
|
|
597
|
+
Starts tracking the given computed styles for updates. The specified array of properties
|
|
598
|
+
replaces the one previously specified. Pass empty array to disable tracking.
|
|
599
|
+
Use takeComputedStyleUpdates to retrieve the list of nodes that had properties modified.
|
|
600
|
+
The changes to computed style properties are only tracked for nodes pushed to the front-end
|
|
601
|
+
by the DOM agent. If no changes to the tracked properties occur after the node has been pushed
|
|
602
|
+
to the front-end, no updates will be issued for the node.
|
|
603
|
+
:param properties_to_track:
|
|
604
|
+
"""
|
|
605
|
+
_params: Dict[str, Any] = {}
|
|
606
|
+
_params['propertiesToTrack'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.CSSComputedStyleProperty')), properties_to_track)
|
|
607
|
+
_result = await self._target.send('CSS.trackComputedStyleUpdates', _params)
|
|
608
|
+
return None
|
|
609
|
+
|
|
610
|
+
async def take_computed_style_updates(self) -> TakeComputedStyleUpdatesReturn:
|
|
611
|
+
"""Polls the next batch of computed style updates."""
|
|
612
|
+
_params: Dict[str, Any] = {}
|
|
613
|
+
_result = await self._target.send('CSS.takeComputedStyleUpdates', _params)
|
|
614
|
+
return TakeComputedStyleUpdatesReturn.from_json(_result)
|
|
615
|
+
|
|
616
|
+
async def set_effective_property_value_for_node(self, *, node_id: DOM_NodeId, property_name: str, value: str) -> None:
|
|
617
|
+
"""
|
|
618
|
+
Find a rule with the given active property for the given node and set the new value for this
|
|
619
|
+
property
|
|
620
|
+
:param node_id: The element id for which to set property.
|
|
621
|
+
:param property_name:
|
|
622
|
+
:param value:
|
|
623
|
+
"""
|
|
624
|
+
_params: Dict[str, Any] = {}
|
|
625
|
+
_params['nodeId'] = encode(FieldMeta('', '', False, 'primitive'), node_id)
|
|
626
|
+
_params['propertyName'] = encode(FieldMeta('', '', False, 'primitive'), property_name)
|
|
627
|
+
_params['value'] = encode(FieldMeta('', '', False, 'primitive'), value)
|
|
628
|
+
_result = await self._target.send('CSS.setEffectivePropertyValueForNode', _params)
|
|
629
|
+
return None
|
|
630
|
+
|
|
631
|
+
async def set_property_rule_property_name(self, *, style_sheet_id: DOM_StyleSheetId, range: SourceRange, property_name: str) -> SetPropertyRulePropertyNameReturn:
|
|
632
|
+
"""
|
|
633
|
+
Modifies the property rule property name.
|
|
634
|
+
:param style_sheet_id:
|
|
635
|
+
:param range:
|
|
636
|
+
:param property_name:
|
|
637
|
+
"""
|
|
638
|
+
_params: Dict[str, Any] = {}
|
|
639
|
+
_params['styleSheetId'] = encode(FieldMeta('', '', False, 'primitive'), style_sheet_id)
|
|
640
|
+
_params['range'] = encode(FieldMeta('', '', False, 'object', ref='CSS.SourceRange'), range)
|
|
641
|
+
_params['propertyName'] = encode(FieldMeta('', '', False, 'primitive'), property_name)
|
|
642
|
+
_result = await self._target.send('CSS.setPropertyRulePropertyName', _params)
|
|
643
|
+
return SetPropertyRulePropertyNameReturn.from_json(_result)
|
|
644
|
+
|
|
645
|
+
async def set_keyframe_key(self, *, style_sheet_id: DOM_StyleSheetId, range: SourceRange, key_text: str) -> SetKeyframeKeyReturn:
|
|
646
|
+
"""
|
|
647
|
+
Modifies the keyframe rule key text.
|
|
648
|
+
:param style_sheet_id:
|
|
649
|
+
:param range:
|
|
650
|
+
:param key_text:
|
|
651
|
+
"""
|
|
652
|
+
_params: Dict[str, Any] = {}
|
|
653
|
+
_params['styleSheetId'] = encode(FieldMeta('', '', False, 'primitive'), style_sheet_id)
|
|
654
|
+
_params['range'] = encode(FieldMeta('', '', False, 'object', ref='CSS.SourceRange'), range)
|
|
655
|
+
_params['keyText'] = encode(FieldMeta('', '', False, 'primitive'), key_text)
|
|
656
|
+
_result = await self._target.send('CSS.setKeyframeKey', _params)
|
|
657
|
+
return SetKeyframeKeyReturn.from_json(_result)
|
|
658
|
+
|
|
659
|
+
async def set_media_text(self, *, style_sheet_id: DOM_StyleSheetId, range: SourceRange, text: str) -> SetMediaTextReturn:
|
|
660
|
+
"""
|
|
661
|
+
Modifies the rule selector.
|
|
662
|
+
:param style_sheet_id:
|
|
663
|
+
:param range:
|
|
664
|
+
:param text:
|
|
665
|
+
"""
|
|
666
|
+
_params: Dict[str, Any] = {}
|
|
667
|
+
_params['styleSheetId'] = encode(FieldMeta('', '', False, 'primitive'), style_sheet_id)
|
|
668
|
+
_params['range'] = encode(FieldMeta('', '', False, 'object', ref='CSS.SourceRange'), range)
|
|
669
|
+
_params['text'] = encode(FieldMeta('', '', False, 'primitive'), text)
|
|
670
|
+
_result = await self._target.send('CSS.setMediaText', _params)
|
|
671
|
+
return SetMediaTextReturn.from_json(_result)
|
|
672
|
+
|
|
673
|
+
async def set_container_query_text(self, *, style_sheet_id: DOM_StyleSheetId, range: SourceRange, text: str) -> SetContainerQueryTextReturn:
|
|
674
|
+
"""
|
|
675
|
+
Modifies the expression of a container query.
|
|
676
|
+
:param style_sheet_id:
|
|
677
|
+
:param range:
|
|
678
|
+
:param text:
|
|
679
|
+
"""
|
|
680
|
+
_params: Dict[str, Any] = {}
|
|
681
|
+
_params['styleSheetId'] = encode(FieldMeta('', '', False, 'primitive'), style_sheet_id)
|
|
682
|
+
_params['range'] = encode(FieldMeta('', '', False, 'object', ref='CSS.SourceRange'), range)
|
|
683
|
+
_params['text'] = encode(FieldMeta('', '', False, 'primitive'), text)
|
|
684
|
+
_result = await self._target.send('CSS.setContainerQueryText', _params)
|
|
685
|
+
return SetContainerQueryTextReturn.from_json(_result)
|
|
686
|
+
|
|
687
|
+
async def set_supports_text(self, *, style_sheet_id: DOM_StyleSheetId, range: SourceRange, text: str) -> SetSupportsTextReturn:
|
|
688
|
+
"""
|
|
689
|
+
Modifies the expression of a supports at-rule.
|
|
690
|
+
:param style_sheet_id:
|
|
691
|
+
:param range:
|
|
692
|
+
:param text:
|
|
693
|
+
"""
|
|
694
|
+
_params: Dict[str, Any] = {}
|
|
695
|
+
_params['styleSheetId'] = encode(FieldMeta('', '', False, 'primitive'), style_sheet_id)
|
|
696
|
+
_params['range'] = encode(FieldMeta('', '', False, 'object', ref='CSS.SourceRange'), range)
|
|
697
|
+
_params['text'] = encode(FieldMeta('', '', False, 'primitive'), text)
|
|
698
|
+
_result = await self._target.send('CSS.setSupportsText', _params)
|
|
699
|
+
return SetSupportsTextReturn.from_json(_result)
|
|
700
|
+
|
|
701
|
+
async def set_scope_text(self, *, style_sheet_id: DOM_StyleSheetId, range: SourceRange, text: str) -> SetScopeTextReturn:
|
|
702
|
+
"""
|
|
703
|
+
Modifies the expression of a scope at-rule.
|
|
704
|
+
:param style_sheet_id:
|
|
705
|
+
:param range:
|
|
706
|
+
:param text:
|
|
707
|
+
"""
|
|
708
|
+
_params: Dict[str, Any] = {}
|
|
709
|
+
_params['styleSheetId'] = encode(FieldMeta('', '', False, 'primitive'), style_sheet_id)
|
|
710
|
+
_params['range'] = encode(FieldMeta('', '', False, 'object', ref='CSS.SourceRange'), range)
|
|
711
|
+
_params['text'] = encode(FieldMeta('', '', False, 'primitive'), text)
|
|
712
|
+
_result = await self._target.send('CSS.setScopeText', _params)
|
|
713
|
+
return SetScopeTextReturn.from_json(_result)
|
|
714
|
+
|
|
715
|
+
async def set_rule_selector(self, *, style_sheet_id: DOM_StyleSheetId, range: SourceRange, selector: str) -> SetRuleSelectorReturn:
|
|
716
|
+
"""
|
|
717
|
+
Modifies the rule selector.
|
|
718
|
+
:param style_sheet_id:
|
|
719
|
+
:param range:
|
|
720
|
+
:param selector:
|
|
721
|
+
"""
|
|
722
|
+
_params: Dict[str, Any] = {}
|
|
723
|
+
_params['styleSheetId'] = encode(FieldMeta('', '', False, 'primitive'), style_sheet_id)
|
|
724
|
+
_params['range'] = encode(FieldMeta('', '', False, 'object', ref='CSS.SourceRange'), range)
|
|
725
|
+
_params['selector'] = encode(FieldMeta('', '', False, 'primitive'), selector)
|
|
726
|
+
_result = await self._target.send('CSS.setRuleSelector', _params)
|
|
727
|
+
return SetRuleSelectorReturn.from_json(_result)
|
|
728
|
+
|
|
729
|
+
async def set_style_sheet_text(self, *, style_sheet_id: DOM_StyleSheetId, text: str) -> SetStyleSheetTextReturn:
|
|
730
|
+
"""
|
|
731
|
+
Sets the new stylesheet text.
|
|
732
|
+
:param style_sheet_id:
|
|
733
|
+
:param text:
|
|
734
|
+
"""
|
|
735
|
+
_params: Dict[str, Any] = {}
|
|
736
|
+
_params['styleSheetId'] = encode(FieldMeta('', '', False, 'primitive'), style_sheet_id)
|
|
737
|
+
_params['text'] = encode(FieldMeta('', '', False, 'primitive'), text)
|
|
738
|
+
_result = await self._target.send('CSS.setStyleSheetText', _params)
|
|
739
|
+
return SetStyleSheetTextReturn.from_json(_result)
|
|
740
|
+
|
|
741
|
+
async def set_style_texts(self, *, edits: List[StyleDeclarationEdit], node_for_property_syntax_validation: Optional[DOM_NodeId] = None) -> SetStyleTextsReturn:
|
|
742
|
+
"""
|
|
743
|
+
Applies specified style edits one after another in the given order.
|
|
744
|
+
:param edits:
|
|
745
|
+
:param node_for_property_syntax_validation: NodeId for the DOM node in whose context custom property declarations for registered properties should be
|
|
746
|
+
validated. If omitted, declarations in the new rule text can only be validated statically, which may produce
|
|
747
|
+
incorrect results if the declaration contains a var() for example.
|
|
748
|
+
"""
|
|
749
|
+
_params: Dict[str, Any] = {}
|
|
750
|
+
_params['edits'] = encode(FieldMeta('', '', False, 'array', inner=FieldMeta('', '', False, 'object', ref='CSS.StyleDeclarationEdit')), edits)
|
|
751
|
+
if node_for_property_syntax_validation is not None:
|
|
752
|
+
_params['nodeForPropertySyntaxValidation'] = encode(FieldMeta('', '', False, 'primitive'), node_for_property_syntax_validation)
|
|
753
|
+
_result = await self._target.send('CSS.setStyleTexts', _params)
|
|
754
|
+
return SetStyleTextsReturn.from_json(_result)
|
|
755
|
+
|
|
756
|
+
async def start_rule_usage_tracking(self) -> None:
|
|
757
|
+
"""Enables the selector recording."""
|
|
758
|
+
_params: Dict[str, Any] = {}
|
|
759
|
+
_result = await self._target.send('CSS.startRuleUsageTracking', _params)
|
|
760
|
+
return None
|
|
761
|
+
|
|
762
|
+
async def stop_rule_usage_tracking(self) -> StopRuleUsageTrackingReturn:
|
|
763
|
+
"""
|
|
764
|
+
Stop tracking rule usage and return the list of rules that were used since last call to
|
|
765
|
+
`takeCoverageDelta` (or since start of coverage instrumentation).
|
|
766
|
+
"""
|
|
767
|
+
_params: Dict[str, Any] = {}
|
|
768
|
+
_result = await self._target.send('CSS.stopRuleUsageTracking', _params)
|
|
769
|
+
return StopRuleUsageTrackingReturn.from_json(_result)
|
|
770
|
+
|
|
771
|
+
async def take_coverage_delta(self) -> TakeCoverageDeltaReturn:
|
|
772
|
+
"""
|
|
773
|
+
Obtain list of rules that became used since last call to this method (or since start of coverage
|
|
774
|
+
instrumentation).
|
|
775
|
+
"""
|
|
776
|
+
_params: Dict[str, Any] = {}
|
|
777
|
+
_result = await self._target.send('CSS.takeCoverageDelta', _params)
|
|
778
|
+
return TakeCoverageDeltaReturn.from_json(_result)
|
|
779
|
+
|
|
780
|
+
async def set_local_fonts_enabled(self, *, enabled: bool) -> None:
|
|
781
|
+
"""
|
|
782
|
+
Enables/disables rendering of local CSS fonts (enabled by default).
|
|
783
|
+
:param enabled: Whether rendering of local fonts is enabled.
|
|
784
|
+
"""
|
|
785
|
+
_params: Dict[str, Any] = {}
|
|
786
|
+
_params['enabled'] = encode(FieldMeta('', '', False, 'primitive'), enabled)
|
|
787
|
+
_result = await self._target.send('CSS.setLocalFontsEnabled', _params)
|
|
788
|
+
return None
|