4986 |
next B; |
next B; |
4987 |
} |
} |
4988 |
} elsif ($token->{type} == END_TAG_TOKEN) { |
} elsif ($token->{type} == END_TAG_TOKEN) { |
4989 |
if ($token->{tag_name} eq 'body') { |
if ($token->{tag_name} eq 'body' or $token->{tag_name} eq 'html') { |
4990 |
|
|
4991 |
## 1. If not "have an element in scope": |
## 1. If not "have an element in scope": |
4992 |
## "has a |body| element in scope" |
## "has a |body| element in scope" |
5003 |
} |
} |
5004 |
} |
} |
5005 |
|
|
5006 |
## NOTE: |<marquee></body>|, |<svg><foreignobject></body>| |
## NOTE: |<marquee></body>|, |<svg><foreignobject></body>|, |
5007 |
|
## and fragment cases. |
5008 |
|
|
5009 |
!!!parse-error (type => 'unmatched end tag', |
!!!parse-error (type => 'unmatched end tag', |
5010 |
text => $token->{tag_name}, token => $token); |
text => $token->{tag_name}, token => $token); |
5011 |
## NOTE: Ignore the token. |
## Ignore the token. (</body> or </html>) |
5012 |
!!!next-token; |
!!!next-token; |
5013 |
next B; |
next B; |
5014 |
} # INSCOPE |
} # INSCOPE |
5031 |
|
|
5032 |
## 3. Switch the insertion mode. |
## 3. Switch the insertion mode. |
5033 |
$self->{insertion_mode} = AFTER_BODY_IM; |
$self->{insertion_mode} = AFTER_BODY_IM; |
5034 |
!!!next-token; |
if ($token->{tag_name} eq 'body') { |
|
next B; |
|
|
} elsif ($token->{tag_name} eq 'html') { |
|
|
## TODO: Update this code. It seems that the code below is not |
|
|
## up-to-date, though it has same effect as speced. |
|
|
if (@{$self->{open_elements}} > 1 and |
|
|
$self->{open_elements}->[1]->[1] == BODY_EL) { |
|
|
unless ($self->{open_elements}->[-1]->[1] == BODY_EL) { |
|
|
!!!cp ('t406'); |
|
|
!!!parse-error (type => 'not closed', |
|
|
text => $self->{open_elements}->[1]->[0] |
|
|
->manakai_local_name, |
|
|
token => $token); |
|
|
} else { |
|
|
!!!cp ('t407'); |
|
|
} |
|
|
$self->{insertion_mode} = AFTER_BODY_IM; |
|
|
## reprocess |
|
|
next B; |
|
|
} else { |
|
|
!!!cp ('t408'); |
|
|
!!!parse-error (type => 'unmatched end tag', |
|
|
text => $token->{tag_name}, token => $token); |
|
|
## Ignore the token |
|
5035 |
!!!next-token; |
!!!next-token; |
5036 |
next B; |
} else { # html |
5037 |
|
## Reprocess. |
5038 |
} |
} |
5039 |
|
next B; |
5040 |
} elsif ({ |
} elsif ({ |
5041 |
## NOTE: End tags for non-phrasing flow content elements |
## NOTE: End tags for non-phrasing flow content elements |
5042 |
|
|