Class: Browser::DOM::Element::Iframe

Inherits:
Browser::DOM::Element show all
Defined in:
opal/browser/dom/element/iframe.rb

Direct Known Subclasses

Object

Constant Summary

Constants inherited from Browser::DOM::Element

Img

Constants inherited from Node

Node::ATTRIBUTE_NODE, Node::CDATA_SECTION_NODE, Node::COMMENT_NODE, Node::DOCUMENT_FRAGMENT_NODE, Node::DOCUMENT_NODE, Node::DOCUMENT_TYPE_NODE, Node::ELEMENT_NODE, Node::ENTITY_NODE, Node::ENTITY_REFERENCE_NOCE, Node::NOTATION_NODE, Node::PROCESSING_INSTRUCTION_NODE, Node::TEXT_NODE

Instance Attribute Summary collapse

Attributes inherited from Browser::DOM::Element

#attribute_nodes, #attributes, #class_name, #class_names, #editable, #height, #id, #inner_html, #offset, #outer_html, #position, #scroll, #size, #style!, #width, #window

Attributes inherited from Node

#child, #children, #document, #element_children, #first_element_child, #last_element_child, #name, #namespace, #next, #next_element, #node_type, #outer_html, #parent, #previous, #previous_element, #value

Instance Method Summary collapse

Methods inherited from Browser::DOM::Element

#/, #=~, #[], #[]=, #add_class, #animate, #animation_queue, #at, #at_css, #at_xpath, #blur, #click, create, #css, #data, def_selector, #edit, #editable?, #fade_in, #fade_out, #fade_toggle, #focus, #focused?, #hide, #inner_dom, #inner_dom=, #inspect, native_is?, native_matches?, new, #remove_attribute, #remove_class, #search, selector, #shadow, #shadow?, #show, #slide_down, #slide_toggle, #slide_up, #style, subclasses, tag_name, #toggle, #toggle_class, #visible?, #xpath

Methods included from Event::Target

#off, #on, #on!, #one, #trigger, #trigger!

Methods inherited from Node

#<<, #==, #>>, #add_child, #add_next_sibling, #add_previous_sibling, #ancestors, #append_to, #attached?, #blank?, #cdata?, #clear, #comment?, #content, #content=, #custom?, #document?, #elem?, #fragment?, #initialize, #initialize_copy, new, #parse, #path, #prepend_to, #remove, #remove_child, #replace, #text?, #traverse

Methods included from NativeCachedWrapper

#restricted?, #set_native_reference

Constructor Details

This class inherits a constructor from Browser::DOM::Node

Instance Attribute Details

#content_documentDocument (readonly)

Returns document of content of this iframe.

Returns:

  • (Document)

    document of content of this iframe



21
22
23
# File 'opal/browser/dom/element/iframe.rb', line 21

def content_document
  DOM(`#@native.contentDocument || #@native.contentWindow.document`)
end

#content_windowWindow (readonly)

Returns window of content of this iframe.

Returns:

  • (Window)

    window of content of this iframe



15
16
17
# File 'opal/browser/dom/element/iframe.rb', line 15

def content_window
  Browser::Window.new(`#@native.contentWindow`)
end

#srcString

Returns the URL of the page to embed.

Returns:

  • (String)

    the URL of the page to embed



10
# File 'opal/browser/dom/element/iframe.rb', line 10

alias_native :src

Instance Method Details

#send(message, options = {}) ⇒ Object

Send a message to the iframe content's window.

Parameters:

  • message (String)

    the message

  • options (Hash) (defaults to: {})

    optional to: target



29
30
31
# File 'opal/browser/dom/element/iframe.rb', line 29

def send(message, options={})
  content_window.send(message, options)
end