Commit Graph
277 Commits
Author SHA1 Message Date
iska 95aa60a6e0 Add README file with initial description
Although the parsing algorithm is complete the version 0.1.0 is far from ready to be called a "kit".
2015-04-20 21:51:30 +02:00
iska 150d49b010 Add MIT License 2015-04-19 20:33:53 +02:00
iska 5aaa223437 Improve error message for the Tokenizer tests 2015-04-17 00:53:12 +02:00
iska 1af7e9ea89 Reorder test classes and their groups 2015-04-17 00:45:15 +02:00
iska 1829af229a Add Ordered Dictionary tests
- Remove index checks, an exception will be thrown by the underlying array
- Fix indexed subscript method name
- Change behaviour of "setObject:forKey:atIndex:" so that an existing key is moved
2015-04-17 00:43:47 +02:00
iska 27c020371d Rename NSString category method for clarity and add category tests 2015-04-16 20:37:49 +02:00
iska 575dbc50d4 Add HTML Parser implementation for the <template> tag
Also activate the <template> tests
2015-04-16 20:03:18 +02:00
iska 654dffcc92 Add initial implementation for HTML Template & Document Fragment
https://html.spec.whatwg.org/multipage/scripting.html#the-template-element
2015-04-16 00:13:15 +02:00
iska 01adbf4437 Fix method name typo in stack of open elements 2015-04-13 00:28:23 +02:00
iska dbae9dd55f Organize source code into groups 2015-04-12 19:48:48 +02:00
iska 4ddf8e60fd Remove the dynamic selector-state-machine from the parser class
Instead, use a plain-old switch-case.

Performance boost (along with the character token changes) about 6% (reference to baseline)
2015-04-12 19:45:50 +02:00
iska c524b25051 Add HTML5 Lib's test detail message to all assertions in the Tree Construction tests 2015-04-12 19:35:53 +02:00
iska d8a55db4dc Change the implementation of the character token and string methods to reduce initialization overhead
All methods operate on the same NSString instance instead of creating a new character token, e.g. when
trimming or splitting the leading whitespace.
2015-04-12 18:33:10 +02:00
iska 0911e46dba Add HTMLKit Parser Performance test
This tests measures the parsing time of the HTML Living Standard page, about 8.1MB in
size (as of 23 October 2014)
2015-04-12 18:33:01 +02:00
iska af55cf01cb Reinitialize the tokenizer when parsing the same input as a fragment case multiple times
The tokenizer is a NSEnumerator, thus cannot be reseted, hence the change.
2015-04-11 22:34:07 +02:00
iska 40f4ce4cb1 Remove the dynamic selector-state-machine from the tokenizer class
Instead, use a plain-old switch-case. Another 18% performance boost.

This change results in a total performance boost of about 65% (reference to baseline)
2015-04-11 22:31:34 +02:00
iska 4158ef0237 Use a accumulator-character-token in the tokenizer to reduce the initialization overhead
Initializing character tokens, and the NSString objects they use, results in a relatively high overhead. The tokenizer
now accumulated all successive characters in on accumulator token until a non-character token is emitted.

