Commit Graph
162 Commits
Author SHA1 Message Date
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 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
iska 90cbccbc16 Remove NSFastEnumeration for the Tokenizer and subclass the NSEnumerator instead
Memory management tends to be a bit complex in this case, especially under ARC, hence the
change to prevent a headache
2015-03-22 00:12:38 +01:00
iska 785760c625 Remove scripting flag from Parser 2015-03-19 21:10:30 +01:00
iska 1164609bcf Add implementation for inserting character tokens (strings) into the DOM
https://html.spec.whatwg.org/multipage/syntax.html#insert-a-character
2015-03-19 01:30:47 +01:00
iska 9858efa611 Fix "appropriate place for inserting a node"
The previous version did not take into consideration the "last table" case, wherein the node
is to be inserted before said "last table" element. Hence the out parameter which points to
the child node, before which the insertion should happen.

"let adjusted insertion location be inside last table's parent node, immediately before last table"
https://html.spec.whatwg.org/multipage/syntax.html#appropriate-place-for-inserting-a-node
2015-03-19 01:30:04 +01:00
iska fcbffc76dc Add implementation for HTML Document node adoption
https://dom.spec.whatwg.org/#concept-node-adopt
2015-03-19 00:43:16 +01:00
iska d8d191cb5a Add implementation for the HTML Node and its Mutation Algorithms
https://dom.spec.whatwg.org/#mutation-algorithms
2015-03-19 00:42:43 +01:00
iska a7b526dc14 Restore the EOF Token and emit it in the tokenizer 2015-03-16 00:17:11 +01:00
iska c90e13481c Hide the "adjusted current node" property from the parser interface 2015-03-15 22:41:37 +01:00
iska 7f52c80ff7 Add handling for Tokenizer Parse Error Tokens in the Parser 2015-03-15 21:05:35 +01:00
iska c15dd439bc Move methods related to "insertion modes" further to the bottom in class 2015-03-15 21:05:17 +01:00
iska 9f4de95e62 Add HTML Tokenizer property to set the associated parser object 2015-03-15 21:04:25 +01:00
iska 48de37dc3d Add HTML Document "ready state"
Initially it is set to "loading" and changed to "complete" when the parser finishes
2015-03-15 21:03:54 +01:00
iska ba0cf5d7f6 Add "template"-related token processing in HTML Parser
"in template" phase is still not implemented
2015-03-15 20:32:52 +01:00
iska eb52f26014 Use correct cast for the token object in the "any other end tag in body" phase 2015-03-15 17:58:08 +01:00
iska a26bcfb0f2 Add missing import for element attribute adjustment methods in parser 2015-03-15 17:54:47 +01:00
iska a1560ddf37 Format special element types (add \n to break huge line) 2015-03-15 17:54:20 +01:00
iska 424241de47 Add implementations for MathML & SVG atribute adjustments
Adjusting foreign attributes for a token is ignored, since namespaces for attributes are not
handled in any way
2015-03-15 17:53:17 +01:00
iska 5897ff2c58 Use ordered dictionary for the HTML Element's attributes 2015-03-15 17:49:05 +01:00
iska e56c8dff90 Finalize "HTML integration point" check 2015-03-15 17:48:29 +01:00
iska 77651cfe4e Restore implementation for the select-scope in the stack of open elements
Wrongly removed removed in 56e6cd5
2015-03-15 15:36:07 +01:00
iska 769098b6dc Finalize the "markup declaration open state" in the HTML Tokenizer 2015-03-15 15:31:18 +01:00
iska 6c7e3465e9 Add implementation for a ordered dictionary for HTML attributes 2015-03-15 15:14:14 +01:00
iska 0d2d6dedeb Add implementation for the rest of the insertion modes
"in table text", "in caption", "in column group", "in table body", "in row", "in cell", "in select",
"in select in table", "in template", "after body", "in frameset", "after frameset",
"after after body", "after after frameset"
2015-03-14 01:56:37 +01:00
iska 800f697237 Add implementation for "text" and "in table" insertion modes
https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incdata
https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
2015-03-12 00:36:05 +01:00
iska 721290b814 Add handling for EOF token in "in body" insertion mode
https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
2015-03-11 22:51:21 +01:00
iska 56e6cd5650 Add implementation for handling end tag tokens in "in body" insertion mode
https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
2015-03-11 22:47:42 +01:00
iska 80f04cb7df rename adoption-agency-algorithm and toggle the return value
as of now, returns true if further processing is required, i.e. reprocessing the token
with the "any other end tag" case
2015-03-11 22:31:15 +01:00
iska 10506550dd Add a shorthand element-in-scope method to match the spec
"has-element-in-scope" is a shorthand for "has-element-in-specific-scope"
2015-03-10 00:31:08 +01:00
iska cf259240ab Add implementation for handling a start tag token in "in body" insertion mode
https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
2015-03-10 00:13:14 +01:00
iska 9fbf247518 Add NSString category methods for comparison ignoring case
and use these in the Doctype node and the quirks mode
2015-03-10 00:11:57 +01:00
iska 91e2e3c5a3 Add return value for the adoption agency algorithm to indicate that further processing is needed 2015-03-09 21:25:53 +01:00
iska a256f1e701 Add implementation for the Adoption Agency Algorithm
https://html.spec.whatwg.org/multipage/syntax.html#adoption-agency-algorithm
2015-03-09 21:16:53 +01:00
iska 0495404f01 Add a wrapper class for the Stack of Open Elements
- Better understandability
- Prevent polluting the parser
2015-03-09 00:34:06 +01:00
iska b8c18a7536 Add method to generate implied end tags and close a "p" tag
https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
https://html.spec.whatwg.org/multipage/syntax.html#close-a-p-element
2015-03-07 00:45:25 +01:00
iska 443ac898fa Add method for specific scope checks
https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
2015-03-07 00:44:06 +01:00