Commit Graph
218 Commits
Author SHA1 Message Date
iska dabf24fa1c Change block-based implementation the "in-body" start-tag handling for "li", "dd" & "dt" to for-loop
Easier to read and comprehend
2015-04-05 18:00:20 +02:00
iska e5738cc48f Fix "in-table-row" phase's common case
Clear back to table-row context instead of table
2015-04-05 17:58:39 +02:00
iska b65d602d12 Fix "in-table-body" phase's common case 2015-04-05 17:57:31 +02:00
iska 89ff209f2d Add missing case in the "in-table" start-tag handling
Entry for "colgroup" was missing
2015-04-05 17:55:58 +02:00
iska c020e3ba6a Fix character-token case in the "in-table-text" phase 2015-04-05 13:53:55 +02:00
iska 919e7f8790 Remove wrong-entry from the "in-body" phase's start-tag-handling
This entry is a part of the end-tag-handling
2015-04-05 13:46:16 +02:00
iska c25210b812 Fix inserting-characters method when the appropriate place for insertion is not as a last-node 2015-04-05 13:44:58 +02:00
iska d38f6df2d7 Fix premature check-and-return in the tree-construction-dispatcher 2015-04-05 13:43:10 +02:00
iska 439f6aba19 Refactor blocks-based implementation to simple while-loops in the reconstruct-active-formatting-elements
Much easier to read and comprehend.
2015-04-05 13:35:31 +02:00
iska 3df247f91f Add HTML Node method to pass own child nodes to another node
This is used in the adoption-agency-algorithm to copy all text-child-nodes from the furthest-block
to the new-element
2015-04-05 13:33:46 +02:00
iska 664e555347 Add index-bounds-check to the list of active formatting elements when inserting at index
In some cases the bookmark-index in the adoption-agency-algorithm lies outside the lists bounds, in this
case the new elements is to be inserted at the end of the list.
2015-04-05 13:31:59 +02:00
iska c369abbfee Add "Noah's Ark Clause", three per family, to the list of active formatting elements
When adding new elements to the list, if there are already three same elements present, then remove
the oldest one before inserting the new.
2015-04-05 13:30:34 +02:00
iska a62ccfdc51 Fix loop in the "foreign content" phase's end-tag handling 2015-04-05 13:28:31 +02:00
iska caba3efd95 Fix "in-row" insertion mode and add the corresponding logic to clear the stack back to row context 2015-04-05 13:27:45 +02:00
iska b73be50e2b Add nil-checks for popping-methods in stack of open elements 2015-04-05 13:26:39 +02:00
iska 31178b32cd Add debug-description methods for HTML Node and Parser's structures
Stack of open elements & list of active formatting elements dump the underlying array's
description. The HTML Node prints out the tree description as object's info and the
outer-html for Xcode debugger's quick-look.
Tremendous help when debugging.
2015-04-04 22:58:41 +02:00
iska d1a4aeb5e1 Add HTML Parser methods for parsing a document and document fragments
The parser is initialized with a HTML string which can be parsed as a document or a document
fragment. When parsing a fragment a context element should be provided.
It is also possible to parse the same string as a fragment for different context elements. In this case
the parser reset its internal state and runs the parsing algorithm again. Parsing a fragment for the
same context element runs the algorithm only once, since the parser caches the context element
and the parsing results.
2015-04-04 02:30:08 +02:00
iska 5a140220b1 Fix HTML Node parent-related property references to "weak"
A node shouldn't have a strong reference to its parent or owner document
2015-04-04 02:17:42 +02:00
iska 418913991d Fix HTML Node owner-document getter method 2015-04-04 02:16:15 +02:00
iska bdb2e86968 Fix parent-node-setting in HTML Node insertion methods 2015-04-04 02:15:37 +02:00
iska 4151bf8b7a Add HTML Node methods to append an array of nodes and remove all child nodes 2015-04-04 02:15:09 +02:00
iska d14c1b5ae1 Fix setting document type in HTML Document 2015-04-04 02:14:06 +02:00
iska c0f6639a60 Add missing SVG-element-name-case adjustment in the foreign-content processing 2015-04-01 01:09:41 +02:00
iska fc89010c1c Fix HTML Element description when a namespace is used 2015-04-01 01:08:45 +02:00
iska d716c3a678 Add Document Type to the children-nodes list in the HTML Document 2015-04-01 01:08:23 +02:00
iska 5562875237 Fix Tokenizer bug in DataDoubleEscapeEnd state 2015-04-01 01:07:52 +02:00
iska 8add9d1794 Fix Tokenizer bug in DataDoubleEscapeStart state 2015-04-01 01:07:33 +02:00
iska 36b74b5766 Add HTML fragment serialization (inner & outer HTML)
https://html.spec.whatwg.org/multipage/syntax.html#serialising-html-fragments
2015-03-31 01:01:41 +02:00
iska 0535cdbbb3 Fix key-check in the Ordered Dictionary class 2015-03-30 23:32:15 +02:00
iska 880f36ee05 Group enumeration method together in the Node class 2015-03-30 23:31:58 +02:00
iska 22e397b1f4 Add a tree-description method for HTML Node
The tree description method dumps the HTML tree rooted at this node in the same style
as the HTML5Lib tests
2015-03-30 23:30:41 +02:00
iska e157e746a0 Add "description" methods for HTML Nodes 2015-03-30 23:28:34 +02:00
iska 83c9841122 Add implementation for HTML Node Tree Enumerator
Tree-Order (pre-order) enumeration for HTML Node and its descendants
2015-03-29 00:00:01 +01:00
iska 3b4970202d Move Tokenizer tests loading into the helper HTML5Lib Tokenizer Test class
Helps keeping the test-case class uncluttered
2015-03-25 23:01:42 +01:00
iska 22e6aff5e9 Refactor and organize code in the HTML Parser 2015-03-25 22:39:35 +01:00
iska 78fac7527b Fix parent node setting in HTML Node 2015-03-25 22:38:55 +01:00
iska bfb653e82e Add attributes-related methods to HTML Element 2015-03-25 22:37:52 +01:00
iska 7fb04f3394 Refactor Tokenizer tests into separate group and generate the test cases dynamically
Instead of loading and running the HTML5Lib test files manually, the Xcode test cases are generated
on start for all the HTML5Lib tokenizer tests. Also, the performance test is moved into its own class.

