Class: Dommy::HTMLSourceElement

Inherits:
HTMLElement show all
Defined in:
lib/dommy/html_elements.rb

Constant Summary

Constants inherited from Element

Element::ATTRIBUTE_NODE, Element::CDATA_SECTION_NODE, Element::COMMENT_NODE, Element::DOCUMENT_FRAGMENT_NODE, Element::DOCUMENT_NODE, Element::DOCUMENT_POSITION_CONTAINED_BY, Element::DOCUMENT_POSITION_CONTAINS, Element::DOCUMENT_POSITION_DISCONNECTED, Element::DOCUMENT_POSITION_FOLLOWING, Element::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, Element::DOCUMENT_POSITION_PRECEDING, Element::DOCUMENT_TYPE_NODE, Element::ELEMENT_NODE, Element::JS_METHOD_NAMES, Element::PROCESSING_INSTRUCTION_NODE, Element::SHADOW_HOST_TAGS, Element::TEXT_NODE

Constants included from Node

Node::ATTRIBUTE_NODE, Node::CDATA_SECTION_NODE, Node::COMMENT_NODE, Node::DOCUMENT_FRAGMENT_NODE, Node::DOCUMENT_NODE, Node::DOCUMENT_POSITION_CONTAINED_BY, Node::DOCUMENT_POSITION_CONTAINS, Node::DOCUMENT_POSITION_DISCONNECTED, Node::DOCUMENT_POSITION_FOLLOWING, Node::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, Node::DOCUMENT_POSITION_PRECEDING, Node::DOCUMENT_TYPE_NODE, Node::ELEMENT_NODE, Node::PROCESSING_INSTRUCTION_NODE, Node::TEXT_NODE

Instance Attribute Summary

Attributes inherited from Element

#document

Instance Method Summary collapse

Methods inherited from HTMLElement

#case_sensitive_attribute_names?

Methods inherited from Element

#[], #[]=, #__dommy_backend_node__, #__internal_shadow_root__, #__js_call__, #__js_method_names__, #__test_scroll_log__, #after, #anchor_href, #animate, #append, #append_child, #at_xpath, #attach_shadow, #attributes, #base_uri, #before, #blur, #child_element_count, #child_nodes, #children, #class_list, #class_name, #class_name=, #click, #clone_node, #closest, #compare_document_position, #contains?, #dataset, #equal_node?, #first_child, #first_element_child, #focus, #get_animations, #get_attribute, #get_attribute_node, #get_elements_by_class_name, #get_elements_by_tag_name, #get_html, #get_inner_html, #has_attribute?, #has_attributes?, #has_child_nodes?, #id, #id=, #initialize, #inner_html, #inner_html=, #insert_adjacent_element, #insert_adjacent_html, #insert_adjacent_text, #insert_before, #is_connected?, #last_child, #last_element_child, #live_child_nodes, #local_name, #matches?, #namespace_uri, #next_element_sibling, #next_sibling, #normalize, #on, #outer_html, #outer_html=, #owner_document, #parent_element, #parent_node, #path, #prepend, #previous_element_sibling, #previous_sibling, #query_selector, #query_selector_all, #reflected_attr_name, #remove, #remove_attribute, #remove_attribute_node, #remove_child, #replace_child, #replace_children, #replace_with_nodes, #role, #role=, #root_node, #same_node?, #set_attribute, #set_attribute_node, #shadow_root, #slot, #slot=, #style, #tag_name, #text_content, #text_content=, #to_s, #toggle_attribute, #xpath

Methods included from EventTarget

#__internal_deliver_event__, #add_event_listener, #dispatch_event, #invoke_listener, #remove_event_listener

Constructor Details

This class inherits a constructor from Dommy::Element

Instance Method Details

#__js_get__(key) ⇒ Object



3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
# File 'lib/dommy/html_elements.rb', line 3533

def __js_get__(key)
  case key
  when "src"
    src
  when "type"
    type
  when "media"
    media
  when "srcset"
    srcset
  when "sizes"
    sizes
  when "width"
    width
  when "height"
    height
  else
    super
  end
end

#__js_set__(key, value) ⇒ Object



3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
# File 'lib/dommy/html_elements.rb', line 3554

def __js_set__(key, value)
  case key
  when "src", "type", "media", "srcset", "sizes"
    set_reflected_string(key, value)
  when "width"
    self.width = value
  when "height"
    self.height = value
  else
    super
  end
end

#heightObject



3525
3526
3527
# File 'lib/dommy/html_elements.rb', line 3525

def height
  @__node__["height"].to_s.to_i
end

#height=(v) ⇒ Object



3529
3530
3531
# File 'lib/dommy/html_elements.rb', line 3529

def height=(v)
  set_reflected_string("height", v.to_s)
end

#mediaObject



3493
3494
3495
# File 'lib/dommy/html_elements.rb', line 3493

def media
  reflected_string("media")
end

#media=(v) ⇒ Object



3497
3498
3499
# File 'lib/dommy/html_elements.rb', line 3497

def media=(v)
  set_reflected_string("media", v)
end

#sizesObject



3509
3510
3511
# File 'lib/dommy/html_elements.rb', line 3509

def sizes
  reflected_string("sizes")
end

#sizes=(v) ⇒ Object



3513
3514
3515
# File 'lib/dommy/html_elements.rb', line 3513

def sizes=(v)
  set_reflected_string("sizes", v)
end

#srcObject



3477
3478
3479
# File 'lib/dommy/html_elements.rb', line 3477

def src
  reflected_string("src")
end

#src=(v) ⇒ Object



3481
3482
3483
# File 'lib/dommy/html_elements.rb', line 3481

def src=(v)
  set_reflected_string("src", v)
end

#srcsetObject



3501
3502
3503
# File 'lib/dommy/html_elements.rb', line 3501

def srcset
  reflected_string("srcset")
end

#srcset=(v) ⇒ Object



3505
3506
3507
# File 'lib/dommy/html_elements.rb', line 3505

def srcset=(v)
  set_reflected_string("srcset", v)
end

#typeObject



3485
3486
3487
# File 'lib/dommy/html_elements.rb', line 3485

def type
  reflected_string("type")
end

#type=(v) ⇒ Object



3489
3490
3491
# File 'lib/dommy/html_elements.rb', line 3489

def type=(v)
  set_reflected_string("type", v)
end

#widthObject



3517
3518
3519
# File 'lib/dommy/html_elements.rb', line 3517

def width
  @__node__["width"].to_s.to_i
end

#width=(v) ⇒ Object



3521
3522
3523
# File 'lib/dommy/html_elements.rb', line 3521

def width=(v)
  set_reflected_string("width", v.to_s)
end