Class SvgScript

All Implemented Interfaces:
Serializable, Cloneable, ScriptElement, Element, Node

public class SvgScript extends SvgElement implements ScriptElement
Wrapper for the SVG element script.
See Also:
  • Field Details

    • TAG_NAME

      public static final String TAG_NAME
      The tag represented by this element.
      See Also:
    • executed_

      private boolean executed_
    • createdByDomParser_

      private boolean createdByDomParser_
  • Constructor Details

    • SvgScript

      SvgScript(String namespaceURI, String qualifiedName, SgmlPage page, Map<String,DomAttr> attributes)
      Creates a new instance.
      Parameters:
      namespaceURI - the URI that identifies an XML namespace
      qualifiedName - the qualified name of the element type to instantiate
      page - the page that contains this element
      attributes - the initial attributes
  • Method Details

    • isExecuted

      public boolean isExecuted()
      Returns if executed.
      Specified by:
      isExecuted in interface ScriptElement
      Returns:
      if executed
    • setExecuted

      public void setExecuted(boolean executed)
      Sets if executed.
      Specified by:
      setExecuted in interface ScriptElement
      Parameters:
      executed - if executed
    • getSrcAttribute

      public final String getSrcAttribute()
      Returns the value of the attribute src. Refer to the HTML 4.01 documentation for details on the use of this attribute.
      Specified by:
      getSrcAttribute in interface ScriptElement
      Returns:
      the value of the attribute src or an empty string if that attribute isn't defined.
    • getSrcAttributeNormalized

      protected final String getSrcAttributeNormalized()
      Helper for src retrieval and normalization.
      Returns:
      the value of the attribute src with all line breaks removed or an empty string if that attribute isn't defined.
    • getCharsetAttribute

      public final String getCharsetAttribute()
      Returns the value of the attribute charset. Refer to the HTML 4.01 documentation for details on the use of this attribute.
      Specified by:
      getCharsetAttribute in interface ScriptElement
      Returns:
      the value of the attribute charset or an empty string if that attribute isn't defined.
    • getDeferAttribute

      public final String getDeferAttribute()
      Returns the value of the attribute defer. Refer to the HTML 4.01 documentation for details on the use of this attribute.
      Returns:
      the value of the attribute defer or an empty string if that attribute isn't defined.
    • isDeferred

      public boolean isDeferred()
      Returns true if this script is deferred.
      Specified by:
      isDeferred in interface ScriptElement
      Returns:
      true if this script is deferred
    • onAllChildrenAddedToPage

      public void onAllChildrenAddedToPage(boolean postponed)
      Executes the onreadystatechange handler as well as executing the script itself, if necessary. Lifecycle method invoked after a node and all its children have been added to a page, during parsing of the HTML. Intended to be overridden by nodes which need to perform custom logic after they and all their child nodes have been processed by the HTML parser. This method is not recursive, and the default implementation is empty, so there is no need to call super.onAllChildrenAddedToPage() if you implement this method.
      Overrides:
      onAllChildrenAddedToPage in class DomNode
      Parameters:
      postponed - whether to use PostponedAction or no
    • markAsCreatedByDomParser

      public void markAsCreatedByDomParser()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Marks this script as created by javascript. Spec: The following scripts will not execute: scripts in XMLHttpRequest's responseXML documents, scripts in DOMParser-created documents, scripts in documents created by XSLTProcessor's transformToDocument feature, and scripts that are first inserted by a script into a Document that was created using the createDocument() API
      Specified by:
      markAsCreatedByDomParser in interface ScriptElement
    • wasCreatedByDomParser

      public boolean wasCreatedByDomParser()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns true if this frame was created by javascript.
      Specified by:
      wasCreatedByDomParser in interface ScriptElement
      Returns:
      true or false