| 280 |
zwnj => "\x{200C}", |
zwnj => "\x{200C}", |
| 281 |
}; # $entity_char |
}; # $entity_char |
| 282 |
|
|
|
## <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2006-December/thread.html#8562> |
|
| 283 |
my $c1_entity_char = { |
my $c1_entity_char = { |
| 284 |
128, 8364, |
0x80 => 0x20AC, |
| 285 |
129, 65533, |
0x81 => 0xFFFD, |
| 286 |
130, 8218, |
0x82 => 0x201A, |
| 287 |
131, 402, |
0x83 => 0x0192, |
| 288 |
132, 8222, |
0x84 => 0x201E, |
| 289 |
133, 8230, |
0x85 => 0x2026, |
| 290 |
134, 8224, |
0x86 => 0x2020, |
| 291 |
135, 8225, |
0x87 => 0x2021, |
| 292 |
136, 710, |
0x88 => 0x02C6, |
| 293 |
137, 8240, |
0x89 => 0x2030, |
| 294 |
138, 352, |
0x8A => 0x0160, |
| 295 |
139, 8249, |
0x8B => 0x2039, |
| 296 |
140, 338, |
0x8C => 0x0152, |
| 297 |
141, 65533, |
0x8D => 0xFFFD, |
| 298 |
142, 381, |
0x8E => 0x017D, |
| 299 |
143, 65533, |
0x8F => 0xFFFD, |
| 300 |
144, 65533, |
0x90 => 0xFFFD, |
| 301 |
145, 8216, |
0x91 => 0x2018, |
| 302 |
146, 8217, |
0x92 => 0x2019, |
| 303 |
147, 8220, |
0x93 => 0x201C, |
| 304 |
148, 8221, |
0x94 => 0x201D, |
| 305 |
149, 8226, |
0x95 => 0x2022, |
| 306 |
150, 8211, |
0x96 => 0x2013, |
| 307 |
151, 8212, |
0x97 => 0x2014, |
| 308 |
152, 732, |
0x98 => 0x02DC, |
| 309 |
153, 8482, |
0x99 => 0x2122, |
| 310 |
154, 353, |
0x9A => 0x0161, |
| 311 |
155, 8250, |
0x9B => 0x203A, |
| 312 |
156, 339, |
0x9C => 0x0153, |
| 313 |
157, 65533, |
0x9D => 0xFFFD, |
| 314 |
158, 382, |
0x9E => 0x017E, |
| 315 |
159, 376, |
0x9F => 0x0178, |
| 316 |
}; # $c1_entity_char |
}; # $c1_entity_char |
| 317 |
|
|
| 318 |
my $special_category = { |
my $special_category = { |
| 373 |
} elsif ($self->{next_input_character} > 0x10FFFF) { |
} elsif ($self->{next_input_character} > 0x10FFFF) { |
| 374 |
$self->{next_input_character} = 0xFFFD; # REPLACEMENT CHARACTER # MUST |
$self->{next_input_character} = 0xFFFD; # REPLACEMENT CHARACTER # MUST |
| 375 |
} elsif ($self->{next_input_character} == 0x0000) { # NULL |
} elsif ($self->{next_input_character} == 0x0000) { # NULL |
| 376 |
|
!!!parse-error (type => 'NULL'); |
| 377 |
$self->{next_input_character} = 0xFFFD; # REPLACEMENT CHARACTER # MUST |
$self->{next_input_character} = 0xFFFD; # REPLACEMENT CHARACTER # MUST |
| 378 |
} |
} |
| 379 |
}; |
}; |
| 1538 |
$num = 0xFFFD; # REPLACEMENT CHARACTER |
$num = 0xFFFD; # REPLACEMENT CHARACTER |
| 1539 |
## ISSUE: Why this is not an error? |
## ISSUE: Why this is not an error? |
| 1540 |
} elsif (0x80 <= $num and $num <= 0x9F) { |
} elsif (0x80 <= $num and $num <= 0x9F) { |
| 1541 |
## NOTE: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2006-December/thread.html#8562> |
!!!parse-error (type => sprintf 'c1 entity:U+%04X', $num); |
|
## ISSUE: Not in the spec yet; parse error? |
|
| 1542 |
$num = $c1_entity_char->{$num}; |
$num = $c1_entity_char->{$num}; |
| 1543 |
} |
} |
| 1544 |
|
|
| 1568 |
$code = 0xFFFD; # REPLACEMENT CHARACTER |
$code = 0xFFFD; # REPLACEMENT CHARACTER |
| 1569 |
## ISSUE: Why this is not an error? |
## ISSUE: Why this is not an error? |
| 1570 |
} elsif (0x80 <= $code and $code <= 0x9F) { |
} elsif (0x80 <= $code and $code <= 0x9F) { |
| 1571 |
## NOTE: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2006-December/thread.html#8562> |
!!!parse-error (type => sprintf 'c1 entity:U+%04X', $code); |
|
## ISSUE: Not in the spec yet; parse error? |
|
| 1572 |
$code = $c1_entity_char->{$code}; |
$code = $c1_entity_char->{$code}; |
| 1573 |
} |
} |
| 1574 |
|
|
| 1918 |
}; # $clear_up_to_marker |
}; # $clear_up_to_marker |
| 1919 |
|
|
| 1920 |
my $style_start_tag = sub { |
my $style_start_tag = sub { |
| 1921 |
my $style_el; !!!create-element ($style_el, 'style'); |
my $style_el; !!!create-element ($style_el, 'style', $token->{attributes}); |
| 1922 |
## $self->{insertion_mode} eq 'in head' and ... (always true) |
## $self->{insertion_mode} eq 'in head' and ... (always true) |
| 1923 |
(($self->{insertion_mode} eq 'in head' and defined $self->{head_element}) |
(($self->{insertion_mode} eq 'in head' and defined $self->{head_element}) |
| 1924 |
? $self->{head_element} : $self->{open_elements}->[-1]->[0]) |
? $self->{head_element} : $self->{open_elements}->[-1]->[0]) |
| 2318 |
if (defined $self->{form_element}) { |
if (defined $self->{form_element}) { |
| 2319 |
!!!parse-error (type => 'in form:form'); |
!!!parse-error (type => 'in form:form'); |
| 2320 |
## Ignore the token |
## Ignore the token |
| 2321 |
|
!!!next-token; |
| 2322 |
|
return; |
| 2323 |
} else { |
} else { |
| 2324 |
## has a p element in scope |
## has a p element in scope |
| 2325 |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
INSCOPE: for (reverse @{$self->{open_elements}}) { |
| 2361 |
LI: { |
LI: { |
| 2362 |
## Step 2 |
## Step 2 |
| 2363 |
if ($node->[1] eq 'li') { |
if ($node->[1] eq 'li') { |
| 2364 |
|
if ($i != -1) { |
| 2365 |
|
!!!parse-error (type => 'end tag missing:'. |
| 2366 |
|
$self->{open_elements}->[-1]->[1]); |
| 2367 |
|
## TODO: test |
| 2368 |
|
} |
| 2369 |
splice @{$self->{open_elements}}, $i; |
splice @{$self->{open_elements}}, $i; |
| 2370 |
last LI; |
last LI; |
| 2371 |
} |
} |
| 2409 |
LI: { |
LI: { |
| 2410 |
## Step 2 |
## Step 2 |
| 2411 |
if ($node->[1] eq 'dt' or $node->[1] eq 'dd') { |
if ($node->[1] eq 'dt' or $node->[1] eq 'dd') { |
| 2412 |
|
if ($i != -1) { |
| 2413 |
|
!!!parse-error (type => 'end tag missing:'. |
| 2414 |
|
$self->{open_elements}->[-1]->[1]); |
| 2415 |
|
## TODO: test |
| 2416 |
|
} |
| 2417 |
splice @{$self->{open_elements}}, $i; |
splice @{$self->{open_elements}}, $i; |
| 2418 |
last LI; |
last LI; |
| 2419 |
} |
} |
| 2688 |
} |
} |
| 2689 |
} elsif ({ |
} elsif ({ |
| 2690 |
textarea => 1, |
textarea => 1, |
| 2691 |
|
iframe => 1, |
| 2692 |
noembed => 1, |
noembed => 1, |
| 2693 |
noframes => 1, |
noframes => 1, |
| 2694 |
noscript => 0, ## TODO: 1 if scripting is enabled |
noscript => 0, ## TODO: 1 if scripting is enabled |
| 2707 |
$insert->($el); |
$insert->($el); |
| 2708 |
|
|
| 2709 |
my $text = ''; |
my $text = ''; |
| 2710 |
!!!next-token; |
if ($token->{tag_name} eq 'textarea') { |
| 2711 |
|
!!!next-token; |
| 2712 |
|
if ($token->{type} eq 'character') { |
| 2713 |
|
$token->{data} =~ s/^\x0A//; |
| 2714 |
|
unless (length $token->{data}) { |
| 2715 |
|
!!!next-token; |
| 2716 |
|
} |
| 2717 |
|
} |
| 2718 |
|
} else { |
| 2719 |
|
!!!next-token; |
| 2720 |
|
} |
| 2721 |
while ($token->{type} eq 'character') { |
while ($token->{type} eq 'character') { |
| 2722 |
$text .= $token->{data}; |
$text .= $token->{data}; |
| 2723 |
!!!next-token; |
!!!next-token; |
| 2733 |
## Ignore the token |
## Ignore the token |
| 2734 |
} else { |
} else { |
| 2735 |
if ($token->{tag_name} eq 'textarea') { |
if ($token->{tag_name} eq 'textarea') { |
|
!!!parse-error (type => 'in CDATA:#'.$token->{type}); |
|
|
} else { |
|
| 2736 |
!!!parse-error (type => 'in RCDATA:#'.$token->{type}); |
!!!parse-error (type => 'in RCDATA:#'.$token->{type}); |
| 2737 |
|
} else { |
| 2738 |
|
!!!parse-error (type => 'in CDATA:#'.$token->{type}); |
| 2739 |
} |
} |
| 2740 |
## ISSUE: And ignore? |
## ISSUE: And ignore? |
| 2741 |
} |
} |
| 2893 |
strong => 1, tt => 1, u => 1, |
strong => 1, tt => 1, u => 1, |
| 2894 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 2895 |
$formatting_end_tag->($token->{tag_name}); |
$formatting_end_tag->($token->{tag_name}); |
| 2896 |
|
## TODO: <http://html5.org/tools/web-apps-tracker?from=883&to=884> |
| 2897 |
return; |
return; |
| 2898 |
} elsif ({ |
} elsif ({ |
| 2899 |
caption => 1, col => 1, colgroup => 1, frame => 1, |
caption => 1, col => 1, colgroup => 1, frame => 1, |
| 2902 |
thead => 1, tr => 1, |
thead => 1, tr => 1, |
| 2903 |
area => 1, basefont => 1, bgsound => 1, br => 1, |
area => 1, basefont => 1, bgsound => 1, br => 1, |
| 2904 |
embed => 1, hr => 1, iframe => 1, image => 1, |
embed => 1, hr => 1, iframe => 1, image => 1, |
| 2905 |
img => 1, input => 1, isindex=> 1, noembed => 1, |
img => 1, input => 1, isindex => 1, noembed => 1, |
| 2906 |
noframes => 1, param => 1, select => 1, spacer => 1, |
noframes => 1, param => 1, select => 1, spacer => 1, |
| 2907 |
table => 1, textarea => 1, wbr => 1, |
table => 1, textarea => 1, wbr => 1, |
| 2908 |
noscript => 0, ## TODO: if scripting is enabled |
noscript => 0, ## TODO: if scripting is enabled |