| OLD | NEW |
| 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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 1. If the value of the token contains only U+0020 and U+000A | 795 1. If the value of the token contains only U+0020 and U+000A |
| 796 characters, and there is no ``t`` element on the _stack of | 796 characters, and there is no ``t`` element on the _stack of |
| 797 open nodes_, then skip the token. | 797 open nodes_, then skip the token. |
| 798 2. Create a text node _node_ whose character data is the value of | 798 2. Create a text node _node_ whose character data is the value of |
| 799 the token. | 799 the token. |
| 800 3. Append _node_ to the top node in the _stack of open nodes_. | 800 3. Append _node_ to the top node in the _stack of open nodes_. |
| 801 - If _token_ is a start tag token, | 801 - If _token_ is a start tag token, |
| 802 1. If the tag name isn't a registered tag name, then yield until | 802 1. If the tag name isn't a registered tag name, then yield until |
| 803 _imported modules_ contains no entries with unresolved | 803 _imported modules_ contains no entries with unresolved |
| 804 promises. | 804 promises. |
| 805 2. If the tag name is registered, create an element _node_ with | 805 2. If the tag name is not registered, then let the ErrorElement |
| 806 tag name and attributes given by the token. Otherwise, create | 806 constructor from sky:core be the element constructor. |
| 807 an element with the tag name "error" and the attributes given | 807 Otherwise, let the element constructor be the registered |
| 808 by the token. | 808 element's constructor for that tag name in this module. |
| 809 3. Append _node_ to the top node in the _stack of open nodes_. | 809 3. Create an element _node_ with the attributes given by the |
| 810 4. Push _node_ onto the top of the _stack of open nodes_. | 810 token by calling the constructor. |
| 811 5. If _node_ is a ``template`` element, then: | 811 4. If _node_ is not an Element object, then let the constructor |
| 812 be the ErrorElement constructor and return to the previous |
| 813 step. |
| 814 5. Append _node_ to the top node in the _stack of open nodes_. |
| 815 6. Push _node_ onto the top of the _stack of open nodes_. |
| 816 7. If _node_ is a ``template`` element, then: |
| 812 1. Let _fragment_ be the ``DocumentFragment`` object that the | 817 1. Let _fragment_ be the ``DocumentFragment`` object that the |
| 813 ``template`` element uses as its template contents container. | 818 ``template`` element uses as its template contents container. |
| 814 2. Push _fragment_ onto the top of the _stack of open nodes_. | 819 2. Push _fragment_ onto the top of the _stack of open nodes_. |
| 815 If _node_ is an ``import`` element, then: | 820 If _node_ is an ``import`` element, then: |
| 816 1. Let ``url`` be the value of _node_'s ``src`` attribute. | 821 1. Let ``url`` be the value of _node_'s ``src`` attribute. |
| 817 2. Call ``parsing context``'s ``importModule()`` method, | 822 2. Call ``parsing context``'s ``importModule()`` method, |
| 818 passing it ``url``. | 823 passing it ``url``. |
| 819 3. Add the returned promise to _imported modules_; if _node_ | 824 3. Add the returned promise to _imported modules_; if _node_ |
| 820 has an ``as`` attribute, associate the entry with that | 825 has an ``as`` attribute, associate the entry with that |
| 821 name. | 826 name. |
| 822 - If _token_ is an end tag token: | 827 - If _token_ is an end tag token: |
| 823 1. If the tag name is registered, let _tag name_ be that tag | 828 1. If the tag name is registered, let _tag name_ be that tag |
| 824 name. Otherwise, let _tag name_ be "error". | 829 name. Otherwise, let _tag name_ be "error". |
| 825 2. Let _node_ be the topmost node in the _stack of open nodes_ | 830 2. Let _node_ be the topmost node in the _stack of open nodes_ |
| 826 whose tag name is _tag name_, if any. If there isn't one, skip | 831 whose tag name is _tag name_, if any. If there isn't one, skip |
| 827 this token. | 832 this token. |
| 828 3. If there's a ``template`` element in the _stack of open | 833 3. If there's a ``template`` element in the _stack of open |
| 829 nodes_ above _node_, then skip this token. | 834 nodes_ above _node_, then skip this token. |
| 830 4. Pop nodes from the _stack of open nodes_ until _node_ has been | 835 4. Pop nodes from the _stack of open nodes_ until _node_ has been |
| 831 popped. | 836 popped. |
| 832 5. If _node_'s tag name is ``script``, then yield until _imported | 837 5. If _node_'s tag name is ``script``, then yield until _imported |
| 833 modules_ contains no entries with unresolved promises, then | 838 modules_ contains no entries with unresolved promises, then |
| 834 execute the script given by the element's contents, using the | 839 execute the script given by the element's contents, using the |
| 835 associated names as appropriate. | 840 associated names as appropriate. |
| 836 - If _token_ is an automatic end tag token: | 841 - If _token_ is an automatic end tag token: |
| 837 1. Pop the top node from the _stack of open nodes_, unless it is | 842 1. Pop the top node from the _stack of open nodes_, unless it is |
| 838 the document. | 843 the document. |
| 839 4. Yield until _imported modules_ has no promises. | 844 4. Yield until _imported modules_ has no promises. |
| 840 5. Fire a ``load`` event at the _parsing context_ object. | 845 5. Fire a ``load`` event at the _parsing context_ object. |
| OLD | NEW |