Class: Selenium::DevTools::V123::CSS
- Inherits:
- 
      Object
      
        - Object
- Selenium::DevTools::V123::CSS
 
- Defined in:
- lib/selenium/devtools/v123/css.rb
Constant Summary collapse
- EVENTS =
- { fonts_updated: 'fontsUpdated', media_query_result_changed: 'mediaQueryResultChanged', style_sheet_added: 'styleSheetAdded', style_sheet_changed: 'styleSheetChanged', style_sheet_removed: 'styleSheetRemoved', }.freeze 
Instance Method Summary collapse
- #add_rule(style_sheet_id:, rule_text:, location:, node_for_property_syntax_validation: nil) ⇒ Object
- #collect_class_names(style_sheet_id:) ⇒ Object
- #create_style_sheet(frame_id:) ⇒ Object
- #disable ⇒ Object
- #enable ⇒ Object
- #force_pseudo_state(node_id:, forced_pseudo_classes:) ⇒ Object
- #get_background_colors(node_id:) ⇒ Object
- #get_computed_style_for_node(node_id:) ⇒ Object
- #get_inline_styles_for_node(node_id:) ⇒ Object
- #get_layers_for_node(node_id:) ⇒ Object
- #get_matched_styles_for_node(node_id:) ⇒ Object
- #get_media_queries ⇒ Object
- #get_platform_fonts_for_node(node_id:) ⇒ Object
- #get_style_sheet_text(style_sheet_id:) ⇒ Object
- 
  
    
      #initialize(devtools)  ⇒ CSS 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of CSS. 
