Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: sky/specs/parsing.md

Issue 685483002: Specs: Actually maintain the stack of open nodes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Parsing 1 Parsing
2 ======= 2 =======
3 3
4 Parsing in Sky is a strict pipeline consisting of five stages: 4 Parsing in Sky is a strict pipeline consisting of five stages:
5 5
6 - decoding, which converts incoming bytes into Unicode characters 6 - decoding, which converts incoming bytes into Unicode characters
7 using UTF-8. 7 using UTF-8.
8 8
9 - normalising, which manipulates the sequence of characters. 9 - normalising, which manipulates the sequence of characters.
10 10
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 1. If the value of the token contains only U+0020 and U+000A 772 1. If the value of the token contains only U+0020 and U+000A
773 characters, and there is no ``t`` element on the _stack of 773 characters, and there is no ``t`` element on the _stack of
774 open nodes_, then skip the token. 774 open nodes_, then skip the token.
775 2. Create a text node _node_ whose character data is the value of 775 2. Create a text node _node_ whose character data is the value of
776 the token. 776 the token.
777 3. Append _node_ to the top node in the _stack of open nodes_. 777 3. Append _node_ to the top node in the _stack of open nodes_.
778 - If _token_ is a start tag token, 778 - If _token_ is a start tag token,
779 1. Create an element _node_ with tag name and attributes given by 779 1. Create an element _node_ with tag name and attributes given by
780 the token. 780 the token.
781 2. Append _node_ to the top node in the _stack of open nodes_. 781 2. Append _node_ to the top node in the _stack of open nodes_.
782 3. Push _node_ onto the top of the _stack of open nodes_.
783 4. If _node_ is a ``template`` element, then:
784 1. Let _fragment_ be the ``DocumentFragment`` object that the
785 ``template`` element uses as its template contents container.
786 2. Push _fragment_ onto the top of the _stack of open nodes_.
782 - If _token_ is an end tag token: 787 - If _token_ is an end tag token:
783 1. Let _node_ be the topmost node in the _stack of open nodes_ 788 1. Let _node_ be the topmost node in the _stack of open nodes_
784 whose tag name is the same as the token's tag name, if any. If 789 whose tag name is the same as the token's tag name, if any. If
785 there isn't one, skip this token. 790 there isn't one, skip this token.
786 2. If there's a ``template`` element in the _stack of open 791 2. If there's a ``template`` element in the _stack of open
787 nodes_ above _node_, then skip this token. 792 nodes_ above _node_, then skip this token.
788 3. Pop nodes from the _stack of open nodes_ until _node_ has been 793 3. Pop nodes from the _stack of open nodes_ until _node_ has been
789 popped. 794 popped.
790 4. If _node_'s tag name is ``script``, then yield until there 795 4. If _node_'s tag name is ``script``, then yield until there
791 are no pending import loads, then execute the script given by 796 are no pending import loads, then execute the script given by
792 the element's contents. 797 the element's contents.
793 3. Yield until there are no pending import loads. 798 3. Yield until there are no pending import loads.
794 3. Fire a ``load`` event at the _parsing context_ object. 799 3. Fire a ``load`` event at the _parsing context_ object.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698