Commit Graph
122 Commits
Author SHA1 Message Date
iska 41e2795d27 Add Parser flags initialization and fix flag-name typo 2015-03-01 23:50:04 +01:00
iska f0e5a7cb26 Add "Before HTML" & "Before Head" insertion modes implementation in HTML Parser
https://html.spec.whatwg.org/multipage/syntax.html#the-before-html-insertion-mode
https://html.spec.whatwg.org/multipage/syntax.html#the-before-head-insertion-mode
2015-03-01 03:31:03 +01:00
iska f05ddd5a51 Add Parser methods for creating and inserting elements for given tokens
https://html.spec.whatwg.org/multipage/syntax.html#create-an-element-for-the-token
https://html.spec.whatwg.org/multipage/syntax.html#insert-an-html-element
2015-03-01 03:29:37 +01:00
iska 3ad454cb47 Add initializers for HTML Element class 2015-03-01 03:28:09 +01:00
iska f79530c7f6 Add convenience method to cast a Token to a Tag Token 2015-03-01 03:27:50 +01:00
iska 6217bc4299 Add Character Token methods for splitting leading whitespace
Since all successive characters are accumulated into the character token in the
tokenization stage, leading whitespace must be explicitly ignored during the tree
construction, hence these methods.
2015-03-01 03:27:24 +01:00
iska 6ec1892f73 Move HTML Nodes into separate group 2015-02-28 01:45:52 +01:00
iska 8d7d9d148e Use managed ivars for public and system identifiers in Document Type node
- If either is nil an empty string is return on getter-call
- nil value indicates a missing identifier, an empty string is not considered missing
in some parsing cases
2015-02-28 01:07:39 +01:00
iska fc5ec2c2e4 Add warning pragma in Character token for caching character set 2015-02-28 01:04:21 +01:00
iska 098c0fe467 Add initial implementation for parsing a fragment
https://html.spec.whatwg.org/multipage/syntax.html#html-fragment-parsing-algorithm
2015-02-28 01:03:54 +01:00
iska 7717cb7472 Add implementation for the parser's Initial Insertion Mode
https://html.spec.whatwg.org/multipage/syntax.html#the-initial-insertion-mode
2015-02-28 01:03:02 +01:00
iska c2086e482e Add parser method for inserting Comment nodes into the document
https://html.spec.whatwg.org/multipage/syntax.html#insert-a-comment
2015-02-28 01:01:58 +01:00
iska 6eccc61684 Rename utility method in Token classes for better semantics 2015-02-28 00:58:55 +01:00
iska 11631c7c76 Add methods to check Doctype validity and its quirks mode 2015-02-28 00:57:50 +01:00
iska 79856255da Add header that imports all HTML Nodes for convenience 2015-02-28 00:56:35 +01:00
iska 83bca329ff Add initial stubs for HTML Document and Element nodes
https://dom.spec.whatwg.org/#interface-document
https://dom.spec.whatwg.org/#interface-element
2015-02-27 00:03:35 +01:00
iska 034a28deea Add HTML Text node
https://dom.spec.whatwg.org/#interface-text
2015-02-26 23:41:42 +01:00
iska fade192485 Rename HTML Node Type enum values
Use HTMLNode<type> instead of HTML<type>Node
2015-02-26 20:09:27 +01:00
iska c45adc581b Add HTML Comment node
https://dom.spec.whatwg.org/#interface-comment
2015-02-26 20:08:06 +01:00
iska 5e9846b8ea Add HTML Document Type node
https://dom.spec.whatwg.org/#interface-documenttype
2015-02-25 23:48:24 +01:00
iska da00182ff2 Add HTML Node interface
https://dom.spec.whatwg.org/#interface-node
2015-02-25 22:38:02 +01:00
iska aae4401167 Add convenience methods to cast HTML token to the appropriate type 2015-02-22 01:46:42 +01:00
iska 4e3c758f8c Add initial implementation for "appropriate place for inserting a node"
https://html.spec.whatwg.org/multipage/syntax.html#creating-and-inserting-nodes
2015-02-22 01:46:13 +01:00
iska 3915487ca7 Add "insertion mode" state machine stub
https://html.spec.whatwg.org/multipage/syntax.html#the-insertion-mode
2015-02-21 14:50:52 +01:00
iska f9c8743106 Add "tree construction dispatcher" and token handling stub
https://html.spec.whatwg.org/multipage/syntax.html#tree-construction
2015-02-21 14:30:44 +01:00
iska 4afa6d11e1 Change HTML test's description property to "title" 2015-02-19 22:26:10 +01:00
iska 25c233eaaa Add tagname attribute for HTML Element 2014-11-08 02:09:03 +01:00
iska a59fec42e7 Add enum for HTML Namespaces 2014-11-08 02:08:42 +01:00
iska 2d6889878b Add implementation for FastEnumeration protocol for forin-iteration 2014-11-02 13:54:21 +01:00
iska b0f27e3f2f Add missing new-lines in Token classes 2014-11-02 13:53:54 +01:00
iska fc91ae1296 Remove unnecessary method to get HTML Tokenization state as String 2014-11-01 22:45:46 +01:00
iska 8787e1b0b9 Add all HTML5 Lib's tokenizer tests 2014-11-01 22:25:20 +01:00
iska ccc355d80e Replace unconsuming with a location mark in the current character in After DOCTYPE Name state to avoid consuming the character twice
Otherwise the parse error would be emitted multiple times if it is an invalid or unexpected character
2014-11-01 22:24:32 +01:00
iska 0ea6eb2b4e Fix Attribute Name state for NULL character
The attribute should not be finalised here, since its value wasn't reached yet
2014-11-01 22:22:38 +01:00
iska 477af1f4ab Change parse error message to 0x format instead of U+ 2014-11-01 22:06:01 +01:00
iska 97df7c5dd8 Fix Attribute Name state to prevent finalising a pending attribute name before it's finished 2014-11-01 22:05:22 +01:00
iska e8c74da8e2 Fix Bogus Comment state for nil-characters 2014-11-01 22:04:23 +01:00
iska 244021072c Remove erroneous parse-error emit in Comment End state 2014-11-01 22:03:34 +01:00
iska 0835e3d120 Add a "reconsume" method for current character to avoid scanning the Stream repeatedly
Reconsume differs from the Unconsume method, since it doesn't rewind the scan location to the previous characters, but instead sets a flag to return the last consumed character on the next acess
2014-11-01 22:02:36 +01:00
iska 622e22737b Fix emitted Token in Before Attribute Name state 2014-11-01 15:49:42 +01:00
iska 8fd6e89854 Fix scan location after reading Named Entity 2014-11-01 15:19:46 +01:00
iska 58220a464c Add missing break statement to prevent fall-through in End Tag Open state
.. and change parse error to look like the others
2014-11-01 15:19:20 +01:00
iska b3ee713e9b Fix DOCTYPE Token's public and system identifier initialisation issue
On first access these must be inited before use
2014-11-01 15:12:58 +01:00
iska a23e1a13c9 Fix surrogate pair handling and remove Input Stream's separate error-reporting class
Upon reading a surrogate pair the scan location should be advanced by two characters instead of one
2014-10-31 22:32:34 +01:00
iska bc8abb116f Fix UTF32Char to String conversion for invalid unicode characters
Invalid, isolated surrogate pairs, UTF32 characters should handled specially and converted to UniChars first
2014-10-31 21:46:54 +01:00
iska a7892a2edf Cleanup some parse error messages in Tokenizer for overall consistency 2014-10-31 18:26:34 +01:00
iska 2fa0e793e0 Replace dictionary with two arrays for Named Entity replacement
Currently the entity name is binary-searched and its replacement-value is accessed via found index
2014-10-31 18:25:54 +01:00
iska c04d4a35f3 Set performance baseline for tokenizing step 2014-10-31 18:07:18 +01:00
iska aaec5971b8 Add performance test for tokenizing step 2014-10-31 18:06:59 +01:00
iska bc3a7165ec Fix logic for Named Entity replacement
This will be improved further later on
2014-10-31 18:06:15 +01:00