Package org.owasp.html
Class HtmlElementTables
- java.lang.Object
-
- org.owasp.html.HtmlElementTables
-
public final class HtmlElementTables extends Object
Metadata about HTML elements.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHtmlElementTables.DenseElementSetA set of elements.static classHtmlElementTables.HtmlElementNamesMaps between element indices and element names.static classHtmlElementTables.SparseElementMultitableMaps element to elements to lists of elements.static classHtmlElementTables.SparseElementToElementsMaps element indices to sets of the same.static classHtmlElementTables.TextContentModelFor each element, the kinds of character data it can contain.static classHtmlElementTables.TextContentModelBitDescribes properties of the content that could be added to an element as a result of a parse that includes its open tag.
-
Field Summary
Fields Modifier and Type Field Description static intTEXT_NODEPseudo element index for text nodes.
-
Constructor Summary
Constructors Constructor Description HtmlElementTables(HtmlElementTables.HtmlElementNames elementNames, org.owasp.html.HtmlElementTables.DenseElementBinaryMatrix canContain, org.owasp.html.HtmlElementTables.DenseElementBinaryMatrix closedOnClose, org.owasp.html.HtmlElementTables.DenseElementBinaryMatrix closedOnOpen, HtmlElementTables.SparseElementToElements explicitClosers, HtmlElementTables.SparseElementMultitable impliedElements, HtmlElementTables.TextContentModel textContentModel, HtmlElementTables.DenseElementSet resumable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanContain(int parent, int child)True if parent can directly contain child.booleancanContainPlainText(int index)Whether parsing can produce an element with the given index that contains a text node that has human readable text instead of script or style source code.booleancanContainText(int index)Whether parsing can produce an element with the given index that contains a text node.StringcanonNameForIndex(int index)The element index for the element with the given name.intindexForName(String canonName)The element index for the element with the given name.intnElementTypes()The number of element types which is also the exclusive upper bound on element indices.booleanresumable(int index)The elements that can be resumed after misnested inline tags.static boolean[]unpack(int[] packed, int length)Unpacks a boolean[] from an array of ints.
-
-
-
Field Detail
-
TEXT_NODE
public static final int TEXT_NODE
Pseudo element index for text nodes.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HtmlElementTables
public HtmlElementTables(HtmlElementTables.HtmlElementNames elementNames, org.owasp.html.HtmlElementTables.DenseElementBinaryMatrix canContain, org.owasp.html.HtmlElementTables.DenseElementBinaryMatrix closedOnClose, org.owasp.html.HtmlElementTables.DenseElementBinaryMatrix closedOnOpen, HtmlElementTables.SparseElementToElements explicitClosers, HtmlElementTables.SparseElementMultitable impliedElements, HtmlElementTables.TextContentModel textContentModel, HtmlElementTables.DenseElementSet resumable)
-
-
Method Detail
-
canContain
public boolean canContain(int parent, int child)True if parent can directly contain child.
-
indexForName
public int indexForName(String canonName)
The element index for the element with the given name.
-
canonNameForIndex
public String canonNameForIndex(int index)
The element index for the element with the given name.
-
resumable
public boolean resumable(int index)
The elements that can be resumed after misnested inline tags.
-
canContainText
public boolean canContainText(int index)
Whether parsing can produce an element with the given index that contains a text node.
-
canContainPlainText
public boolean canContainPlainText(int index)
Whether parsing can produce an element with the given index that contains a text node that has human readable text instead of script or style source code.
-
nElementTypes
public int nElementTypes()
The number of element types which is also the exclusive upper bound on element indices.
-
unpack
public static boolean[] unpack(int[] packed, int length)Unpacks a boolean[] from an array of ints. This allows us to store largish boolean[]s in relatively small numbers of bytecode instructions.
-
-