| 1827 |
$self->{state} = SELF_CLOSING_START_TAG_STATE; |
$self->{state} = SELF_CLOSING_START_TAG_STATE; |
| 1828 |
!!!next-input-character; |
!!!next-input-character; |
| 1829 |
redo A; |
redo A; |
| 1830 |
|
} elsif ($self->{next_char} == -1) { |
| 1831 |
|
!!!parse-error (type => 'unclosed tag'); |
| 1832 |
|
if ($self->{current_token}->{type} == START_TAG_TOKEN) { |
| 1833 |
|
!!!cp (122.3); |
| 1834 |
|
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 1835 |
|
} elsif ($self->{current_token}->{type} == END_TAG_TOKEN) { |
| 1836 |
|
if ($self->{current_token}->{attributes}) { |
| 1837 |
|
!!!cp (122.1); |
| 1838 |
|
!!!parse-error (type => 'end tag attribute'); |
| 1839 |
|
} else { |
| 1840 |
|
## NOTE: This state should never be reached. |
| 1841 |
|
!!!cp (122.2); |
| 1842 |
|
} |
| 1843 |
|
} else { |
| 1844 |
|
die "$0: $self->{current_token}->{type}: Unknown token type"; |
| 1845 |
|
} |
| 1846 |
|
$self->{state} = DATA_STATE; |
| 1847 |
|
## Reconsume. |
| 1848 |
|
!!!emit ($self->{current_token}); # start tag or end tag |
| 1849 |
|
redo A; |
| 1850 |
} else { |
} else { |
| 1851 |
!!!cp ('124.1'); |
!!!cp ('124.1'); |
| 1852 |
!!!parse-error (type => 'no space between attributes'); |
!!!parse-error (type => 'no space between attributes'); |
| 1879 |
!!!emit ($self->{current_token}); # start tag or end tag |
!!!emit ($self->{current_token}); # start tag or end tag |
| 1880 |
|
|
| 1881 |
redo A; |
redo A; |
| 1882 |
|
} elsif ($self->{next_char} == -1) { |
| 1883 |
|
!!!parse-error (type => 'unclosed tag'); |
| 1884 |
|
if ($self->{current_token}->{type} == START_TAG_TOKEN) { |
| 1885 |
|
!!!cp (124.7); |
| 1886 |
|
$self->{last_emitted_start_tag_name} = $self->{current_token}->{tag_name}; |
| 1887 |
|
} elsif ($self->{current_token}->{type} == END_TAG_TOKEN) { |
| 1888 |
|
if ($self->{current_token}->{attributes}) { |
| 1889 |
|
!!!cp (124.5); |
| 1890 |
|
!!!parse-error (type => 'end tag attribute'); |
| 1891 |
|
} else { |
| 1892 |
|
## NOTE: This state should never be reached. |
| 1893 |
|
!!!cp (124.6); |
| 1894 |
|
} |
| 1895 |
|
} else { |
| 1896 |
|
die "$0: $self->{current_token}->{type}: Unknown token type"; |
| 1897 |
|
} |
| 1898 |
|
$self->{state} = DATA_STATE; |
| 1899 |
|
## Reconsume. |
| 1900 |
|
!!!emit ($self->{current_token}); # start tag or end tag |
| 1901 |
|
redo A; |
| 1902 |
} else { |
} else { |
| 1903 |
!!!cp ('124.4'); |
!!!cp ('124.4'); |
| 1904 |
!!!parse-error (type => 'nestc'); |
!!!parse-error (type => 'nestc'); |
| 3414 |
if ($self->{open_elements}->[0]->[0] eq $node->[0]) { |
if ($self->{open_elements}->[0]->[0] eq $node->[0]) { |
| 3415 |
$last = 1; |
$last = 1; |
| 3416 |
if (defined $self->{inner_html_node}) { |
if (defined $self->{inner_html_node}) { |
| 3417 |
if ($self->{inner_html_node}->[1] & TABLE_CELL_EL) { |
!!!cp ('t28'); |
| 3418 |
!!!cp ('t27'); |
$node = $self->{inner_html_node}; |
| 3419 |
# |
} else { |
| 3420 |
} else { |
die "_reset_insertion_mode: t27"; |
|
!!!cp ('t28'); |
|
|
$node = $self->{inner_html_node}; |
|
|
} |
|
| 3421 |
} |
} |
| 3422 |
} |
} |
| 3423 |
|
|
| 3424 |
## Step 4..14 |
## Step 4..14 |
| 3425 |
my $new_mode; |
my $new_mode; |
| 3426 |
if ($node->[1] & FOREIGN_EL) { |
if ($node->[1] & FOREIGN_EL) { |
| 3427 |
## NOTE: Strictly spaking, the line below only applies to MathML and |
!!!cp ('t28.1'); |
| 3428 |
## SVG elements. Currently the HTML syntax supports only MathML and |
## NOTE: Strictly spaking, the line below only applies to MathML and |
| 3429 |
## SVG elements as foreigners. |
## SVG elements. Currently the HTML syntax supports only MathML and |
| 3430 |
$new_mode = $self->{insertion_mode} | IN_FOREIGN_CONTENT_IM; |
## SVG elements as foreigners. |
| 3431 |
## ISSUE: What is set as the secondary insertion mode? |
$new_mode = $self->{insertion_mode} | IN_FOREIGN_CONTENT_IM; |
| 3432 |
} else { |
## ISSUE: What is set as the secondary insertion mode? |
| 3433 |
$new_mode = { |
} elsif ($node->[1] & TABLE_CELL_EL) { |
| 3434 |
|
if ($last) { |
| 3435 |
|
!!!cp ('t28.2'); |
| 3436 |
|
# |
| 3437 |
|
} else { |
| 3438 |
|
!!!cp ('t28.3'); |
| 3439 |
|
$new_mode = IN_CELL_IM; |
| 3440 |
|
} |
| 3441 |
|
} else { |
| 3442 |
|
!!!cp ('t28.4'); |
| 3443 |
|
$new_mode = { |
| 3444 |
select => IN_SELECT_IM, |
select => IN_SELECT_IM, |
| 3445 |
## NOTE: |option| and |optgroup| do not set |
## NOTE: |option| and |optgroup| do not set |
| 3446 |
## insertion mode to "in select" by themselves. |
## insertion mode to "in select" by themselves. |
|
td => IN_CELL_IM, |
|
|
th => IN_CELL_IM, |
|
| 3447 |
tr => IN_ROW_IM, |
tr => IN_ROW_IM, |
| 3448 |
tbody => IN_TABLE_BODY_IM, |
tbody => IN_TABLE_BODY_IM, |
| 3449 |
thead => IN_TABLE_BODY_IM, |
thead => IN_TABLE_BODY_IM, |
| 3455 |
body => IN_BODY_IM, |
body => IN_BODY_IM, |
| 3456 |
frameset => IN_FRAMESET_IM, |
frameset => IN_FRAMESET_IM, |
| 3457 |
}->{$node->[0]->manakai_local_name}; |
}->{$node->[0]->manakai_local_name}; |
| 3458 |
} |
} |
| 3459 |
$self->{insertion_mode} = $new_mode and return if defined $new_mode; |
$self->{insertion_mode} = $new_mode and return if defined $new_mode; |
| 3460 |
|
|
| 3461 |
## Step 15 |
## Step 15 |
| 3462 |
if ($node->[1] & HTML_EL) { |
if ($node->[1] & HTML_EL) { |