This setup shouldn't require any extra maintenance when HTML5Lib adds new tokenizer test cases.
2015-03-24 23:50:19 +01:00
iska b6e911a941 Restore missing method implementation in the Stack of Open Elements
Gone missing here: e95d45b534
2015-03-22 16:01:01 +01:00
iska ce78cf2b70 Fix data initialization in the HTMLText node 2015-03-22 15:59:55 +01:00
iska c0960d45af Fix the copy method in the HTML Node
Use self.class instead of HTMLNode to preserve type info
2015-03-22 15:59:24 +01:00
iska da8f601e25 Remove set-parent-element from the node adoption method in the HTML Document 2015-03-22 15:58:37 +01:00
iska a9d4b4ce94 Add a writable private ready-state property for HTML Document 2015-03-22 15:57:55 +01:00
iska 514561dc38 Refactor "adoption agency algorithm" blocks into their corresponding wrappers 2015-03-22 15:57:19 +01:00
iska 7347e7a4f7 Add error-emit in the "initial" insertion mode when a DOCTYPE is missing 2015-03-22 15:43:30 +01:00
iska 3d0ff78108 Fix the "in body start tag" phase
A missing bracket "}" messed up the whole thing
2015-03-22 15:09:02 +01:00
iska d9dade5fb0 Add wrapper class for the "list of active formatting elements" 2015-03-22 15:07:40 +01:00
iska 8e427cbb3f Fix check for the override target in the "appropriate location for inserting node" 2015-03-22 00:20:10 +01:00
iska 30f7bba377 Fix selector names for the Parser's insertion modes table
The ":" was missing and the selector could not be found.
2015-03-22 00:16:08 +01:00
iska e95d45b534 Fix clearing the stack of open elements for the "in table body" phase 2015-03-22 00:13:55 +01:00