@@ 3855-3880 (lines=26) @@ | ||
3852 | return $this->inCell($token); |
|
3853 | ||
3854 | /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ |
|
3855 | } elseif ($token['type'] === HTML5::ENDTAG && |
|
3856 | in_array($token['name'], array('tbody', 'tfoot', 'thead')) |
|
3857 | ) { |
|
3858 | /* If the stack of open elements does not have an element in table |
|
3859 | scope with the same tag name as the token, this is a parse error. |
|
3860 | Ignore the token. */ |
|
3861 | if (!$this->elementInScope($token['name'], true)) { |
|
3862 | // Ignore. |
|
3863 | ||
3864 | /* Otherwise: */ |
|
3865 | } else { |
|
3866 | /* Otherwise, act as if an end tag with the tag name "tr" had |
|
3867 | been seen, then reprocess the current token. */ |
|
3868 | $this->inRow( |
|
3869 | array( |
|
3870 | 'name' => 'tr', |
|
3871 | 'type' => HTML5::ENDTAG |
|
3872 | ) |
|
3873 | ); |
|
3874 | ||
3875 | return $this->inCell($token); |
|
3876 | } |
|
3877 | ||
3878 | /* An end tag whose tag name is one of: "body", "caption", "col", |
|
3879 | "colgroup", "html", "td", "th" */ |
|
3880 | } elseif ($token['type'] === HTML5::ENDTAG && in_array( |
|
3881 | $token['name'], |
|
3882 | array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr') |
|
3883 | ) |
|
@@ 4008-4028 (lines=21) @@ | ||
4005 | ||
4006 | /* An end tag whose tag name is one of: "table", "tbody", "tfoot", |
|
4007 | "thead", "tr" */ |
|
4008 | } elseif ($token['type'] === HTML5::ENDTAG && in_array( |
|
4009 | $token['name'], |
|
4010 | array('table', 'tbody', 'tfoot', 'thead', 'tr') |
|
4011 | ) |
|
4012 | ) { |
|
4013 | /* If the stack of open elements does not have an element in table |
|
4014 | scope with the same tag name as that of the token (which can only |
|
4015 | happen for "tbody", "tfoot" and "thead", or, in the innerHTML case), |
|
4016 | then this is a parse error and the token must be ignored. */ |
|
4017 | if (!$this->elementInScope($token['name'], true)) { |
|
4018 | // Ignore. |
|
4019 | ||
4020 | /* Otherwise, close the cell (see below) and reprocess the current |
|
4021 | token. */ |
|
4022 | } else { |
|
4023 | $this->closeCell(); |
|
4024 | return $this->inRow($token); |
|
4025 | } |
|
4026 | ||
4027 | /* Anything else */ |
|
4028 | } else { |
|
4029 | /* Process the token as if the insertion mode was "in body". */ |
|
4030 | $this->inBody($token); |
|
4031 | } |