Subject: | <style> blocks without a "media" attribute |
In HTML if a <style> block doesn't have a media attribute then it
defaults to "screen". But CSS::Inliner assumes that if it doesn't have a
value it defaults to "undef". Not only does this give a warning but it
also skips blocks without a media attribute.
The attached patch fixes this.
Subject: | css-inliner.patch |
--- /home/mpeters/development/arcos/lib/CSS/Inliner.pm 2009-10-08 16:52:35.000000000 -0400
+++ /home/mpeters/development/arcos/lib/CSS/Inliner.pm.new 2010-01-19 13:45:59.897880125 -0500
@@ -207,7 +207,7 @@
foreach my $i (@{$$params{tree_content}}) {
next unless ref $i eq 'HTML::Element';
- if (($i->tag eq 'style') && ($i->attr('media') =~ m/\b(all|screen)\b/)) {
+ if (($i->tag eq 'style') && (!$i->attr('media') || $i->attr('media') =~ m/\b(all|screen)\b/)) {
foreach my $item ($i->content_list()) {
$style .= $item;