| 2749 |
} elsif ($token->{type} == START_TAG_TOKEN) { |
} elsif ($token->{type} == START_TAG_TOKEN) { |
| 2750 |
if ($token->{tag_name} eq 'html') { |
if ($token->{tag_name} eq 'html') { |
| 2751 |
my $root_element; |
my $root_element; |
| 2752 |
!!!create-element ($root_element, $token->{tag_name}, $token->{attributes}); |
!!!create-element ($root_element, $token->{tag_name}, $token->{attributes}, $token); |
| 2753 |
$self->{document}->append_child ($root_element); |
$self->{document}->append_child ($root_element); |
| 2754 |
push @{$self->{open_elements}}, [$root_element, 'html']; |
push @{$self->{open_elements}}, [$root_element, 'html']; |
| 2755 |
|
|
| 2779 |
die "$0: $token->{type}: Unknown token type"; |
die "$0: $token->{type}: Unknown token type"; |
| 2780 |
} |
} |
| 2781 |
|
|
| 2782 |
my $root_element; !!!create-element ($root_element, 'html'); |
my $root_element; !!!create-element ($root_element, 'html',, $token); |
| 2783 |
$self->{document}->append_child ($root_element); |
$self->{document}->append_child ($root_element); |
| 2784 |
push @{$self->{open_elements}}, [$root_element, 'html']; |
push @{$self->{open_elements}}, [$root_element, 'html']; |
| 2785 |
|
|
| 2974 |
## Step 1 |
## Step 1 |
| 2975 |
my $start_tag_name = $token->{tag_name}; |
my $start_tag_name = $token->{tag_name}; |
| 2976 |
my $el; |
my $el; |
| 2977 |
!!!create-element ($el, $start_tag_name, $token->{attributes}); |
!!!create-element ($el, $start_tag_name, $token->{attributes}, $token); |
| 2978 |
|
|
| 2979 |
## Step 2 |
## Step 2 |
| 2980 |
$insert->($el); |
$insert->($el); |
| 3024 |
|
|
| 3025 |
my $script_start_tag = sub () { |
my $script_start_tag = sub () { |
| 3026 |
my $script_el; |
my $script_el; |
| 3027 |
!!!create-element ($script_el, 'script', $token->{attributes}); |
!!!create-element ($script_el, 'script', $token->{attributes}, $token); |
| 3028 |
## TODO: mark as "parser-inserted" |
## TODO: mark as "parser-inserted" |
| 3029 |
|
|
| 3030 |
$self->{content_model} = CDATA_CONTENT_MODEL; |
$self->{content_model} = CDATA_CONTENT_MODEL; |
| 3421 |
if ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
if ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
| 3422 |
!!!cp ('t89'); |
!!!cp ('t89'); |
| 3423 |
## As if <head> |
## As if <head> |
| 3424 |
!!!create-element ($self->{head_element}, 'head'); |
!!!create-element ($self->{head_element}, 'head',, $token); |
| 3425 |
$self->{open_elements}->[-1]->[0]->append_child ($self->{head_element}); |
$self->{open_elements}->[-1]->[0]->append_child ($self->{head_element}); |
| 3426 |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
| 3427 |
|
|
| 3451 |
|
|
| 3452 |
## "after head" insertion mode |
## "after head" insertion mode |
| 3453 |
## As if <body> |
## As if <body> |
| 3454 |
!!!insert-element ('body'); |
!!!insert-element ('body',, $token); |
| 3455 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 3456 |
## reprocess |
## reprocess |
| 3457 |
redo B; |
redo B; |
| 3459 |
if ($token->{tag_name} eq 'head') { |
if ($token->{tag_name} eq 'head') { |
| 3460 |
if ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
if ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
| 3461 |
!!!cp ('t93'); |
!!!cp ('t93'); |
| 3462 |
!!!create-element ($self->{head_element}, $token->{tag_name}, $token->{attributes}); |
!!!create-element ($self->{head_element}, $token->{tag_name}, $token->{attributes}, $token); |
| 3463 |
$self->{open_elements}->[-1]->[0]->append_child ($self->{head_element}); |
$self->{open_elements}->[-1]->[0]->append_child ($self->{head_element}); |
| 3464 |
push @{$self->{open_elements}}, [$self->{head_element}, $token->{tag_name}]; |
push @{$self->{open_elements}}, [$self->{head_element}, $token->{tag_name}]; |
| 3465 |
$self->{insertion_mode} = IN_HEAD_IM; |
$self->{insertion_mode} = IN_HEAD_IM; |
| 3478 |
} elsif ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
} elsif ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
| 3479 |
!!!cp ('t96'); |
!!!cp ('t96'); |
| 3480 |
## As if <head> |
## As if <head> |
| 3481 |
!!!create-element ($self->{head_element}, 'head'); |
!!!create-element ($self->{head_element}, 'head',, $token); |
| 3482 |
$self->{open_elements}->[-1]->[0]->append_child ($self->{head_element}); |
$self->{open_elements}->[-1]->[0]->append_child ($self->{head_element}); |
| 3483 |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
| 3484 |
|
|
| 3509 |
} else { |
} else { |
| 3510 |
!!!cp ('t101'); |
!!!cp ('t101'); |
| 3511 |
} |
} |
| 3512 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 3513 |
pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
| 3514 |
pop @{$self->{open_elements}} # <head> |
pop @{$self->{open_elements}} # <head> |
| 3515 |
if $self->{insertion_mode} == AFTER_HEAD_IM; |
if $self->{insertion_mode} == AFTER_HEAD_IM; |
| 3524 |
} else { |
} else { |
| 3525 |
!!!cp ('t103'); |
!!!cp ('t103'); |
| 3526 |
} |
} |
| 3527 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 3528 |
pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
| 3529 |
pop @{$self->{open_elements}} # <head> |
pop @{$self->{open_elements}} # <head> |
| 3530 |
if $self->{insertion_mode} == AFTER_HEAD_IM; |
if $self->{insertion_mode} == AFTER_HEAD_IM; |
| 3539 |
} else { |
} else { |
| 3540 |
!!!cp ('t105'); |
!!!cp ('t105'); |
| 3541 |
} |
} |
| 3542 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 3543 |
my $meta_el = pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
my $meta_el = pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
| 3544 |
|
|
| 3545 |
unless ($self->{confident}) { |
unless ($self->{confident}) { |
| 3636 |
if ($self->{insertion_mode} == IN_HEAD_IM) { |
if ($self->{insertion_mode} == IN_HEAD_IM) { |
| 3637 |
!!!cp ('t116'); |
!!!cp ('t116'); |
| 3638 |
## NOTE: and scripting is disalbed |
## NOTE: and scripting is disalbed |
| 3639 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 3640 |
$self->{insertion_mode} = IN_HEAD_NOSCRIPT_IM; |
$self->{insertion_mode} = IN_HEAD_NOSCRIPT_IM; |
| 3641 |
!!!next-token; |
!!!next-token; |
| 3642 |
redo B; |
redo B; |
| 3695 |
} |
} |
| 3696 |
|
|
| 3697 |
## "after head" insertion mode |
## "after head" insertion mode |
| 3698 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 3699 |
if ($token->{tag_name} eq 'body') { |
if ($token->{tag_name} eq 'body') { |
| 3700 |
!!!cp ('t126'); |
!!!cp ('t126'); |
| 3701 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 3735 |
|
|
| 3736 |
## "after head" insertion mode |
## "after head" insertion mode |
| 3737 |
## As if <body> |
## As if <body> |
| 3738 |
!!!insert-element ('body'); |
!!!insert-element ('body',, $token); |
| 3739 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 3740 |
## reprocess |
## reprocess |
| 3741 |
redo B; |
redo B; |
| 3744 |
if ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
if ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
| 3745 |
!!!cp ('t132'); |
!!!cp ('t132'); |
| 3746 |
## As if <head> |
## As if <head> |
| 3747 |
!!!create-element ($self->{head_element}, 'head'); |
!!!create-element ($self->{head_element}, 'head',, $token); |
| 3748 |
$self->{open_elements}->[-1]->[0]->append_child ($self->{head_element}); |
$self->{open_elements}->[-1]->[0]->append_child ($self->{head_element}); |
| 3749 |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
| 3750 |
|
|
| 3797 |
if ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
if ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
| 3798 |
!!!cp ('t139'); |
!!!cp ('t139'); |
| 3799 |
## As if <head> |
## As if <head> |
| 3800 |
!!!create-element ($self->{head_element}, 'head'); |
!!!create-element ($self->{head_element}, 'head',, $token); |
| 3801 |
$self->{open_elements}->[-1]->[0]->append_child ($self->{head_element}); |
$self->{open_elements}->[-1]->[0]->append_child ($self->{head_element}); |
| 3802 |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
| 3803 |
|
|
| 3820 |
if ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
if ($self->{insertion_mode} == BEFORE_HEAD_IM) { |
| 3821 |
!!!cp ('t142'); |
!!!cp ('t142'); |
| 3822 |
## As if <head> |
## As if <head> |
| 3823 |
!!!create-element ($self->{head_element}, 'head'); |
!!!create-element ($self->{head_element}, 'head',, $token); |
| 3824 |
$self->{open_elements}->[-1]->[0]->append_child ($self->{head_element}); |
$self->{open_elements}->[-1]->[0]->append_child ($self->{head_element}); |
| 3825 |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
| 3826 |
|
|
| 3874 |
|
|
| 3875 |
## "after head" insertion mode |
## "after head" insertion mode |
| 3876 |
## As if <body> |
## As if <body> |
| 3877 |
!!!insert-element ('body'); |
!!!insert-element ('body',, $token); |
| 3878 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 3879 |
## reprocess |
## reprocess |
| 3880 |
redo B; |
redo B; |
| 3883 |
!!!cp ('t149.1'); |
!!!cp ('t149.1'); |
| 3884 |
|
|
| 3885 |
## NOTE: As if <head> |
## NOTE: As if <head> |
| 3886 |
!!!create-element ($self->{head_element}, 'head'); |
!!!create-element ($self->{head_element}, 'head',, $token); |
| 3887 |
$self->{open_elements}->[-1]->[0]->append_child |
$self->{open_elements}->[-1]->[0]->append_child |
| 3888 |
($self->{head_element}); |
($self->{head_element}); |
| 3889 |
#push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
#push @{$self->{open_elements}}, [$self->{head_element}, 'head']; |
| 3927 |
} |
} |
| 3928 |
|
|
| 3929 |
## NOTE: As if <body> |
## NOTE: As if <body> |
| 3930 |
!!!insert-element ('body'); |
!!!insert-element ('body',, $token); |
| 3931 |
$self->{insertion_mode} = IN_BODY_IM; |
$self->{insertion_mode} = IN_BODY_IM; |
| 3932 |
## NOTE: Reprocess. |
## NOTE: Reprocess. |
| 3933 |
redo B; |
redo B; |
| 4379 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 4380 |
} |
} |
| 4381 |
|
|
| 4382 |
!!!insert-element ('tbody'); |
!!!insert-element ('tbody',, $token); |
| 4383 |
$self->{insertion_mode} = IN_TABLE_BODY_IM; |
$self->{insertion_mode} = IN_TABLE_BODY_IM; |
| 4384 |
## reprocess in the "in table body" insertion mode... |
## reprocess in the "in table body" insertion mode... |
| 4385 |
} |
} |
| 4402 |
$self->{insertion_mode} = IN_ROW_IM; |
$self->{insertion_mode} = IN_ROW_IM; |
| 4403 |
if ($token->{tag_name} eq 'tr') { |
if ($token->{tag_name} eq 'tr') { |
| 4404 |
!!!cp ('t204'); |
!!!cp ('t204'); |
| 4405 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 4406 |
!!!next-token; |
!!!next-token; |
| 4407 |
redo B; |
redo B; |
| 4408 |
} else { |
} else { |
| 4409 |
!!!cp ('t205'); |
!!!cp ('t205'); |
| 4410 |
!!!insert-element ('tr'); |
!!!insert-element ('tr',, $token); |
| 4411 |
## reprocess in the "in row" insertion mode |
## reprocess in the "in row" insertion mode |
| 4412 |
} |
} |
| 4413 |
} else { |
} else { |
| 4422 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 4423 |
} |
} |
| 4424 |
|
|
| 4425 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 4426 |
$self->{insertion_mode} = IN_CELL_IM; |
$self->{insertion_mode} = IN_CELL_IM; |
| 4427 |
|
|
| 4428 |
push @$active_formatting_elements, ['#marker', '']; |
push @$active_formatting_elements, ['#marker', '']; |
| 4543 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 4544 |
} |
} |
| 4545 |
|
|
| 4546 |
!!!insert-element ('colgroup'); |
!!!insert-element ('colgroup',, $token); |
| 4547 |
$self->{insertion_mode} = IN_COLUMN_GROUP_IM; |
$self->{insertion_mode} = IN_COLUMN_GROUP_IM; |
| 4548 |
## reprocess |
## reprocess |
| 4549 |
redo B; |
redo B; |
| 4563 |
push @$active_formatting_elements, ['#marker', ''] |
push @$active_formatting_elements, ['#marker', ''] |
| 4564 |
if $token->{tag_name} eq 'caption'; |
if $token->{tag_name} eq 'caption'; |
| 4565 |
|
|
| 4566 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 4567 |
$self->{insertion_mode} = { |
$self->{insertion_mode} = { |
| 4568 |
caption => IN_CAPTION_IM, |
caption => IN_CAPTION_IM, |
| 4569 |
colgroup => IN_COLUMN_GROUP_IM, |
colgroup => IN_COLUMN_GROUP_IM, |
| 4657 |
!!!cp ('t227.3'); |
!!!cp ('t227.3'); |
| 4658 |
!!!parse-error (type => 'in table:'.$token->{tag_name}, token => $token); |
!!!parse-error (type => 'in table:'.$token->{tag_name}, token => $token); |
| 4659 |
|
|
| 4660 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 4661 |
|
|
| 4662 |
## TODO: form element pointer |
## TODO: form element pointer |
| 4663 |
|
|
| 5001 |
} elsif ($token->{type} == START_TAG_TOKEN) { |
} elsif ($token->{type} == START_TAG_TOKEN) { |
| 5002 |
if ($token->{tag_name} eq 'col') { |
if ($token->{tag_name} eq 'col') { |
| 5003 |
!!!cp ('t262'); |
!!!cp ('t262'); |
| 5004 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 5005 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 5006 |
!!!next-token; |
!!!next-token; |
| 5007 |
redo B; |
redo B; |
| 5083 |
!!!cp ('t273'); |
!!!cp ('t273'); |
| 5084 |
} |
} |
| 5085 |
|
|
| 5086 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 5087 |
!!!next-token; |
!!!next-token; |
| 5088 |
redo B; |
redo B; |
| 5089 |
} elsif ($token->{tag_name} eq 'optgroup') { |
} elsif ($token->{tag_name} eq 'optgroup') { |
| 5103 |
!!!cp ('t277'); |
!!!cp ('t277'); |
| 5104 |
} |
} |
| 5105 |
|
|
| 5106 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 5107 |
!!!next-token; |
!!!next-token; |
| 5108 |
redo B; |
redo B; |
| 5109 |
} elsif ($token->{tag_name} eq 'select' or |
} elsif ($token->{tag_name} eq 'select' or |
| 5446 |
if ($token->{tag_name} eq 'frameset' and |
if ($token->{tag_name} eq 'frameset' and |
| 5447 |
$self->{insertion_mode} == IN_FRAMESET_IM) { |
$self->{insertion_mode} == IN_FRAMESET_IM) { |
| 5448 |
!!!cp ('t318'); |
!!!cp ('t318'); |
| 5449 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 5450 |
!!!next-token; |
!!!next-token; |
| 5451 |
redo B; |
redo B; |
| 5452 |
} elsif ($token->{tag_name} eq 'frame' and |
} elsif ($token->{tag_name} eq 'frame' and |
| 5453 |
$self->{insertion_mode} == IN_FRAMESET_IM) { |
$self->{insertion_mode} == IN_FRAMESET_IM) { |
| 5454 |
!!!cp ('t319'); |
!!!cp ('t319'); |
| 5455 |
!!!insert-element ($token->{tag_name}, $token->{attributes}); |
!!!insert-element ($token->{tag_name}, $token->{attributes}, $token); |
| 5456 |
pop @{$self->{open_elements}}; |
pop @{$self->{open_elements}}; |
| 5457 |
!!!next-token; |
!!!next-token; |
| 5458 |
redo B; |
redo B; |
| 5561 |
}->{$token->{tag_name}}) { |
}->{$token->{tag_name}}) { |
| 5562 |
!!!cp ('t334'); |
!!!cp ('t334'); |
| 5563 |
## 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 |
| 5564 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 5565 |
pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
| 5566 |
!!!next-token; |
!!!next-token; |
| 5567 |
redo B; |
redo B; |
| 5568 |
} elsif ($token->{tag_name} eq 'meta') { |
} elsif ($token->{tag_name} eq 'meta') { |
| 5569 |
## 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 |
| 5570 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 5571 |
my $meta_el = pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
my $meta_el = pop @{$self->{open_elements}}; ## ISSUE: This step is missing in the spec. |
| 5572 |
|
|
| 5573 |
unless ($self->{confident}) { |
unless ($self->{confident}) { |
| 5675 |
} |
} |
| 5676 |
} # INSCOPE |
} # INSCOPE |
| 5677 |
|
|
| 5678 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 5679 |
if ($token->{tag_name} eq 'pre' or $token->{tag_name} eq 'listing') { |
if ($token->{tag_name} eq 'pre' or $token->{tag_name} eq 'listing') { |
| 5680 |
!!!next-token; |
!!!next-token; |
| 5681 |
if ($token->{type} == CHARACTER_TOKEN) { |
if ($token->{type} == CHARACTER_TOKEN) { |
| 5768 |
redo LI; |
redo LI; |
| 5769 |
} # LI |
} # LI |
| 5770 |
|
|
| 5771 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 5772 |
!!!next-token; |
!!!next-token; |
| 5773 |
redo B; |
redo B; |
| 5774 |
} elsif ($token->{tag_name} eq 'plaintext') { |
} elsif ($token->{tag_name} eq 'plaintext') { |
| 5789 |
} |
} |
| 5790 |
} # INSCOPE |
} # INSCOPE |
| 5791 |
|
|
| 5792 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 5793 |
|
|
| 5794 |
$self->{content_model} = PLAINTEXT_CONTENT_MODEL; |
$self->{content_model} = PLAINTEXT_CONTENT_MODEL; |
| 5795 |
|
|
| 5830 |
|
|
| 5831 |
$reconstruct_active_formatting_elements->($insert_to_current); |
$reconstruct_active_formatting_elements->($insert_to_current); |
| 5832 |
|
|
| 5833 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 5834 |
push @$active_formatting_elements, $self->{open_elements}->[-1]; |
push @$active_formatting_elements, $self->{open_elements}->[-1]; |
| 5835 |
|
|
| 5836 |
!!!next-token; |
!!!next-token; |
| 5857 |
} |
} |
| 5858 |
} # INSCOPE |
} # INSCOPE |
| 5859 |
|
|
| 5860 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 5861 |
push @$active_formatting_elements, $self->{open_elements}->[-1]; |
push @$active_formatting_elements, $self->{open_elements}->[-1]; |
| 5862 |
|
|
| 5863 |
!!!next-token; |
!!!next-token; |
| 5884 |
|
|
| 5885 |
$reconstruct_active_formatting_elements->($insert_to_current); |
$reconstruct_active_formatting_elements->($insert_to_current); |
| 5886 |
|
|
| 5887 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 5888 |
|
|
| 5889 |
## TODO: associate with $self->{form_element} if defined |
## TODO: associate with $self->{form_element} if defined |
| 5890 |
|
|
| 5965 |
} elsif ($token->{tag_name} eq 'textarea') { |
} elsif ($token->{tag_name} eq 'textarea') { |
| 5966 |
my $tag_name = $token->{tag_name}; |
my $tag_name = $token->{tag_name}; |
| 5967 |
my $el; |
my $el; |
| 5968 |
!!!create-element ($el, $token->{tag_name}, $token->{attributes}); |
!!!create-element ($el, $token->{tag_name}, $token->{attributes}, $token); |
| 5969 |
|
|
| 5970 |
## TODO: $self->{form_element} if defined |
## TODO: $self->{form_element} if defined |
| 5971 |
$self->{content_model} = RCDATA_CONTENT_MODEL; |
$self->{content_model} = RCDATA_CONTENT_MODEL; |
| 6033 |
## NOTE: There is an "as if <br>" code clone. |
## NOTE: There is an "as if <br>" code clone. |
| 6034 |
$reconstruct_active_formatting_elements->($insert_to_current); |
$reconstruct_active_formatting_elements->($insert_to_current); |
| 6035 |
|
|
| 6036 |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}); |
!!!insert-element-t ($token->{tag_name}, $token->{attributes}, $token); |
| 6037 |
|
|
| 6038 |
if ({ |
if ({ |
| 6039 |
applet => 1, marquee => 1, object => 1, |
applet => 1, marquee => 1, object => 1, |
| 6325 |
!!!cp ('t415.1'); |
!!!cp ('t415.1'); |
| 6326 |
## As if <p>, then reprocess the current token |
## As if <p>, then reprocess the current token |
| 6327 |
my $el; |
my $el; |
| 6328 |
!!!create-element ($el, 'p'); |
!!!create-element ($el, 'p',, $token); |
| 6329 |
$insert->($el); |
$insert->($el); |
| 6330 |
## NOTE: Not inserted into |$self->{open_elements}|. |
## NOTE: Not inserted into |$self->{open_elements}|. |
| 6331 |
} |
} |
| 6349 |
$reconstruct_active_formatting_elements->($insert_to_current); |
$reconstruct_active_formatting_elements->($insert_to_current); |
| 6350 |
|
|
| 6351 |
my $el; |
my $el; |
| 6352 |
!!!create-element ($el, 'br'); |
!!!create-element ($el, 'br',, $token); |
| 6353 |
$insert->($el); |
$insert->($el); |
| 6354 |
|
|
| 6355 |
## Ignore the token. |
## Ignore the token. |