Class HTMLTagBalancer.Info

java.lang.Object
org.htmlunit.cyberneko.HTMLTagBalancer.Info
Enclosing class:
HTMLTagBalancer

public static class HTMLTagBalancer.Info extends Object
Element info for each start element. This information is used when closing unbalanced inline elements. For example:
 <i>unbalanced <b>HTML</i> content</b>
 

It seems that it is a waste of processing and memory to copy the attributes for every start element even if there are no unbalanced inline elements in the document. However, if the attributes are not saved, then important attributes such as style information would be lost.

Author:
Andy Clark
  • Field Details

    • element

      public final HTMLElements.Element element
      The element.
    • qname

      public final QName qname
      The element qualified name.
    • attributes

      public XMLAttributes attributes
      The element attributes.
  • Constructor Details

    • Info

      public Info(HTMLElements.Element element, QName qname)
      Creates an element information object.

      Note: This constructor makes a copy of the element information.

      Parameters:
      element - The HTML element definition.
      qname - The element's qualified name (will be deep-copied).
    • Info

      public Info(HTMLElements.Element element, QName qname, XMLAttributes attributes)
      Creates an element information object.

      Note: This constructor makes a deep copy of the qualified name and, for inline elements, of the attributes so that formatting elements can be re-opened with their original attributes.

      Parameters:
      element - The HTML element definition.
      qname - The element's qualified name (will be deep-copied).
      attributes - The element attributes to copy, or null if no attribute snapshot is needed.
  • Method Details

    • toString

      public String toString()
      Simple representation to make debugging easier.
      Overrides:
      toString in class Object