- #on(event, &block) ⇒ Object
- #set_container_query_text(style_sheet_id:, range:, text:) ⇒ Object
- #set_effective_property_value_for_node(node_id:, property_name:, value:) ⇒ Object
- #set_keyframe_key(style_sheet_id:, range:, key_text:) ⇒ Object
- #set_local_fonts_enabled(enabled:) ⇒ Object
- #set_media_text(style_sheet_id:, range:, text:) ⇒ Object
- #set_property_rule_property_name(style_sheet_id:, range:, property_name:) ⇒ Object
- #set_rule_selector(style_sheet_id:, range:, selector:) ⇒ Object
- #set_scope_text(style_sheet_id:, range:, text:) ⇒ Object
- #set_style_sheet_text(style_sheet_id:, text:) ⇒ Object
- #set_style_texts(edits:, node_for_property_syntax_validation: nil) ⇒ Object
- #set_supports_text(style_sheet_id:, range:, text:) ⇒ Object
- #start_rule_usage_tracking ⇒ Object
- #stop_rule_usage_tracking ⇒ Object
- #take_computed_style_updates ⇒ Object
- #take_coverage_delta ⇒ Object
- #track_computed_style_updates(properties_to_track:) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ CSS
Returns a new instance of CSS.
| 33 34 35 | # File 'lib/selenium/devtools/v123/css.rb', line 33 def initialize(devtools) @devtools = devtools end | 
Instance Method Details
#add_rule(style_sheet_id:, rule_text:, location:, node_for_property_syntax_validation: nil) ⇒ Object
| 42 43 44 45 46 47 48 | # File 'lib/selenium/devtools/v123/css.rb', line 42 def add_rule(style_sheet_id:, rule_text:, location:, node_for_property_syntax_validation: nil) @devtools.send_cmd('CSS.addRule', styleSheetId: style_sheet_id, ruleText: rule_text, location: location, nodeForPropertySyntaxValidation: node_for_property_syntax_validation) end | 
#collect_class_names(style_sheet_id:) ⇒ Object
| 50 51 52 53 | # File 'lib/selenium/devtools/v123/css.rb', line 50 def collect_class_names(style_sheet_id:) @devtools.send_cmd('CSS.collectClassNames', styleSheetId: style_sheet_id) end | 
#create_style_sheet(frame_id:) ⇒ Object
| 55 56 57 58 | # File 'lib/selenium/devtools/v123/css.rb', line 55 def create_style_sheet(frame_id:) @devtools.send_cmd('CSS.createStyleSheet', frameId: frame_id) end | 
#disable ⇒ Object
| 60 61 62 | # File 'lib/selenium/devtools/v123/css.rb', line 60 def disable @devtools.send_cmd('CSS.disable') end | 
#enable ⇒ Object
| 64 65 66 | # File 'lib/selenium/devtools/v123/css.rb', line 64 def enable @devtools.send_cmd('CSS.enable') end | 
#force_pseudo_state(node_id:, forced_pseudo_classes:) ⇒ Object
| 68 69 70 71 72 | # File 'lib/selenium/devtools/v123/css.rb', line 68 def force_pseudo_state(node_id:, forced_pseudo_classes:) @devtools.send_cmd('CSS.forcePseudoState', nodeId: node_id, forcedPseudoClasses: forced_pseudo_classes) end | 
#get_background_colors(node_id:) ⇒ Object
| 74 75 76 77 | # File 'lib/selenium/devtools/v123/css.rb', line 74 def get_background_colors(node_id:) @devtools.send_cmd('CSS.getBackgroundColors', nodeId: node_id) end | 
#get_computed_style_for_node(node_id:) ⇒ Object
| 79 80 81 82 | # File 'lib/selenium/devtools/v123/css.rb', line 79 def get_computed_style_for_node(node_id:) @devtools.send_cmd('CSS.getComputedStyleForNode', nodeId: node_id) end | 
#get_inline_styles_for_node(node_id:) ⇒ Object
| 84 85 86 87 | # File 'lib/selenium/devtools/v123/css.rb', line 84 def get_inline_styles_for_node(node_id:) @devtools.send_cmd('CSS.getInlineStylesForNode', nodeId: node_id) end | 
#get_layers_for_node(node_id:) ⇒ Object
| 108 109 110 111 | # File 'lib/selenium/devtools/v123/css.rb', line 108 def get_layers_for_node(node_id:) @devtools.send_cmd('CSS.getLayersForNode', nodeId: node_id) end | 
#get_matched_styles_for_node(node_id:) ⇒ Object
| 89 90 91 92 | # File 'lib/selenium/devtools/v123/css.rb', line 89 def get_matched_styles_for_node(node_id:) @devtools.send_cmd('CSS.getMatchedStylesForNode', nodeId: node_id) end | 
#get_media_queries ⇒ Object
| 94 95 96 | # File 'lib/selenium/devtools/v123/css.rb', line 94 def get_media_queries @devtools.send_cmd('CSS.getMediaQueries') end | 
#get_platform_fonts_for_node(node_id:) ⇒ Object
| 98 99 100 101 | # File 'lib/selenium/devtools/v123/css.rb', line 98 def get_platform_fonts_for_node(node_id:) @devtools.send_cmd('CSS.getPlatformFontsForNode', nodeId: node_id) end | 
#get_style_sheet_text(style_sheet_id:) ⇒ Object
| 103 104 105 106 | # File 'lib/selenium/devtools/v123/css.rb', line 103 def get_style_sheet_text(style_sheet_id:) @devtools.send_cmd('CSS.getStyleSheetText', styleSheetId: style_sheet_id) end | 
#on(event, &block) ⇒ Object
| 37 38 39 40 | # File 'lib/selenium/devtools/v123/css.rb', line 37 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["CSS.#{event}"] << block end | 
#set_container_query_text(style_sheet_id:, range:, text:) ⇒ Object
| 150 151 152 153 154 155 | # File 'lib/selenium/devtools/v123/css.rb', line 150 def set_container_query_text(style_sheet_id:, range:, text:) @devtools.send_cmd('CSS.setContainerQueryText', styleSheetId: style_sheet_id, range: range, text: text) end | 
#set_effective_property_value_for_node(node_id:, property_name:, value:) ⇒ Object
| 122 123 124 125 126 127 | # File 'lib/selenium/devtools/v123/css.rb', line 122 def set_effective_property_value_for_node(node_id:, property_name:, value:) @devtools.send_cmd('CSS.setEffectivePropertyValueForNode', nodeId: node_id, propertyName: property_name, value: value) end | 
#set_keyframe_key(style_sheet_id:, range:, key_text:) ⇒ Object
| 136 137 138 139 140 141 | # File 'lib/selenium/devtools/v123/css.rb', line 136 def set_keyframe_key(style_sheet_id:, range:, key_text:) @devtools.send_cmd('CSS.setKeyframeKey', styleSheetId: style_sheet_id, range: range, keyText: key_text) end | 
#set_local_fonts_enabled(enabled:) ⇒ Object
| 202 203 204 205 | # File 'lib/selenium/devtools/v123/css.rb', line 202 def set_local_fonts_enabled(enabled:) @devtools.send_cmd('CSS.setLocalFontsEnabled', enabled: enabled) end | 
#set_media_text(style_sheet_id:, range:, text:) ⇒ Object
| 143 144 145 146 147 148 | # File 'lib/selenium/devtools/v123/css.rb', line 143 def set_media_text(style_sheet_id:, range:, text:) @devtools.send_cmd('CSS.setMediaText', styleSheetId: style_sheet_id, range: range, text: text) end | 
#set_property_rule_property_name(style_sheet_id:, range:, property_name:) ⇒ Object
| 129 130 131 132 133 134 | # File 'lib/selenium/devtools/v123/css.rb', line 129 def set_property_rule_property_name(style_sheet_id:, range:, property_name:) @devtools.send_cmd('CSS.setPropertyRulePropertyName', styleSheetId: style_sheet_id, range: range, propertyName: property_name) end | 
#set_rule_selector(style_sheet_id:, range:, selector:) ⇒ Object
| 171 172 173 174 175 176 | # File 'lib/selenium/devtools/v123/css.rb', line 171 def set_rule_selector(style_sheet_id:, range:, selector:) @devtools.send_cmd('CSS.setRuleSelector', styleSheetId: style_sheet_id, range: range, selector: selector) end | 
#set_scope_text(style_sheet_id:, range:, text:) ⇒ Object
| 164 165 166 167 168 169 | # File 'lib/selenium/devtools/v123/css.rb', line 164 def set_scope_text(style_sheet_id:, range:, text:) @devtools.send_cmd('CSS.setScopeText', styleSheetId: style_sheet_id, range: range, text: text) end | 
#set_style_sheet_text(style_sheet_id:, text:) ⇒ Object
| 178 179 180 181 182 | # File 'lib/selenium/devtools/v123/css.rb', line 178 def set_style_sheet_text(style_sheet_id:, text:) @devtools.send_cmd('CSS.setStyleSheetText', styleSheetId: style_sheet_id, text: text) end | 
#set_style_texts(edits:, node_for_property_syntax_validation: nil) ⇒ Object
| 184 185 186 187 188 | # File 'lib/selenium/devtools/v123/css.rb', line 184 def set_style_texts(edits:, node_for_property_syntax_validation: nil) @devtools.send_cmd('CSS.setStyleTexts', edits: edits, nodeForPropertySyntaxValidation: node_for_property_syntax_validation) end | 
#set_supports_text(style_sheet_id:, range:, text:) ⇒ Object
| 157 158 159 160 161 162 | # File 'lib/selenium/devtools/v123/css.rb', line 157 def set_supports_text(style_sheet_id:, range:, text:) @devtools.send_cmd('CSS.setSupportsText', styleSheetId: style_sheet_id, range: range, text: text) end | 
#start_rule_usage_tracking ⇒ Object
| 190 191 192 | # File 'lib/selenium/devtools/v123/css.rb', line 190 def start_rule_usage_tracking @devtools.send_cmd('CSS.startRuleUsageTracking') end | 
#stop_rule_usage_tracking ⇒ Object
| 194 195 196 | # File 'lib/selenium/devtools/v123/css.rb', line 194 def stop_rule_usage_tracking @devtools.send_cmd('CSS.stopRuleUsageTracking') end | 
#take_computed_style_updates ⇒ Object
| 118 119 120 | # File 'lib/selenium/devtools/v123/css.rb', line 118 def take_computed_style_updates @devtools.send_cmd('CSS.takeComputedStyleUpdates') end | 
#take_coverage_delta ⇒ Object
| 198 199 200 | # File 'lib/selenium/devtools/v123/css.rb', line 198 def take_coverage_delta @devtools.send_cmd('CSS.takeCoverageDelta') end | 
#track_computed_style_updates(properties_to_track:) ⇒ Object
| 113 114 115 116 | # File 'lib/selenium/devtools/v123/css.rb', line 113 def track_computed_style_updates(properties_to_track:) @devtools.send_cmd('CSS.trackComputedStyleUpdates', propertiesToTrack: properties_to_track) end |