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 class
HtmlElementTables.DenseElementSet
A set of elements.static class
HtmlElementTables.HtmlElementNames
Maps between element indices and element names.static class
HtmlElementTables.SparseElementMultitable
Maps element to elements to lists of elements.static class
HtmlElementTables.SparseElementToElements
Maps element indices to sets of the same.static class
HtmlElementTables.TextContentModel
For each element, the kinds of character data it can contain.static class
HtmlElementTables.TextContentModelBit
Describes 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 int
TEXT_NODE
Pseudo 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 boolean
canContain(int parent, int child)
True if parent can directly contain child.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.boolean
canContainText(int index)
Whether parsing can produce an element with the given index that contains a text node.String
canonNameForIndex(int index)
The element index for the element with the given name.int
indexForName(String canonName)
The element index for the element with the given name.int
nElementTypes()
The number of element types which is also the exclusive upper bound on element indices.boolean
resumable(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.
-
-