\HTML5_TreeBuilder
Synopsis
class HTML5_TreeBuilder
{
- // constants
- const INITIAL = 0;
- const BEFORE_HTML = 1;
- const BEFORE_HEAD = 2;
- const IN_HEAD = 3;
- const IN_HEAD_NOSCRIPT = 4;
- const AFTER_HEAD = 5;
- const IN_BODY = 6;
- const IN_CDATA_RCDATA = 7;
- const IN_TABLE = 8;
- const IN_TABLE_TEXT = 9;
- const IN_CAPTION = 10;
- const IN_COLUMN_GROUP = 11;
- const IN_TABLE_BODY = 12;
- const IN_ROW = 13;
- const IN_CELL = 14;
- const IN_SELECT = 15;
- const IN_SELECT_IN_TABLE = 16;
- const IN_FOREIGN_CONTENT = 17;
- const AFTER_BODY = 18;
- const IN_FRAMESET = 19;
- const AFTER_FRAMESET = 20;
- const AFTER_AFTER_BODY = 21;
- const AFTER_AFTER_FRAMESET = 22;
- const SPECIAL = 100;
- const SCOPING = 101;
- const FORMATTING = 102;
- const PHRASING = 103;
- const NO_QUIRKS = 200;
- const QUIRKS_MODE = 201;
- const LIMITED_QUIRKS_MODE = 202;
- const MARKER = 300;
- const NS_HTML = NULL;
- const NS_MATHML = 'http://www.w3.org/1998/Math/MathML';
- const NS_SVG = 'http://www.w3.org/2000/svg';
- const NS_XLINK = 'http://www.w3.org/1999/xlink';
- const NS_XML = 'http://www.w3.org/XML/1998/namespace';
- const NS_XMLNS = 'http://www.w3.org/2000/xmlns/';
- const SCOPE = 0;
- const SCOPE_LISTITEM = 1;
- const SCOPE_TABLE = 2;
- // members
- public array $stack = ;
- public $content_model;
- private $mode;
- private $original_mode;
- private $secondary_mode;
- private $dom;
- private boolean $foster_parent = false;
- private array $a_formatting = ;
- private $head_pointer = NULL;
- private $form_pointer = NULL;
- private boolean $flag_frameset_ok = true;
- private boolean $flag_force_quirks = false;
- private boolean $ignored = false;
- private $quirks_mode = NULL;
- private integer $ignore_lf_token = 0;
- private boolean $fragment = false;
- private $root;
- private array $scoping = ;
- private array $formatting = ;
- private array $special = ;
- private $pendingTableCharacters;
- private $pendingTableCharactersDirty;
- // methods
- private void strConst()
- public void __construct()
- public void getQuirksMode()
- public void emitToken()
- private void insertElement()
- private void insertText()
- private void insertComment()
- private void appendToRealParent()
- private bool|null elementInScope()
- private bool reconstructActiveFormattingElements()
- private void clearTheActiveFormattingElementsUpToTheLastMarker()
- private void generateImpliedEndTags()
- private int getElementCategory()
- private void clearStackToTableContext()
- private void resetInsertionMode()
- private void closeCell()
- private void processWithRulesFor()
- private void insertCDATAElement()
- private void insertRCDATAElement()
- private bool getAttr()
- private mixed getCurrentTable()
- private mixed getFosterParent()
- public void fosterParent()
- private void printStack()
- private void printActiveFormattingElements()
- public bool currentTableIsTainted()
- public void setupContext()
- public mixed adjustMathMLAttributes()
- public mixed adjustSVGAttributes()
- public mixed adjustForeignAttributes()
- public void insertForeignElement()
- public DOMDocument|DOMNodeList save()
Constants
Name | Value |
---|---|
INITIAL | 0 |
BEFORE_HTML | 1 |
BEFORE_HEAD | 2 |
IN_HEAD | 3 |
IN_HEAD_NOSCRIPT | 4 |
AFTER_HEAD | 5 |
IN_BODY | 6 |
IN_CDATA_RCDATA | 7 |
IN_TABLE | 8 |
IN_TABLE_TEXT | 9 |
IN_CAPTION | 10 |
IN_COLUMN_GROUP | 11 |
IN_TABLE_BODY | 12 |
IN_ROW | 13 |
IN_CELL | 14 |
IN_SELECT | 15 |
IN_SELECT_IN_TABLE | 16 |
IN_FOREIGN_CONTENT | 17 |
AFTER_BODY | 18 |
IN_FRAMESET | 19 |
AFTER_FRAMESET | 20 |
AFTER_AFTER_BODY | 21 |
AFTER_AFTER_FRAMESET | 22 |
SPECIAL | 100 |
SCOPING | 101 |
FORMATTING | 102 |
PHRASING | 103 |
NO_QUIRKS | 200 |
QUIRKS_MODE | 201 |
LIMITED_QUIRKS_MODE | 202 |
MARKER | 300 |
NS_HTML | NULL |
NS_MATHML | 'http://www.w3.org/1998/Math/MathML' |
NS_SVG | 'http://www.w3.org/2000/svg' |
NS_XLINK | 'http://www.w3.org/1999/xlink' |
NS_XML | 'http://www.w3.org/XML/1998/namespace' |
NS_XMLNS | 'http://www.w3.org/2000/xmlns/' |
SCOPE | 0 |
SCOPE_LISTITEM | 1 |
SCOPE_TABLE | 2 |
Members
private
- $a_formatting
- $dom
- $flag_force_quirks
- $flag_frameset_ok
- $form_pointer
- $formatting
- $foster_parent
- $fragment
- $head_pointer
- $ignore_lf_token
- $ignored
- $mode
- $original_mode
- $pendingTableCharacters
- $pendingTableCharactersDirty
- $quirks_mode
- $root
- $scoping
- $secondary_mode
- $special
public
- $content_model
- $stack
Methods
private
- appendToRealParent()
- clearStackToTableContext()
- clearTheActiveFormattingElementsUpToTheLastMarker()
- closeCell()
- elementInScope()
- generateImpliedEndTags()
- getAttr()
- getCurrentTable()
- getElementCategory()
- getFosterParent()
- insertCDATAElement()
- insertComment()
- insertElement()
- insertRCDATAElement()
- insertText()
- printActiveFormattingElements() — For debugging, prints active formatting elements
- printStack() — For debugging, prints the stack
- processWithRulesFor()
- reconstructActiveFormattingElements()
- resetInsertionMode()
- strConst() — Converts a magic number to a readable name. Use for debugging.
public
- __construct() — HTML5_TreeBuilder constructor.
- adjustForeignAttributes()
- adjustMathMLAttributes()
- adjustSVGAttributes()
- currentTableIsTainted()
- emitToken() — Process tag tokens
- fosterParent()
- getQuirksMode()
- insertForeignElement()
- save()
- setupContext() — Sets up the tree constructor for building a fragment.