• The document was being rewritten when tree building and therefore not being output when the parser completed.
• Allowed DOM to be instanced, containing an implementation and document so the tree builder can create a document when a doctype is found.
• PHP's DOM returns null when the namespace isn't specified, so it was causing the dispatcher to parse tokens in foreign content when it wasn't supposed to.
• Added debugging output for TreeBuilder, showing the insertion mode and foreign if content is foreign.
• Fixed syntax errors that weren't caught in last commit
• Made the token insertion methods static in Parser so that ActiveFormattingElementsList::reconstruct can insert methods without having to access the Parser instance itself. Might do it differently later, but this works for now.
• Since the fragment context that is passed to Stack can be null it is necessary to check whether the argument is valid before continuing.
• Parser::instance is now protected as all classes are now decoupled.
Changing static:: to self:: makes constant de-referencing a
compile-time operation rather than run-time, potentially improving
performance. As constants cannot be overridden by extending classes,
there is no advantage to using static:: for these constants
• Changed the name of the parser instance variable from Parser::$self to Parser::$instance
• Added parse errors for entities into ParseError.
• Moved Parser::fixDOM to DOM::fixIdAttributes.
• Added an exception for when the tokenizer enters an invalid state (infinite looping).
• Made ParseError use Parser::$instance->data instead of a passed around DataStream object.
• Made names of storage property in Stack and ActiveFormattingElementsList consistent to elsewhere
• Parser has its own public static variable that is an intance of itself, so ActiveFormattingElementsList can use that instead of passing an instance around.
• Added separate exception for ActiveFormattingElementsList
• Removed html5.php; shouldn't have been there to begin with.
• Fixed bug where when feeding ParseError::trigger the wrong number of parameters it wouldn't have the correct exception to throw.
• Changes to the spec since the last edit required a rewrite of the tree building algorithm.
• Searching the stack should search from reverse by default because the spec works that way.
• Rewrote StartTagToken because the token attributes need to be easily editable as per the spec foreign attributes are edited before the token goes through the element creation process and not after.
• Yes, there's a goto. Sue me.