css
CSSAnimationStyle
dataclass
CSS style coming from animations with the name of the animation.
Source code in zendriver/cdp/css.py
name: typing.Optional[str] = None
class-attribute
instance-attribute
style: CSSStyle
instance-attribute
__init__(style, name=None)
from_json(json)
classmethod
CSSAtRule
dataclass
CSS generic @rule representation.
Source code in zendriver/cdp/css.py
name: typing.Optional[Value] = None
class-attribute
instance-attribute
origin: StyleSheetOrigin
instance-attribute
style: CSSStyle
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
subsection: typing.Optional[str] = None
class-attribute
instance-attribute
type_: str
instance-attribute
__init__(type_, origin, style, subsection=None, name=None, style_sheet_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSComputedStyleProperty
dataclass
Source code in zendriver/cdp/css.py
name: str
instance-attribute
value: str
instance-attribute
__init__(name, value)
from_json(json)
classmethod
CSSContainerQuery
dataclass
CSS container query rule descriptor.
Source code in zendriver/cdp/css.py
1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 | |
logical_axes: typing.Optional[dom.LogicalAxes] = None
class-attribute
instance-attribute
name: typing.Optional[str] = None
class-attribute
instance-attribute
physical_axes: typing.Optional[dom.PhysicalAxes] = None
class-attribute
instance-attribute
queries_anchored: typing.Optional[bool] = None
class-attribute
instance-attribute
queries_scroll_state: typing.Optional[bool] = None
class-attribute
instance-attribute
range_: typing.Optional[SourceRange] = None
class-attribute
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
text: str
instance-attribute
__init__(text, range_=None, style_sheet_id=None, name=None, physical_axes=None, logical_axes=None, queries_scroll_state=None, queries_anchored=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSFunctionConditionNode
dataclass
CSS function conditional block representation.
Source code in zendriver/cdp/css.py
children: typing.List[CSSFunctionNode]
instance-attribute
condition_text: str
instance-attribute
container_queries: typing.Optional[CSSContainerQuery] = None
class-attribute
instance-attribute
media: typing.Optional[CSSMedia] = None
class-attribute
instance-attribute
navigation: typing.Optional[CSSNavigation] = None
class-attribute
instance-attribute
supports: typing.Optional[CSSSupports] = None
class-attribute
instance-attribute
__init__(children, condition_text, media=None, container_queries=None, supports=None, navigation=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSFunctionNode
dataclass
Section of the body of a CSS function rule.
Source code in zendriver/cdp/css.py
condition: typing.Optional[CSSFunctionConditionNode] = None
class-attribute
instance-attribute
style: typing.Optional[CSSStyle] = None
class-attribute
instance-attribute
__init__(condition=None, style=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
CSSFunctionParameter
dataclass
CSS function argument representation.
Source code in zendriver/cdp/css.py
name: str
instance-attribute
type_: str
instance-attribute
__init__(name, type_)
from_json(json)
classmethod
CSSFunctionRule
dataclass
CSS function at-rule representation.
Source code in zendriver/cdp/css.py
children: typing.List[CSSFunctionNode]
instance-attribute
name: Value
instance-attribute
origin: StyleSheetOrigin
instance-attribute
origin_tree_scope_node_id: typing.Optional[dom.BackendNodeId] = None
class-attribute
instance-attribute
parameters: typing.List[CSSFunctionParameter]
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
__init__(name, origin, parameters, children, style_sheet_id=None, origin_tree_scope_node_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSKeyframeRule
dataclass
CSS keyframe rule representation.
Source code in zendriver/cdp/css.py
key_text: Value
instance-attribute
origin: StyleSheetOrigin
instance-attribute
style: CSSStyle
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
__init__(origin, key_text, style, style_sheet_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSKeyframesRule
dataclass
CSS keyframes rule representation.
Source code in zendriver/cdp/css.py
animation_name: Value
instance-attribute
keyframes: typing.List[CSSKeyframeRule]
instance-attribute
__init__(animation_name, keyframes)
from_json(json)
classmethod
CSSLayer
dataclass
CSS Layer at-rule descriptor.
Source code in zendriver/cdp/css.py
range_: typing.Optional[SourceRange] = None
class-attribute
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
text: str
instance-attribute
__init__(text, range_=None, style_sheet_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSLayerData
dataclass
CSS Layer data.
Source code in zendriver/cdp/css.py
name: str
instance-attribute
order: float
instance-attribute
sub_layers: typing.Optional[typing.List[CSSLayerData]] = None
class-attribute
instance-attribute
__init__(name, order, sub_layers=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
CSSMedia
dataclass
CSS media rule descriptor.
Source code in zendriver/cdp/css.py
media_list: typing.Optional[typing.List[MediaQuery]] = None
class-attribute
instance-attribute
range_: typing.Optional[SourceRange] = None
class-attribute
instance-attribute
source: str
instance-attribute
source_url: typing.Optional[str] = None
class-attribute
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
text: str
instance-attribute
__init__(text, source, source_url=None, range_=None, style_sheet_id=None, media_list=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSNavigation
dataclass
CSS Navigation at-rule descriptor.
Source code in zendriver/cdp/css.py
active: typing.Optional[bool] = None
class-attribute
instance-attribute
range_: typing.Optional[SourceRange] = None
class-attribute
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
text: str
instance-attribute
__init__(text, active=None, range_=None, style_sheet_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSPositionTryRule
dataclass
CSS @position-try rule representation.
Source code in zendriver/cdp/css.py
active: bool
instance-attribute
name: Value
instance-attribute
origin: StyleSheetOrigin
instance-attribute
style: CSSStyle
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
__init__(name, origin, style, active, style_sheet_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSProperty
dataclass
CSS property declaration data.
Source code in zendriver/cdp/css.py
785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 | |
disabled: typing.Optional[bool] = None
class-attribute
instance-attribute
implicit: typing.Optional[bool] = None
class-attribute
instance-attribute
important: typing.Optional[bool] = None
class-attribute
instance-attribute
longhand_properties: typing.Optional[typing.List[CSSProperty]] = None
class-attribute
instance-attribute
name: str
instance-attribute
parsed_ok: typing.Optional[bool] = None
class-attribute
instance-attribute
range_: typing.Optional[SourceRange] = None
class-attribute
instance-attribute
text: typing.Optional[str] = None
class-attribute
instance-attribute
value: str
instance-attribute
__init__(name, value, important=None, implicit=None, text=None, parsed_ok=None, disabled=None, range_=None, longhand_properties=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSPropertyRegistration
dataclass
Representation of a custom property registration through CSS.registerProperty
Source code in zendriver/cdp/css.py
inherits: bool
instance-attribute
initial_value: typing.Optional[Value] = None
class-attribute
instance-attribute
property_name: str
instance-attribute
syntax: str
instance-attribute
__init__(property_name, inherits, syntax, initial_value=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSPropertyRule
dataclass
CSS property at-rule representation.
Source code in zendriver/cdp/css.py
origin: StyleSheetOrigin
instance-attribute
property_name: Value
instance-attribute
style: CSSStyle
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
__init__(origin, property_name, style, style_sheet_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSRule
dataclass
CSS rule representation.
Source code in zendriver/cdp/css.py
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 | |
container_queries: typing.Optional[typing.List[CSSContainerQuery]] = None
class-attribute
instance-attribute
layers: typing.Optional[typing.List[CSSLayer]] = None
class-attribute
instance-attribute
media: typing.Optional[typing.List[CSSMedia]] = None
class-attribute
instance-attribute
navigations: typing.Optional[typing.List[CSSNavigation]] = None
class-attribute
instance-attribute
nesting_selectors: typing.Optional[typing.List[str]] = None
class-attribute
instance-attribute
origin: StyleSheetOrigin
instance-attribute
origin_tree_scope_node_id: typing.Optional[dom.BackendNodeId] = None
class-attribute
instance-attribute
rule_types: typing.Optional[typing.List[CSSRuleType]] = None
class-attribute
instance-attribute
scopes: typing.Optional[typing.List[CSSScope]] = None
class-attribute
instance-attribute
selector_list: SelectorList
instance-attribute
starting_styles: typing.Optional[typing.List[CSSStartingStyle]] = None
class-attribute
instance-attribute
style: CSSStyle
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
supports: typing.Optional[typing.List[CSSSupports]] = None
class-attribute
instance-attribute
__init__(selector_list, origin, style, style_sheet_id=None, nesting_selectors=None, origin_tree_scope_node_id=None, media=None, container_queries=None, supports=None, layers=None, scopes=None, rule_types=None, starting_styles=None, navigations=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSRuleType
Bases: Enum
Enum indicating the type of a CSS rule, used to represent the order of a style rule's ancestors. This list only contains rule types that are collected during the ancestor rule collection.
Source code in zendriver/cdp/css.py
CONTAINER_RULE = 'ContainerRule'
class-attribute
instance-attribute
LAYER_RULE = 'LayerRule'
class-attribute
instance-attribute
MEDIA_RULE = 'MediaRule'
class-attribute
instance-attribute
NAVIGATION_RULE = 'NavigationRule'
class-attribute
instance-attribute
SCOPE_RULE = 'ScopeRule'
class-attribute
instance-attribute
STARTING_STYLE_RULE = 'StartingStyleRule'
class-attribute
instance-attribute
STYLE_RULE = 'StyleRule'
class-attribute
instance-attribute
SUPPORTS_RULE = 'SupportsRule'
class-attribute
instance-attribute
from_json(json)
classmethod
CSSScope
dataclass
CSS Scope at-rule descriptor.
Source code in zendriver/cdp/css.py
range_: typing.Optional[SourceRange] = None
class-attribute
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
text: str
instance-attribute
__init__(text, range_=None, style_sheet_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSStartingStyle
dataclass
CSS Starting Style at-rule descriptor.
Source code in zendriver/cdp/css.py
range_: typing.Optional[SourceRange] = None
class-attribute
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
__init__(range_=None, style_sheet_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
CSSStyle
dataclass
CSS style representation.
Source code in zendriver/cdp/css.py
css_properties: typing.List[CSSProperty]
instance-attribute
css_text: typing.Optional[str] = None
class-attribute
instance-attribute
range_: typing.Optional[SourceRange] = None
class-attribute
instance-attribute
shorthand_entries: typing.List[ShorthandEntry]
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
__init__(css_properties, shorthand_entries, style_sheet_id=None, css_text=None, range_=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSStyleSheetHeader
dataclass
CSS stylesheet metainformation.
Source code in zendriver/cdp/css.py
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | |
disabled: bool
instance-attribute
end_column: float
instance-attribute
end_line: float
instance-attribute
frame_id: page.FrameId
instance-attribute
has_source_url: typing.Optional[bool] = None
class-attribute
instance-attribute
is_constructed: bool
instance-attribute
is_inline: bool
instance-attribute
is_mutable: bool
instance-attribute
length: float
instance-attribute
loading_failed: typing.Optional[bool] = None
class-attribute
instance-attribute
origin: StyleSheetOrigin
instance-attribute
owner_node: typing.Optional[dom.BackendNodeId] = None
class-attribute
instance-attribute
source_map_url: typing.Optional[str] = None
class-attribute
instance-attribute
source_url: str
instance-attribute
start_column: float
instance-attribute
start_line: float
instance-attribute
style_sheet_id: dom.StyleSheetId
instance-attribute
title: str
instance-attribute
__init__(style_sheet_id, frame_id, source_url, origin, title, disabled, is_inline, is_mutable, is_constructed, start_line, start_column, length, end_line, end_column, source_map_url=None, owner_node=None, has_source_url=None, loading_failed=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSSupports
dataclass
CSS Supports at-rule descriptor.
Source code in zendriver/cdp/css.py
active: bool
instance-attribute
range_: typing.Optional[SourceRange] = None
class-attribute
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
text: str
instance-attribute
__init__(text, active, range_=None, style_sheet_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
CSSTryRule
dataclass
CSS try rule representation.
Source code in zendriver/cdp/css.py
origin: StyleSheetOrigin
instance-attribute
style: CSSStyle
instance-attribute
style_sheet_id: typing.Optional[dom.StyleSheetId] = None
class-attribute
instance-attribute
__init__(origin, style, style_sheet_id=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
ComputedStyleExtraFields
dataclass
Source code in zendriver/cdp/css.py
is_appearance_base: bool
instance-attribute
__init__(is_appearance_base)
from_json(json)
classmethod
ComputedStyleUpdated
dataclass
EXPERIMENTAL
Source code in zendriver/cdp/css.py
FontFace
dataclass
Properties of a web font: https://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#font-descriptions and additional information such as platformFontFamily and fontVariationAxes.
Source code in zendriver/cdp/css.py
1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | |
font_display: str
instance-attribute
font_family: str
instance-attribute
font_stretch: str
instance-attribute
font_style: str
instance-attribute
font_variant: str
instance-attribute
font_variation_axes: typing.Optional[typing.List[FontVariationAxis]] = None
class-attribute
instance-attribute
font_weight: str
instance-attribute
platform_font_family: str
instance-attribute
src: str
instance-attribute
unicode_range: str
instance-attribute
__init__(font_family, font_style, font_variant, font_weight, font_stretch, font_display, unicode_range, src, platform_font_family, font_variation_axes=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
FontVariationAxis
dataclass
Information about font variation axes for variable fonts
Source code in zendriver/cdp/css.py
default_value: float
instance-attribute
max_value: float
instance-attribute
min_value: float
instance-attribute
name: str
instance-attribute
tag: str
instance-attribute
__init__(tag, name, min_value, max_value, default_value)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
FontsUpdated
dataclass
Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded web font.
Source code in zendriver/cdp/css.py
font: typing.Optional[FontFace]
instance-attribute
__init__(font)
InheritedAnimatedStyleEntry
dataclass
Inherited CSS style collection for animated styles from ancestor node.
Source code in zendriver/cdp/css.py
animation_styles: typing.Optional[typing.List[CSSAnimationStyle]] = None
class-attribute
instance-attribute
transitions_style: typing.Optional[CSSStyle] = None
class-attribute
instance-attribute
__init__(animation_styles=None, transitions_style=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
InheritedPseudoElementMatches
dataclass
Inherited pseudo element matches from pseudos of an ancestor node.
Source code in zendriver/cdp/css.py
pseudo_elements: typing.List[PseudoElementMatches]
instance-attribute
__init__(pseudo_elements)
from_json(json)
classmethod
InheritedStyleEntry
dataclass
Inherited CSS rule collection from ancestor node.
Source code in zendriver/cdp/css.py
inline_style: typing.Optional[CSSStyle] = None
class-attribute
instance-attribute
matched_css_rules: typing.List[RuleMatch]
instance-attribute
__init__(matched_css_rules, inline_style=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
MediaQuery
dataclass
Media query descriptor.
Source code in zendriver/cdp/css.py
active: bool
instance-attribute
expressions: typing.List[MediaQueryExpression]
instance-attribute
__init__(expressions, active)
from_json(json)
classmethod
MediaQueryExpression
dataclass
Media query expression descriptor.
Source code in zendriver/cdp/css.py
computed_length: typing.Optional[float] = None
class-attribute
instance-attribute
feature: str
instance-attribute
unit: str
instance-attribute
value: float
instance-attribute
value_range: typing.Optional[SourceRange] = None
class-attribute
instance-attribute
__init__(value, unit, feature, value_range=None, computed_length=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
MediaQueryResultChanged
dataclass
Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features.
Source code in zendriver/cdp/css.py
PlatformFontUsage
dataclass
Information about amount of glyphs that were rendered with given font.
Source code in zendriver/cdp/css.py
family_name: str
instance-attribute
glyph_count: float
instance-attribute
is_custom_font: bool
instance-attribute
post_script_name: str
instance-attribute
__init__(family_name, post_script_name, is_custom_font, glyph_count)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
PseudoElementMatches
dataclass
CSS rule collection for a single pseudo style.
Source code in zendriver/cdp/css.py
matches: typing.List[RuleMatch]
instance-attribute
pseudo_identifier: typing.Optional[str] = None
class-attribute
instance-attribute
pseudo_type: dom.PseudoType
instance-attribute
__init__(pseudo_type, matches, pseudo_identifier=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
RuleMatch
dataclass
Match data for a CSS rule.
Source code in zendriver/cdp/css.py
matching_selectors: typing.List[int]
instance-attribute
rule: CSSRule
instance-attribute
__init__(rule, matching_selectors)
from_json(json)
classmethod
RuleUsage
dataclass
CSS coverage information.
Source code in zendriver/cdp/css.py
end_offset: float
instance-attribute
start_offset: float
instance-attribute
style_sheet_id: dom.StyleSheetId
instance-attribute
used: bool
instance-attribute
__init__(style_sheet_id, start_offset, end_offset, used)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
SelectorList
dataclass
Selector list data.
Source code in zendriver/cdp/css.py
selectors: typing.List[Value]
instance-attribute
text: str
instance-attribute
__init__(selectors, text)
from_json(json)
classmethod
ShorthandEntry
dataclass
Source code in zendriver/cdp/css.py
important: typing.Optional[bool] = None
class-attribute
instance-attribute
name: str
instance-attribute
value: str
instance-attribute
__init__(name, value, important=None)
from_json(json)
classmethod
SourceRange
dataclass
Text range within a resource. All numbers are zero-based.
Source code in zendriver/cdp/css.py
end_column: int
instance-attribute
end_line: int
instance-attribute
start_column: int
instance-attribute
start_line: int
instance-attribute
__init__(start_line, start_column, end_line, end_column)
from_json(json)
classmethod
Specificity
dataclass
Specificity: https://drafts.csswg.org/selectors/#specificity-rules
Source code in zendriver/cdp/css.py
a: int
instance-attribute
b: int
instance-attribute
c: int
instance-attribute
__init__(a, b, c)
from_json(json)
classmethod
StyleDeclarationEdit
dataclass
A descriptor of operation to mutate style declaration text.
Source code in zendriver/cdp/css.py
range_: SourceRange
instance-attribute
style_sheet_id: dom.StyleSheetId
instance-attribute
text: str
instance-attribute
__init__(style_sheet_id, range_, text)
from_json(json)
classmethod
StyleSheetAdded
dataclass
Fired whenever an active document stylesheet is added.
Source code in zendriver/cdp/css.py
StyleSheetChanged
dataclass
Fired whenever a stylesheet is changed as a result of the client operation.
Source code in zendriver/cdp/css.py
style_sheet_id: dom.StyleSheetId
instance-attribute
__init__(style_sheet_id)
StyleSheetOrigin
Bases: Enum
Stylesheet type: "injected" for stylesheets injected via extension, "user-agent" for user-agent stylesheets, "inspector" for stylesheets created by the inspector (i.e. those holding the "via inspector" rules), "regular" for regular stylesheets.
Source code in zendriver/cdp/css.py
INJECTED = 'injected'
class-attribute
instance-attribute
INSPECTOR = 'inspector'
class-attribute
instance-attribute
REGULAR = 'regular'
class-attribute
instance-attribute
USER_AGENT = 'user-agent'
class-attribute
instance-attribute
from_json(json)
classmethod
StyleSheetRemoved
dataclass
Fired whenever an active document stylesheet is removed.
Source code in zendriver/cdp/css.py
style_sheet_id: dom.StyleSheetId
instance-attribute
__init__(style_sheet_id)
Value
dataclass
Data for a simple selector (these are delimited by commas in a selector list).
Source code in zendriver/cdp/css.py
range_: typing.Optional[SourceRange] = None
class-attribute
instance-attribute
specificity: typing.Optional[Specificity] = None
class-attribute
instance-attribute
text: str
instance-attribute
__init__(text, range_=None, specificity=None)
from_json(json)
classmethod
Source code in zendriver/cdp/css.py
to_json()
Source code in zendriver/cdp/css.py
add_rule(style_sheet_id, rule_text, location, node_for_property_syntax_validation=None)
Inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the
position specified by location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style_sheet_id
|
StyleSheetId
|
The css style sheet identifier where a new rule should be inserted. |
required |
rule_text
|
str
|
The text of a new rule. |
required |
location
|
SourceRange
|
Text position of a new rule in the target style sheet. |
required |
node_for_property_syntax_validation
|
Optional[NodeId]
|
(EXPERIMENTAL) (Optional) NodeId for the DOM node in whose context custom property declarations for registered properties should be validated. If omitted, declarations in the new rule text can only be validated statically, which may produce incorrect results if the declaration contains a var() for example. |
None
|
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, CSSRule]
|
The newly created rule. |
Source code in zendriver/cdp/css.py
collect_class_names(style_sheet_id)
Returns all class names from specified stylesheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style_sheet_id
|
StyleSheetId
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[str]]
|
Class name list. |
Source code in zendriver/cdp/css.py
create_style_sheet(frame_id, force=None)
Creates a new special "via-inspector" stylesheet in the frame with given frameId.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame_id
|
FrameId
|
Identifier of the frame where "via-inspector" stylesheet should be created. |
required |
force
|
Optional[bool]
|
(Optional) If true, creates a new stylesheet for every call. If false, returns a stylesheet previously created by a call with force=false for the frame's document if it exists or creates a new stylesheet (default: false). |
None
|
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, StyleSheetId]
|
Identifier of the created "via-inspector" stylesheet. |
Source code in zendriver/cdp/css.py
disable()
Disables the CSS agent for the given page.
enable()
Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been enabled until the result of this command is received.
Source code in zendriver/cdp/css.py
force_pseudo_state(node_id, forced_pseudo_classes)
Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_id
|
NodeId
|
The element id for which to force the pseudo state. |
required |
forced_pseudo_classes
|
List[str]
|
Element pseudo classes to force when computing the element's style. |
required |
Source code in zendriver/cdp/css.py
force_starting_style(node_id, forced)
Ensures that the given node is in its starting-style state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_id
|
NodeId
|
The element id for which to force the starting-style state. |
required |
forced
|
bool
|
Boolean indicating if this is on or off. |
required |
Source code in zendriver/cdp/css.py
get_animated_styles_for_node(node_id)
Returns the styles coming from animations & transitions including the animation & transition styles coming from inheritance chain.
EXPERIMENTAL
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_id
|
NodeId
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[Optional[List[CSSAnimationStyle]], Optional[CSSStyle], Optional[List[InheritedAnimatedStyleEntry]]]]
|
A tuple with the following items: 0. animationStyles - (Optional) Styles coming from animations. 1. transitionsStyle - (Optional) Style coming from transitions. 2. inherited - (Optional) Inherited style entries for animationsStyle and transitionsStyle from the inheritance chain of the element. |
Source code in zendriver/cdp/css.py
get_background_colors(node_id)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_id
|
NodeId
|
Id of the node to get background colors for. |
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[Optional[List[str]], Optional[str], Optional[str]]]
|
A tuple with the following items: 0. backgroundColors - (Optional) The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load). 1. computedFontSize - (Optional) The computed font size for this node, as a CSS computed value string (e.g. '12px'). 2. computedFontWeight - (Optional) The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100'). |
Source code in zendriver/cdp/css.py
get_computed_style_for_node(node_id)
Returns the computed style for a DOM node identified by nodeId.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_id
|
NodeId
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[List[CSSComputedStyleProperty], ComputedStyleExtraFields]]
|
A tuple with the following items: 0. computedStyle - Computed style for the specified DOM node. 1. extraFields - A list of non-standard "extra fields" which blink stores alongside each computed style. |
Source code in zendriver/cdp/css.py
get_environment_variables()
Returns the values of the default UA-defined environment variables used in env()
EXPERIMENTAL
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, dict]
|
|
Source code in zendriver/cdp/css.py
get_inline_styles_for_node(node_id)
Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM
attributes) for a DOM node identified by nodeId.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_id
|
NodeId
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[Optional[CSSStyle], Optional[CSSStyle]]]
|
A tuple with the following items: 0. inlineStyle - (Optional) Inline style for the specified DOM node. 1. attributesStyle - (Optional) Attribute-defined element style (e.g. resulting from "width=20 height=100%"). |
Source code in zendriver/cdp/css.py
get_layers_for_node(node_id)
Returns all layers parsed by the rendering engine for the tree scope of a node. Given a DOM element identified by nodeId, getLayersForNode returns the root layer for the nearest ancestor document or shadow root. The layer root contains the full layer tree for the tree scope and their ordering.
EXPERIMENTAL
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_id
|
NodeId
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, CSSLayerData]
|
|
Source code in zendriver/cdp/css.py
get_location_for_selector(style_sheet_id, selector_text)
Given a CSS selector text and a style sheet ID, getLocationForSelector returns an array of locations of the CSS selector in the style sheet.
EXPERIMENTAL
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style_sheet_id
|
StyleSheetId
|
|
required |
selector_text
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[SourceRange]]
|
|
Source code in zendriver/cdp/css.py
get_longhand_properties(shorthand_name, value)
EXPERIMENTAL
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shorthand_name
|
str
|
|
required |
value
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[CSSProperty]]
|
|
Source code in zendriver/cdp/css.py
get_matched_styles_for_node(node_id)
Returns requested styles for a DOM node identified by nodeId.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_id
|
NodeId
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[Optional[CSSStyle], Optional[CSSStyle], Optional[List[RuleMatch]], Optional[List[PseudoElementMatches]], Optional[List[InheritedStyleEntry]], Optional[List[InheritedPseudoElementMatches]], Optional[List[CSSKeyframesRule]], Optional[List[CSSPositionTryRule]], Optional[int], Optional[List[CSSPropertyRule]], Optional[List[CSSPropertyRegistration]], Optional[List[CSSAtRule]], Optional[NodeId], Optional[List[CSSFunctionRule]]]]
|
A tuple with the following items: 0. inlineStyle - (Optional) Inline style for the specified DOM node. 1. attributesStyle - (Optional) Attribute-defined element style (e.g. resulting from "width=20 height=100%"). 2. matchedCSSRules - (Optional) CSS rules matching this node, from all applicable stylesheets. 3. pseudoElements - (Optional) Pseudo style matches for this node. 4. inherited - (Optional) A chain of inherited styles (from the immediate node parent up to the DOM tree root). 5. inheritedPseudoElements - (Optional) A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root). 6. cssKeyframesRules - (Optional) A list of CSS keyframed animations matching this node. 7. cssPositionTryRules - (Optional) A list of CSS @position-try rules matching this node, based on the position-try-fallbacks property. 8. activePositionFallbackIndex - (Optional) Index of the active fallback in the applied position-try-fallback property, will not be set if there is no active position-try fallback. 9. cssPropertyRules - (Optional) A list of CSS at-property rules matching this node. 10. cssPropertyRegistrations - (Optional) A list of CSS property registrations matching this node. 11. cssAtRules - (Optional) A list of simple @rules matching this node or its pseudo-elements. 12. parentLayoutNodeId - (Optional) Id of the first parent element that does not have display: contents. 13. cssFunctionRules - (Optional) A list of CSS at-function rules referenced by styles of this node. |
Source code in zendriver/cdp/css.py
2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 | |
get_media_queries()
Returns all media queries parsed by the rendering engine.
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[CSSMedia]]
|
|
Source code in zendriver/cdp/css.py
get_platform_fonts_for_node(node_id)
Requests information about platform fonts which we used to render child TextNodes in the given node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_id
|
NodeId
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[PlatformFontUsage]]
|
Usage statistics for every employed platform font. |
Source code in zendriver/cdp/css.py
get_style_sheet_text(style_sheet_id)
Returns the current textual content for a stylesheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style_sheet_id
|
StyleSheetId
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, str]
|
The stylesheet text. |
Source code in zendriver/cdp/css.py
resolve_values(values, node_id, property_name=None, pseudo_type=None, pseudo_identifier=None)
Resolve the specified values in the context of the provided element.
For example, a value of '1em' is evaluated according to the computed
'font-size' of the element and a value 'calc(1px + 2px)' will be
resolved to '3px'.
If the propertyName was specified the values are resolved as if
they were property's declaration. If a value cannot be parsed according
to the provided property syntax, the value is parsed using combined
syntax as if null propertyName was provided. If the value cannot be
resolved even then, return the provided value without any changes.
Note: this function currently does not resolve CSS random() function,
it returns unmodified random() function parts.`
EXPERIMENTAL
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
List[str]
|
Cascade-dependent keywords (revert/revert-layer) do not work. |
required |
node_id
|
NodeId
|
Id of the node in whose context the expression is evaluated |
required |
property_name
|
Optional[str]
|
(Optional) Only longhands and custom property names are accepted. |
None
|
pseudo_type
|
Optional[PseudoType]
|
(Optional) Pseudo element type, only works for pseudo elements that generate elements in the tree, such as ::before and ::after. |
None
|
pseudo_identifier
|
Optional[str]
|
(Optional) Pseudo element custom ident. |
None
|
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[str]]
|
|
Source code in zendriver/cdp/css.py
set_container_query_text(style_sheet_id, range_, text)
Modifies the expression of a container query.
EXPERIMENTAL
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style_sheet_id
|
StyleSheetId
|
|
required |
range_
|
SourceRange
|
|
required |
text
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, CSSContainerQuery]
|
The resulting CSS container query rule after modification. |
Source code in zendriver/cdp/css.py
set_effective_property_value_for_node(node_id, property_name, value)
Find a rule with the given active property for the given node and set the new value for this property
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_id
|
NodeId
|
The element id for which to set property. |
required |
property_name
|
str
|
|
required |
value
|
str
|
|
required |
Source code in zendriver/cdp/css.py
set_keyframe_key(style_sheet_id, range_, key_text)
Modifies the keyframe rule key text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style_sheet_id
|
StyleSheetId
|
|
required |
range_
|
SourceRange
|
|
required |
key_text
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Value]
|
The resulting key text after modification. |
Source code in zendriver/cdp/css.py
set_local_fonts_enabled(enabled)
Enables/disables rendering of local CSS fonts (enabled by default).
EXPERIMENTAL
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enabled
|
bool
|
Whether rendering of local fonts is enabled. |
required |
Source code in zendriver/cdp/css.py
set_media_text(style_sheet_id, range_, text)
Modifies the rule selector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style_sheet_id
|
StyleSheetId
|
|
required |
range_
|
SourceRange
|
|
required |
text
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, CSSMedia]
|
The resulting CSS media rule after modification. |
Source code in zendriver/cdp/css.py
set_navigation_text(style_sheet_id, range_, text)
Modifies the expression of a navigation at-rule.
EXPERIMENTAL
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style_sheet_id
|
StyleSheetId
|
|
required |
range_
|
SourceRange
|
|
required |
text
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, CSSNavigation]
|
The resulting CSS Navigation rule after modification. |
Source code in zendriver/cdp/css.py
set_property_rule_property_name(style_sheet_id, range_, property_name)
Modifies the property rule property name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style_sheet_id
|
StyleSheetId
|
|
required |
range_
|
SourceRange
|
|
required |
property_name
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Value]
|
The resulting key text after modification. |
Source code in zendriver/cdp/css.py
set_rule_selector(style_sheet_id, range_, selector)
Modifies the rule selector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style_sheet_id
|
StyleSheetId
|
|
required |
range_
|
SourceRange
|
|
required |
selector
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, SelectorList]
|
The resulting selector list after modification. |
Source code in zendriver/cdp/css.py
set_scope_text(style_sheet_id, range_, text)
Modifies the expression of a scope at-rule.
EXPERIMENTAL
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style_sheet_id
|
StyleSheetId
|
|
required |
range_
|
SourceRange
|
|
required |
text
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, CSSScope]
|
The resulting CSS Scope rule after modification. |
Source code in zendriver/cdp/css.py
set_style_sheet_text(style_sheet_id, text)
Sets the new stylesheet text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style_sheet_id
|
StyleSheetId
|
|
required |
text
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Optional[str]]
|
(Optional) URL of source map associated with script (if any). |
Source code in zendriver/cdp/css.py
set_style_texts(edits, node_for_property_syntax_validation=None)
Applies specified style edits one after another in the given order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
edits
|
List[StyleDeclarationEdit]
|
|
required |
node_for_property_syntax_validation
|
Optional[NodeId]
|
(EXPERIMENTAL) (Optional) NodeId for the DOM node in whose context custom property declarations for registered properties should be validated. If omitted, declarations in the new rule text can only be validated statically, which may produce incorrect results if the declaration contains a var() for example. |
None
|
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[CSSStyle]]
|
The resulting styles after modification. |
Source code in zendriver/cdp/css.py
set_supports_text(style_sheet_id, range_, text)
Modifies the expression of a supports at-rule.
EXPERIMENTAL
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style_sheet_id
|
StyleSheetId
|
|
required |
range_
|
SourceRange
|
|
required |
text
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, CSSSupports]
|
The resulting CSS Supports rule after modification. |
Source code in zendriver/cdp/css.py
start_rule_usage_tracking()
Enables the selector recording.
stop_rule_usage_tracking()
Stop tracking rule usage and return the list of rules that were used since last call to
takeCoverageDelta (or since start of coverage instrumentation).
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[RuleUsage]]
|
|
Source code in zendriver/cdp/css.py
take_computed_style_updates()
Polls the next batch of computed style updates.
EXPERIMENTAL
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[NodeId]]
|
The list of node Ids that have their tracked computed styles updated. |
Source code in zendriver/cdp/css.py
take_coverage_delta()
Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation).
Returns:
| Type | Description |
|---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[List[RuleUsage], float]]
|
A tuple with the following items: 0. coverage - 1. timestamp - Monotonically increasing time, in seconds. |
Source code in zendriver/cdp/css.py
track_computed_style_updates(properties_to_track)
Starts tracking the given computed styles for updates. The specified array of properties replaces the one previously specified. Pass empty array to disable tracking. Use takeComputedStyleUpdates to retrieve the list of nodes that had properties modified. The changes to computed style properties are only tracked for nodes pushed to the front-end by the DOM agent. If no changes to the tracked properties occur after the node has been pushed to the front-end, no updates will be issued for the node.
EXPERIMENTAL
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
properties_to_track
|
List[CSSComputedStyleProperty]
|
|
required |
Source code in zendriver/cdp/css.py
track_computed_style_updates_for_node(node_id=None)
Starts tracking the given node for the computed style updates
and whenever the computed style is updated for node, it queues
a computedStyleUpdated event with throttling.
There can only be 1 node tracked for computed style updates
so passing a new node id removes tracking from the previous node.
Pass undefined to disable tracking.
EXPERIMENTAL
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_id
|
Optional[NodeId]
|
(Optional) |
None
|