3012 |
!!!next-token; |
!!!next-token; |
3013 |
}; # $script_start_tag |
}; # $script_start_tag |
3014 |
|
|
3015 |
|
## NOTE: $open_tables->[-1]->[0] is the "current table" element node. |
3016 |
|
## NOTE: $open_tables->[-1]->[1] is the "tainted" flag. |
3017 |
|
my $open_tables = [[$self->{open_elements}->[0]->[0]]]; |
3018 |
|
|
3019 |
my $formatting_end_tag = sub { |
my $formatting_end_tag = sub { |
3020 |
my $tag_name = shift; |
my $tag_name = shift; |
3021 |
|
|
3022 |
|
## NOTE: The adoptioon agency algorithm (AAA). |
3023 |
|
|
3024 |
FET: { |
FET: { |
3025 |
## Step 1 |
## Step 1 |
3026 |
my $formatting_element; |
my $formatting_element; |
3174 |
} # S7 |
} # S7 |
3175 |
|
|
3176 |
## Step 8 |
## Step 8 |
3177 |
$common_ancestor_node->[0]->append_child ($last_node->[0]); |
if ({ |
3178 |
|
table => 1, tbody => 1, tfoot => 1, thead => 1, tr => 1, |
3179 |
|
}->{$common_ancestor_node->[1]}) { |
3180 |
|
my $foster_parent_element; |
3181 |
|
my $next_sibling; |
3182 |
|
OE: for (reverse 0..$#{$self->{open_elements}}) { |
3183 |
|
if ($self->{open_elements}->[$_]->[1] eq 'table') { |
3184 |
|
my $parent = $self->{open_elements}->[$_]->[0]->parent_node; |
3185 |
|
if (defined $parent and $parent->node_type == 1) { |
3186 |
|
!!!cp ('t65.1'); |
3187 |
|
$foster_parent_element = $parent; |
3188 |
|
$next_sibling = $self->{open_elements}->[$_]->[0]; |
3189 |
|
} else { |
3190 |
|
!!!cp ('t65.2'); |
3191 |
|
$foster_parent_element |
3192 |
|
= $self->{open_elements}->[$_ - 1]->[0]; |
3193 |
|
} |
3194 |
|
last OE; |
3195 |
|
} |
3196 |
|
} # OE |
3197 |
|
$foster_parent_element = $self->{open_elements}->[0]->[0] |
3198 |
|
unless defined $foster_parent_element; |
3199 |
|
$foster_parent_element->insert_before ($last_node->[0], $next_sibling); |
3200 |
|
$open_tables->[-1]->[1] = 1; # tainted |
3201 |
|
} else { |
3202 |
|
!!!cp ('t65.3'); |
3203 |
|
$common_ancestor_node->[0]->append_child ($last_node->[0]); |
3204 |
|
} |
3205 |
|
|
3206 |
## Step 9 |
## Step 9 |
3207 |
my $clone = [$formatting_element->[0]->clone_node (0), |
my $clone = [$formatting_element->[0]->clone_node (0), |
3247 |
} # FET |
} # FET |
3248 |
}; # $formatting_end_tag |
}; # $formatting_end_tag |
3249 |
|
|
|
## NOTE: $open_tables->[-1]->[0] is the "current table". |
|
|
## NOTE: $open_tables->[-1]->[1] is the "tainted" flag. |
|
|
my $open_tables = [[$self->{open_elements}->[0]->[0]]]; |
|
|
|
|
3250 |
$insert = my $insert_to_current = sub { |
$insert = my $insert_to_current = sub { |
3251 |
$self->{open_elements}->[-1]->[0]->append_child ($_[0]); |
$self->{open_elements}->[-1]->[0]->append_child ($_[0]); |
3252 |
}; # $insert_to_current |
}; # $insert_to_current |