| 45 |
sub FOREIGN_EL () { 0b10000000000000000000000000 } |
sub FOREIGN_EL () { 0b10000000000000000000000000 } |
| 46 |
sub FOREIGN_FLOW_CONTENT_EL () { 0b100000000000000000000000000 } |
sub FOREIGN_FLOW_CONTENT_EL () { 0b100000000000000000000000000 } |
| 47 |
sub MML_AXML_EL () { 0b1000000000000000000000000000 } |
sub MML_AXML_EL () { 0b1000000000000000000000000000 } |
| 48 |
|
sub RUBY_EL () { 0b10000000000000000000000000000 } |
| 49 |
|
sub RUBY_COMPONENT_EL () { 0b100000000000000000000000000000 } |
| 50 |
|
|
| 51 |
sub TABLE_ROWS_EL () { |
sub TABLE_ROWS_EL () { |
| 52 |
TABLE_EL | |
TABLE_EL | |
| 54 |
TABLE_ROW_GROUP_EL |
TABLE_ROW_GROUP_EL |
| 55 |
} |
} |
| 56 |
|
|
| 57 |
|
## NOTE: Used in "generate implied end tags" algorithm. |
| 58 |
|
## NOTE: There is a code where a modified version of END_TAG_OPTIONAL_EL |
| 59 |
|
## is used in "generate implied end tags" implementation (search for the |
| 60 |
|
## function mae). |
| 61 |
sub END_TAG_OPTIONAL_EL () { |
sub END_TAG_OPTIONAL_EL () { |
| 62 |
DD_EL | |
DD_EL | |
| 63 |
DT_EL | |
DT_EL | |
| 64 |
LI_EL | |
LI_EL | |
| 65 |
P_EL |
P_EL | |
| 66 |
|
RUBY_COMPONENT_EL |
| 67 |
} |
} |
| 68 |
|
|
| 69 |
|
## NOTE: Used in </body> and EOF algorithms. |
| 70 |
sub ALL_END_TAG_OPTIONAL_EL () { |
sub ALL_END_TAG_OPTIONAL_EL () { |
| 71 |
END_TAG_OPTIONAL_EL | |
DD_EL | |
| 72 |
|
DT_EL | |
| 73 |
|
LI_EL | |
| 74 |
|
P_EL | |
| 75 |
|
|
| 76 |
BODY_EL | |
BODY_EL | |
| 77 |
HTML_EL | |
HTML_EL | |
| 78 |
TABLE_CELL_EL | |
TABLE_CELL_EL | |
| 108 |
ADDRESS_EL | |
ADDRESS_EL | |
| 109 |
BODY_EL | |
BODY_EL | |
| 110 |
DIV_EL | |
DIV_EL | |
| 111 |
END_TAG_OPTIONAL_EL | |
|
| 112 |
|
DD_EL | |
| 113 |
|
DT_EL | |
| 114 |
|
LI_EL | |
| 115 |
|
P_EL | |
| 116 |
|
|
| 117 |
FORM_EL | |
FORM_EL | |
| 118 |
FRAMESET_EL | |
FRAMESET_EL | |
| 119 |
HEADING_EL | |
HEADING_EL | |
| 187 |
param => MISC_SPECIAL_EL, |
param => MISC_SPECIAL_EL, |
| 188 |
plaintext => MISC_SPECIAL_EL, |
plaintext => MISC_SPECIAL_EL, |
| 189 |
pre => MISC_SPECIAL_EL, |
pre => MISC_SPECIAL_EL, |
| 190 |
|
rp => RUBY_COMPONENT_EL, |
| 191 |
|
rt => RUBY_COMPONENT_EL, |
| 192 |
|
ruby => RUBY_EL, |
| 193 |
s => FORMATTING_EL, |
s => FORMATTING_EL, |
| 194 |
script => MISC_SPECIAL_EL, |
script => MISC_SPECIAL_EL, |
| 195 |
select => SELECT_EL, |
select => SELECT_EL, |
| 5393 |
next B; |
next B; |
| 5394 |
} |
} |
| 5395 |
|
|
| 5396 |
## TODO: Followings are removed from the latest spec. |
## TODO: Followings are removed from the latest spec. |
| 5397 |
## generate implied end tags |
## generate implied end tags |
| 5398 |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
| 5399 |
!!!cp ('t224'); |
!!!cp ('t224'); |
| 6811 |
} |
} |
| 6812 |
!!!next-token; |
!!!next-token; |
| 6813 |
next B; |
next B; |
| 6814 |
|
} elsif ($token->{tag_name} eq 'rt' or |
| 6815 |
|
$token->{tag_name} eq 'rp') { |
| 6816 |
|
## has a |ruby| element in scope |
| 6817 |
|
INSCOPE: for (reverse 0..$#{$self->{open_elements}}) { |
| 6818 |
|
my $node = $self->{open_elements}->[$_]; |
| 6819 |
|
if ($node->[1] & RUBY_EL) { |
| 6820 |
|
!!!cp ('t398.1'); |
| 6821 |
|
## generate implied end tags |
| 6822 |
|
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
| 6823 |
|
!!!cp ('t398.2'); |
| 6824 |
|
pop @{$self->{open_elements}}; |
| 6825 |
|
} |
| 6826 |
|
unless ($self->{open_elements}->[-1]->[1] & RUBY_EL) { |
| 6827 |
|
!!!cp ('t398.3'); |
| 6828 |
|
!!!parse-error (type => 'not closed', |
| 6829 |
|
value => $self->{open_elements}->[-1]->[0] |
| 6830 |
|
->manakai_local_name, |
| 6831 |
|
token => $token); |
| 6832 |
|
pop @{$self->{open_elements}} |
| 6833 |
|
while not $self->{open_elements}->[-1]->[1] & RUBY_EL; |
| 6834 |
|
} |
| 6835 |
|
last INSCOPE; |
| 6836 |
|
} elsif ($node->[1] & SCOPING_EL) { |
| 6837 |
|
!!!cp ('t398.4'); |
| 6838 |
|
last INSCOPE; |
| 6839 |
|
} |
| 6840 |
|
} # INSCOPE |
| 6841 |
|
|
| 6842 |
|
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 6843 |
|
|
| 6844 |
|
!!!nack ('t398.5'); |
| 6845 |
|
!!!next-token; |
| 6846 |
|
redo B; |
| 6847 |
} elsif ($token->{tag_name} eq 'math' or |
} elsif ($token->{tag_name} eq 'math' or |
| 6848 |
$token->{tag_name} eq 'svg') { |
$token->{tag_name} eq 'svg') { |
| 6849 |
$reconstruct_active_formatting_elements->($insert_to_current); |
$reconstruct_active_formatting_elements->($insert_to_current); |
| 7032 |
} else { |
} else { |
| 7033 |
## Step 1. generate implied end tags |
## Step 1. generate implied end tags |
| 7034 |
while ({ |
while ({ |
| 7035 |
|
## END_TAG_OPTIONAL_EL |
| 7036 |
dd => ($token->{tag_name} ne 'dd'), |
dd => ($token->{tag_name} ne 'dd'), |
| 7037 |
dt => ($token->{tag_name} ne 'dt'), |
dt => ($token->{tag_name} ne 'dt'), |
| 7038 |
li => ($token->{tag_name} ne 'li'), |
li => ($token->{tag_name} ne 'li'), |
| 7039 |
p => 1, |
p => 1, |
| 7040 |
|
rt => 1, |
| 7041 |
|
rp => 1, |
| 7042 |
}->{$self->{open_elements}->[-1]->[0]->manakai_local_name}) { |
}->{$self->{open_elements}->[-1]->[0]->manakai_local_name}) { |
| 7043 |
!!!cp ('t409'); |
!!!cp ('t409'); |
| 7044 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 7251 |
## generate implied end tags |
## generate implied end tags |
| 7252 |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
while ($self->{open_elements}->[-1]->[1] & END_TAG_OPTIONAL_EL) { |
| 7253 |
!!!cp ('t430'); |
!!!cp ('t430'); |
| 7254 |
## ISSUE: Can this case be reached? |
## NOTE: |<ruby><rt></ruby>|. |
| 7255 |
|
## ISSUE: <ruby><rt></rt> will also take this code path, |
| 7256 |
|
## which seems wrong. |
| 7257 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 7258 |
|
$node_i++; |
| 7259 |
} |
} |
| 7260 |
|
|
| 7261 |
## Step 2 |
## Step 2 |
| 7272 |
} |
} |
| 7273 |
|
|
| 7274 |
## Step 3 |
## Step 3 |
| 7275 |
splice @{$self->{open_elements}}, $node_i; |
splice @{$self->{open_elements}}, $node_i if $node_i < 0; |
| 7276 |
|
|
| 7277 |
!!!next-token; |
!!!next-token; |
| 7278 |
last S2; |
last S2; |