Class: Dommy::HTMLScriptElement
- Inherits:
-
HTMLElement
- Object
- Element
- HTMLElement
- Dommy::HTMLScriptElement
- Defined in:
- lib/dommy/html_elements.rb
Overview
<script> — src / type / async / defer / text.
Constant Summary collapse
- CLASSIC_SCRIPT_TYPES =
The classic-script source to execute now that this element is connected, or nil if it must not run: a
srcscript (no network here), a non-classic type (module/JSON/etc.), an empty body, or one that already ran. The "already started" flag (set on first call) makes execution happen at most once, even if the node is re-inserted. The host eval is wired by the JS bridge via Document#script_runner. Module scripts are excluded — they need module scope / import resolution the classic eval path can't provide (left to a future module loader). ["", "text/javascript", "application/javascript", "application/ecmascript", "text/ecmascript"].freeze
Constants inherited from Element
Element::ADJACENT_POSITIONS, Element::APPROX_CHAR_PX, Element::APPROX_LINE_PX, 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::HTML_NAMESPACE, Element::INLINE_TAGS, Element::PROCESSING_INSTRUCTION_NODE, Element::REFLECTED_TOKEN_LIST_HOSTS, Element::SHADOW_HOST_TAGS, Element::SVG_NAMESPACE, 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::HTML_NAMESPACE, Node::PROCESSING_INSTRUCTION_NODE, Node::TEXT_NODE, Node::XMLNS_NAMESPACE, Node::XML_NAMESPACE
Instance Attribute Summary
Attributes inherited from Element
Instance Method Summary collapse
-
#__internal_mark_script_already_started__ ⇒ Object
Set the HTML "already started" flag without running anything.
-
#__internal_take_pending_module__ ⇒ Object
A
type="module"script to evaluate now, or nil if it must not run (a non-module type, an empty inline body, or one that already ran). - #__internal_take_pending_script__ ⇒ Object
-
#__internal_take_pending_src__ ⇒ Object
The classic-script
srcto fetch and execute now, or nil if it must not run: an inline script (no src), a non-classic type (module/JSON/etc.), or one that already ran. - #__js_get__(key) ⇒ Object
- #__js_set__(key, value) ⇒ Object
-
#text ⇒ Object
textis an alias for textContent on