1113 |
} |
} |
1114 |
} # manakai_compat_mode |
} # manakai_compat_mode |
1115 |
|
|
1116 |
|
## TODO: documentation |
1117 |
|
sub manakai_head ($) { |
1118 |
|
local $Error::Depth = $Error::Depth + 1; |
1119 |
|
my $html = $_[0]->manakai_html; |
1120 |
|
return undef unless defined $html; |
1121 |
|
for my $el (@{$html->child_nodes}) { |
1122 |
|
next unless $el->node_type == 1; # ELEMENT_NODE |
1123 |
|
my $nsuri = $el->namespace_uri; |
1124 |
|
next unless defined $nsuri; |
1125 |
|
next unless $nsuri eq q<http://www.w3.org/1999/xhtml>; |
1126 |
|
next unless $el->manakai_local_name eq 'head'; |
1127 |
|
return $el; |
1128 |
|
} |
1129 |
|
return undef; |
1130 |
|
} # manakai_head |
1131 |
|
|
1132 |
|
## TODO: documentation |
1133 |
|
sub manakai_html ($) { |
1134 |
|
local $Error::Depth = $Error::Depth + 1; |
1135 |
|
my $de = $_[0]->document_element; |
1136 |
|
my $nsuri = $de->namespace_uri; |
1137 |
|
if (defined $nsuri and $nsuri eq q<http://www.w3.org/1999/xhtml> and |
1138 |
|
$de->manakai_local_name eq 'html') { |
1139 |
|
return $de; |
1140 |
|
} else { |
1141 |
|
return undef; |
1142 |
|
} |
1143 |
|
} # manakai_html |
1144 |
|
|
1145 |
sub inner_html ($;$) { |
sub inner_html ($;$) { |
1146 |
my $self = $_[0]; |
my $self = $_[0]; |
1147 |
local $Error::Depth = $Error::Depth + 1; |
local $Error::Depth = $Error::Depth + 1; |