@@ 2076-2091 (lines=16) @@ | ||
2073 | } |
|
2074 | ||
2075 | /* An end tag with the tag name "head" */ |
|
2076 | } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'head') { |
|
2077 | /* If the current node is a head element, pop the current node off |
|
2078 | the stack of open elements. */ |
|
2079 | if ($this->head_pointer->isSameNode(end($this->stack))) { |
|
2080 | array_pop($this->stack); |
|
2081 | ||
2082 | /* Otherwise, this is a parse error. */ |
|
2083 | } else { |
|
2084 | // k |
|
2085 | } |
|
2086 | ||
2087 | /* Change the insertion mode to "after head". */ |
|
2088 | $this->mode = self::AFTER_HEAD; |
|
2089 | ||
2090 | /* A start tag with the tag name "head" or an end tag except "html". */ |
|
2091 | } elseif (($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') || |
|
2092 | ($token['type'] === HTML5::ENDTAG && $token['name'] !== 'html') |
|
2093 | ) { |
|
2094 | // Parse error. Ignore the token. |
|
@@ 3660-3677 (lines=18) @@ | ||
3657 | array_pop($this->stack); |
|
3658 | ||
3659 | /* An end tag whose tag name is "colgroup" */ |
|
3660 | } elseif ($token['type'] === HTML5::ENDTAG && |
|
3661 | $token['name'] === 'colgroup' |
|
3662 | ) { |
|
3663 | /* If the current node is the root html element, then this is a |
|
3664 | parse error, ignore the token. (innerHTML case) */ |
|
3665 | if (end($this->stack)->nodeName === 'html') { |
|
3666 | // Ignore |
|
3667 | ||
3668 | /* Otherwise, pop the current node (which will be a colgroup |
|
3669 | element) from the stack of open elements. Switch the insertion |
|
3670 | mode to "in table". */ |
|
3671 | } else { |
|
3672 | array_pop($this->stack); |
|
3673 | $this->mode = self::IN_TABLE; |
|
3674 | } |
|
3675 | ||
3676 | /* An end tag whose tag name is "col" */ |
|
3677 | } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'col') { |
|
3678 | /* Parse error. Ignore the token. */ |
|
3679 | ||
3680 | /* Anything else */ |
|
@@ 4284-4305 (lines=22) @@ | ||
4281 | $this->insertElement($token); |
|
4282 | ||
4283 | /* An end tag with the tag name "frameset" */ |
|
4284 | } elseif ($token['name'] === 'frameset' && |
|
4285 | $token['type'] === HTML5::ENDTAG |
|
4286 | ) { |
|
4287 | /* If the current node is the root html element, then this is a |
|
4288 | parse error; ignore the token. (innerHTML case) */ |
|
4289 | if (end($this->stack)->nodeName === 'html') { |
|
4290 | // Ignore |
|
4291 | ||
4292 | } else { |
|
4293 | /* Otherwise, pop the current node from the stack of open |
|
4294 | elements. */ |
|
4295 | array_pop($this->stack); |
|
4296 | ||
4297 | /* If the parser was not originally created in order to handle |
|
4298 | the setting of an element's innerHTML attribute (innerHTML case), |
|
4299 | and the current node is no longer a frameset element, then change |
|
4300 | the insertion mode to "after frameset". */ |
|
4301 | $this->mode = self::AFTR_FRAME; |
|
4302 | } |
|
4303 | ||
4304 | /* A start tag with the tag name "frame" */ |
|
4305 | } elseif ($token['name'] === 'frame' && |
|
4306 | $token['type'] === HTML5::STARTTAG |
|
4307 | ) { |
|
4308 | /* Insert an HTML element for the token. */ |