This change reduces the execution time of the performance test on the local machine by 48% (reference to baseline)
2015-04-11 22:12:51 +02:00
iska 936c76d142 Remove the superfluous allObjects method from the tokenizer class
Being a NSEnumerator, the tokenizer cannot be reset, hence the change in the tests to create a new
instance for each iteration.
2015-04-11 21:47:55 +02:00
iska 8bfccb124f Use the debug description for Tree Construction tests which dumps a tree structure 2015-04-11 21:44:40 +02:00
iska 0ac909fb66 Add HTML5 Lib Tree Construction tests
https://github.com/html5lib/html5lib-tests
2015-04-11 00:51:37 +02:00
iska 067e8c7cc7 Fix insertion mode switch in the "after frameset" phase 2015-04-11 00:45:30 +02:00
iska 68d4eb03ce Fix tag-name check for "td" & "th" end-tag handling in "in cell" phase 2015-04-11 00:44:20 +02:00
iska 23f8ec35fb Fix element-in-scope check for end-tag handling in "in body" phase 2015-04-11 00:43:18 +02:00
iska bf30dd85b9 Fix token-cast when adjusting the foreign attributes for token 2015-04-11 00:42:07 +02:00
iska 2a2a21d1fa Fix assignment for the character token in the "in table" phase 2015-04-11 00:40:12 +02:00
iska ca02086636 Change while-loop to a for-loop in the any-other-end-tag in "in body" phase 2015-04-11 00:39:26 +02:00
iska 327f2a6679 Fix character token handling in the "foreign" insertion mode 2015-04-11 00:38:16 +02:00
iska 50761a1444 Fix switch in the "select" start tag in the "in body" insertion mode 2015-04-11 00:37:29 +02:00
iska db0bb51bc5 Fix the "isindex" attributes handling in the "in body" insertion mode 2015-04-11 00:36:37 +02:00
iska 27817fb7ec Fix start-tag handling for "object" tags in the "in body" insertion mode 2015-04-11 00:36:02 +02:00
iska 7c1b04e9a4 Fix start-tag handling for the "li", "dd" & "dt" case in the "in body" insertion mode 2015-04-11 00:35:13 +02:00
iska 082d573cf3 Fix "frameset" case in the start-tag handling of the "in body" insertion mode 2015-04-11 00:34:27 +02:00
iska 99ea01a908 Fix character token handling in the "in body" insertion mode 2015-04-11 00:33:43 +02:00
iska abad8f0a62 Fix "frameset" case in the "after head" insertion mode 2015-04-11 00:33:03 +02:00
iska 8007b4817c Fix reseting-the-insertion-mode method 2015-04-11 00:32:20 +02:00
iska 280339e2f0 Fix adoption agency algorithm 2015-04-11 00:31:37 +02:00
iska aa008900c9 Fix the input stream reader method for the CDATA Section state
- All carriage returns must be converted to line feeds
- All line feeds following a carriage return must be ignored

https://html.spec.whatwg.org/multipage/syntax.html#preprocessing-the-input-stream
2015-04-11 00:18:39 +02:00
iska 27375e3a47 Fix the default case in the "after after frameset" phase 2015-04-09 21:24:14 +02:00
iska 34e88898f2 Fix inserting comment calls in the "initial" & the "after head" insertion modes 2015-04-09 21:23:25 +02:00
iska e362bf717f Add length-check for the character token when ignoring a line-feed character after <textarea> 2015-04-09 21:22:16 +02:00
iska b6d30da180 Fix initializing tokenizer state in the parser
Add check for HTML namespace for the context element
2015-04-09 21:21:34 +02:00
iska bf821fb70d Fix MatML attribute adjustment
Case was wrong and tagName was checked as key instead of "definitionurl"
2015-04-09 21:20:50 +02:00
iska c60f308ca5 Fix HTML Element copy method
Was missing the namespace copy
2015-04-09 21:20:04 +02:00
iska 2c387c13ef Add parameterless initializer for the DOCTYPE Token
Otherwise the token has an incorrect type when inited via a "new" call
2015-04-08 21:48:12 +02:00
iska 7ca60ea53a Add nil-check for the input string when initializing the parser 2015-04-08 20:41:40 +02:00
iska 2f58d1364a Add nil-check in the tokenizer when emitting a nil-string as character token 2015-04-08 20:41:04 +02:00
iska 1b05db8e36 Fix tokenizer's CDATA-Section state
The closing "]]>" was not consumed
2015-04-08 20:40:43 +02:00
iska 61f4f01288 Add nil-check when clearing the active formatting elements upto last marker 2015-04-08 20:40:03 +02:00
iska 4231cc9608 Fix scanning input stream upto a given string
The consumed string variable should not be initialized so that it stays nil if nothing
was scanned
2015-04-08 20:39:33 +02:00
iska 79402946ec Fix the "after frameset" insertion mode handling for "noframes" start tag and "html" end tag 2015-04-08 20:37:53 +02:00