Commit Graph

310 Commits

Author SHA1 Message Date
iska 8490d4d2ca Add tokenizer method to get next-non-space token 2015-05-16 14:22:44 +02:00
iska 52b850317e Remove selector method to match a HTML Element used in the simple selectors
Selectors have only one method to implement, the Node Filter's acceptNode
2015-05-15 22:37:56 +02:00
iska f5d970ba87 Add implementation for a CSS Simple Sequence of Selectors
http://www.w3.org/TR/css3-selectors/#sequence
2015-05-15 02:37:51 +02:00
iska 0c8fd754c3 Add CSS Simple Selector protocol to the Type & Attribute selectors 2015-05-15 02:29:18 +02:00
iska 4f03e00003 Add a protocol for CSS Simple Selectors
Simple Selectors should conform to this protocol in order to be addable to the Simple Selector Sequence.
2015-05-15 02:28:03 +02:00
iska 62b385d9b4 Add test cases for changing selectors' properties for the Type & Attribute selectors 2015-05-14 21:42:53 +02:00
iska a7a30a7cbf Add convenience initializer for the Type Selector 2015-05-14 21:27:08 +02:00
iska 221b085fe5 Add tests for the Type & Attribute selectors 2015-05-14 21:18:55 +02:00
iska a2d9e65f0e Fix Attribute Selector for the Hyphen-case
Check for prefix instead of suffix with "-"
2015-05-14 21:16:29 +02:00
iska 745d0f72a7 Add convenience methods to create Class & ID Attribute Selectors
http://www.w3.org/TR/css3-selectors/#class-html
http://www.w3.org/TR/css3-selectors/#id-selectors
2015-05-14 21:15:39 +02:00
iska c401c3ca2c Add umbrella header for all CSS Selectors 2015-05-14 17:09:17 +02:00
iska 3cb5ed9a42 Add implementation for a CSS Attribute Selector
http://www.w3.org/TR/css3-selectors/#attribute-selectors
2015-05-14 16:32:47 +02:00
iska acec99ffea Add implementation for a CSS Type Selector
Matches an Element with the given tag name or all Elements (universal selector)
http://www.w3.org/TR/css3-selectors/#type-selectors
2015-05-14 16:23:23 +02:00
iska 7c58268dfd Add initial implementation for the CSS Selector base class 2015-05-14 16:21:26 +02:00
iska c87076b470 Add a NSCharacterSet category for HTML Whitespace characters
http://www.w3.org/TR/css3-selectors/#whitespace
2015-05-14 16:19:31 +02:00
iska 81a20f0333 Add HTML Node Filter protocol
https://dom.spec.whatwg.org/#interface-nodefilter
2015-05-14 16:15:41 +02:00
iska 4fcaf4c810 Add implementation for a CSS Selector Tokenizer
The Tokenizer is based on a flex-generated lexer for the grammar defined in the CSS Selectors Level 3 Spec
http://www.w3.org/TR/css3-selectors/#lex
2015-05-09 18:58:50 +02:00
iska 2c9f68e2ea Add Node methods to prepend nodes 2015-05-02 21:08:21 +02:00
iska 3d3e4d52b4 Add a NO_DOM_CHECKS macro to disable validations for DOM manipulations
DOM validation checks are expensive. This macro would allow for removing these checks from the compiled
product, which would increase performance by about 20-30%. However, the user is responsible for the validity
of the manipulations and the resulting DOM.
2015-05-02 20:52:03 +02:00
iska bf061d6367 Add support for inserting a Document Fragment
Previous implementation would just insert the fragment as a child node, whereas it should insert its
child nodes.
2015-05-02 20:47:40 +02:00
iska 40baea8ece Move tests for Mutation Algorithms into separate class 2015-04-27 19:43:43 +02:00
iska a2c6f22495 Add comments for insertion and replacement tests 2015-04-25 22:31:47 +02:00
iska b2f1864c80 Add tests for validating the replacing child node within a Document 2015-04-25 22:31:12 +02:00
iska cffe1cc703 Fix validation for replacing a child node and refactor common logic into a block 2015-04-25 22:25:31 +02:00
iska bc6bbf1d63 Add tests for validation for inserting an Element & Document Type into a Document 2015-04-25 15:27:25 +02:00
iska 71aed89574 Fix validation for inserting a Document Fragment into a Document 2015-04-25 15:13:43 +02:00
iska 36960dceb3 Rename node parameter in the validation method of HTML Node for clarity 2015-04-25 13:21:08 +02:00
iska 3ddfa15b15 Add tests to validate the insertions of nodes into a given parent
These tests check the implementation of the Mutation Algorithms of the DOM Standard
https://dom.spec.whatwg.org/#mutation-algorithms
2015-04-25 13:20:15 +02:00
iska 071742fb27 Add default initializers for HTML Comment, Document Type & Document Fragment 2015-04-25 13:17:02 +02:00
iska 1bc896efc9 Add tests for HTML Node methods
Todo: Tests for negative cases, e.g. invalid manipulations that lead to hierarchy or not found errors.
2015-04-23 00:43:06 +02:00
iska 429f00adb6 Fix project settings after update to Xcode 6.3.1 2015-04-23 00:40:35 +02:00
iska d08ac2100e Fix the isEqualTo call in Parser
Use isEqual instead
2015-04-21 23:07:57 +02:00
iska 62a6336dce Merge branch 'release/0.1.0' into develop 2015-04-20 21:51:38 +02:00
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