302 |
## embedded content. |
## embedded content. |
303 |
}; |
}; |
304 |
|
|
305 |
|
our $IsInHTMLInteractiveContent = sub { |
306 |
|
my ($el, $nsuri, $ln) = @_; |
307 |
|
|
308 |
|
## NOTE: This CODE returns whether an element that is conditionally |
309 |
|
## categorizzed as an interactive content is currently in that |
310 |
|
## condition or not. See $HTMLInteractiveContent list defined in |
311 |
|
## Whatpm::ContentChecler::HTML for the list of all (conditionally |
312 |
|
## or permanently) interactive content. |
313 |
|
|
314 |
|
if ($nsuri eq $HTML_NS and ($ln eq 'video' or $ln eq 'audio')) { |
315 |
|
return $el->has_attribute ('controls'); |
316 |
|
} elsif ($nsuri eq $HTML_NS and $ln eq 'menu') { |
317 |
|
my $value = $el->get_attribute ('type'); |
318 |
|
$value =~ tr/A-Z/a-z/; # ASCII case-insensitive |
319 |
|
return ($value eq 'toolbar'); |
320 |
|
} else { |
321 |
|
return 1; |
322 |
|
} |
323 |
|
}; # $IsInHTMLInteractiveContent |
324 |
|
|
325 |
my $HTMLTransparentElements = { |
my $HTMLTransparentElements = { |
326 |
$HTML_NS => {qw/ins 1 del 1 font 1 noscript 1 canvas 1 a 1/}, |
$HTML_NS => {qw/ins 1 del 1 font 1 noscript 1 canvas 1 a 1/}, |
327 |
## NOTE: |html:noscript| is transparent if scripting is disabled |
## NOTE: |html:noscript| is transparent if scripting is disabled |