| 66 |
} |
} |
| 67 |
|
|
| 68 |
## NOTE: Used in "generate implied end tags" algorithm. |
## NOTE: Used in "generate implied end tags" algorithm. |
| 69 |
## NOTE: There is a code where a modified version of END_TAG_OPTIONAL_EL |
## NOTE: There is a code where a modified version of |
| 70 |
## is used in "generate implied end tags" implementation (search for the |
## END_TAG_OPTIONAL_EL is used in "generate implied end tags" |
| 71 |
## function mae). |
## implementation (search for the algorithm name). |
| 72 |
sub END_TAG_OPTIONAL_EL () { |
sub END_TAG_OPTIONAL_EL () { |
| 73 |
DD_EL | |
DD_EL | |
| 74 |
DT_EL | |
DT_EL | |
| 75 |
LI_EL | |
LI_EL | |
| 76 |
|
OPTION_EL | |
| 77 |
|
OPTGROUP_EL | |
| 78 |
P_EL | |
P_EL | |
| 79 |
RUBY_COMPONENT_EL |
RUBY_COMPONENT_EL |
| 80 |
} |
} |
| 4657 |
!!!cp ('t101'); |
!!!cp ('t101'); |
| 4658 |
} |
} |
| 4659 |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 4660 |
pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
pop @{$self->{open_elements}}; |
| 4661 |
pop @{$self->{open_elements}} # <head> |
pop @{$self->{open_elements}} # <head> |
| 4662 |
if $self->{insertion_mode} == AFTER_HEAD_IM; |
if $self->{insertion_mode} == AFTER_HEAD_IM; |
| 4663 |
!!!nack ('t101.1'); |
!!!nack ('t101.1'); |
| 4664 |
!!!next-token; |
!!!next-token; |
| 4665 |
next B; |
next B; |
| 4666 |
} elsif ($token->{tag_name} eq 'link') { |
} elsif ($token->{tag_name} eq 'link') { |
| 4667 |
## NOTE: There is a "as if in head" code clone. |
## NOTE: There is a "as if in head" code clone. |
| 4668 |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 4669 |
!!!cp ('t102'); |
!!!cp ('t102'); |
| 4670 |
!!!parse-error (type => 'after head', |
!!!parse-error (type => 'after head', |
| 4671 |
text => $token->{tag_name}, token => $token); |
text => $token->{tag_name}, token => $token); |
| 4672 |
push @{$self->{open_elements}}, |
push @{$self->{open_elements}}, |
| 4673 |
[$self->{head_element}, $el_category->{head}]; |
[$self->{head_element}, $el_category->{head}]; |
| 4674 |
} else { |
} else { |
| 4675 |
!!!cp ('t103'); |
!!!cp ('t103'); |
| 4676 |
} |
} |
| 4677 |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 4678 |
pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
pop @{$self->{open_elements}}; |
| 4679 |
pop @{$self->{open_elements}} # <head> |
pop @{$self->{open_elements}} # <head> |
| 4680 |
if $self->{insertion_mode} == AFTER_HEAD_IM; |
if $self->{insertion_mode} == AFTER_HEAD_IM; |
| 4681 |
!!!ack ('t103.1'); |
!!!ack ('t103.1'); |
| 4682 |
!!!next-token; |
!!!next-token; |
| 4683 |
next B; |
next B; |
| 4684 |
|
} elsif ($token->{tag_name} eq 'command' or |
| 4685 |
|
$token->{tag_name} eq 'eventsource') { |
| 4686 |
|
if ($self->{insertion_mode} == IN_HEAD_IM) { |
| 4687 |
|
## NOTE: If the insertion mode at the time of the emission |
| 4688 |
|
## of the token was "before head", $self->{insertion_mode} |
| 4689 |
|
## is already changed to |IN_HEAD_IM|. |
| 4690 |
|
|
| 4691 |
|
## NOTE: There is a "as if in head" code clone. |
| 4692 |
|
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 4693 |
|
pop @{$self->{open_elements}}; |
| 4694 |
|
pop @{$self->{open_elements}} # <head> |
| 4695 |
|
if $self->{insertion_mode} == AFTER_HEAD_IM; |
| 4696 |
|
!!!ack ('t103.2'); |
| 4697 |
|
!!!next-token; |
| 4698 |
|
next B; |
| 4699 |
|
} else { |
| 4700 |
|
## NOTE: "in head noscript" or "after head" insertion mode |
| 4701 |
|
## - in these cases, these tags are treated as same as |
| 4702 |
|
## normal in-body tags. |
| 4703 |
|
!!!cp ('t103.3'); |
| 4704 |
|
# |
| 4705 |
|
} |
| 4706 |
} elsif ($token->{tag_name} eq 'meta') { |
} elsif ($token->{tag_name} eq 'meta') { |
| 4707 |
## NOTE: There is a "as if in head" code clone. |
## NOTE: There is a "as if in head" code clone. |
| 4708 |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
if ($self->{insertion_mode} == AFTER_HEAD_IM) { |
| 6820 |
$parse_rcdata->(CDATA_CONTENT_MODEL); |
$parse_rcdata->(CDATA_CONTENT_MODEL); |
| 6821 |
next B; |
next B; |
| 6822 |
} elsif ({ |
} elsif ({ |
| 6823 |
base => 1, link => 1, |
base => 1, command => 1, eventsource => 1, link => 1, |
| 6824 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 6825 |
!!!cp ('t334'); |
!!!cp ('t334'); |
| 6826 |
## NOTE: This is an "as if in head" code clone, only "-t" differs |
## NOTE: This is an "as if in head" code clone, only "-t" differs |
| 6827 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 6828 |
pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
pop @{$self->{open_elements}}; |
| 6829 |
!!!ack ('t334.1'); |
!!!ack ('t334.1'); |
| 6830 |
!!!next-token; |
!!!next-token; |
| 6831 |
next B; |
next B; |
| 6832 |
} elsif ($token->{tag_name} eq 'meta') { |
} elsif ($token->{tag_name} eq 'meta') { |
| 6833 |
## NOTE: This is an "as if in head" code clone, only "-t" differs |
## NOTE: This is an "as if in head" code clone, only "-t" differs |
| 6834 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 6835 |
my $meta_el = pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
my $meta_el = pop @{$self->{open_elements}}; |
| 6836 |
|
|
| 6837 |
unless ($self->{confident}) { |
unless ($self->{confident}) { |
| 6838 |
if ($token->{attributes}->{charset}) { |
if ($token->{attributes}->{charset}) { |
| 7526 |
dd => ($token->{tag_name} ne 'dd'), |
dd => ($token->{tag_name} ne 'dd'), |
| 7527 |
dt => ($token->{tag_name} ne 'dt'), |
dt => ($token->{tag_name} ne 'dt'), |
| 7528 |
li => ($token->{tag_name} ne 'li'), |
li => ($token->{tag_name} ne 'li'), |
| 7529 |
|
option => 1, |
| 7530 |
|
optgroup => 1, |
| 7531 |
p => 1, |
p => 1, |
| 7532 |
rt => 1, |
rt => 1, |
| 7533 |
rp => 1, |
rp => 1, |