/usr/share/perl5/HTML/Lint/HTML4.pm is in libhtml-lint-perl 2.20+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | package HTML::Lint::HTML4;
use warnings;
use strict;
use base 'Exporter';
our @EXPORT_OK = qw( %isKnownAttribute %isRequired %isNonrepeatable %isObsolete );
sub _hash { my %hash; @hash{@_} = (1) x scalar @_; return \%hash; }
our @physical = qw( b big code i kbd s small strike sub sup tt u xmp );
our @content = qw( abbr acronym cite code dfn em kbd samp strong var );
our @core = qw( class id style title );
our @i18n = qw( dir lang );
our @events = qw( onclick ondblclick onkeydown onkeypress onkeyup
onmousedown onmousemove onmouseout onmouseover onmouseup );
our @std = (@core,@i18n,@events);
our %isRequired = %{_hash( qw( html body head title ) )};
our %isNonrepeatable = %{_hash( qw( html head base title body isindex ))};
our %isObsolete = %{_hash( qw( listing plaintext xmp ) )};
# Some day I might do something with these. For now, they're just comments.
sub _ie_only { return @_ };
sub _ns_only { return @_ };
our %isKnownAttribute = (
# All the physical markup has the same
(map { $_=>_hash(@std) } (@physical, @content) ),
a => _hash( @std, qw( accesskey charset coords href hreflang name onblur onfocus rel rev shape tabindex target type ) ),
address => _hash( @std ),
applet => _hash( @std ),
area => _hash( @std, qw( accesskey alt coords href nohref onblur onfocus shape tabindex target ) ),
base => _hash( qw( href target ) ),
basefont => _hash( qw( color face id size ) ),
bdo => _hash( @core, @i18n ),
blockquote => _hash( @std, qw( cite ) ),
body => _hash( @std,
qw( alink background bgcolor link marginheight marginwidth onload onunload text vlink ),
_ie_only( qw( bgproperties leftmargin topmargin ) )
),
br => _hash( @core, qw( clear ) ),
button => _hash( @std, qw( accesskey disabled name onblur onfocus tabindex type value ) ),
caption => _hash( @std, qw( align ) ),
center => _hash( @std ),
cite => _hash(),
col => _hash( @std, qw( align char charoff span valign width ) ),
colgroup => _hash( @std, qw( align char charoff span valign width ) ),
del => _hash( @std, qw( cite datetime ) ),
div => _hash( @std, qw( align ) ),
dir => _hash( @std, qw( compact ) ),
dd => _hash( @std ),
dl => _hash( @std, qw( compact ) ),
dt => _hash( @std ),
embed => _hash(
qw( align height hidden name palette quality play src units width ),
_ns_only( qw( border hspace pluginspage type vspace ) ),
),
fieldset => _hash( @std ),
font => _hash( @core, @i18n, qw( color face size ) ),
form => _hash( @std, qw( accept-charset action enctype method name onreset onsubmit target ) ),
frame => _hash( @core, qw( frameborder longdesc marginheight marginwidth name noresize scrolling src ) ),
frameset => _hash( @core, qw( cols onload onunload rows border bordercolor frameborder framespacing ) ),
h1 => _hash( @std, qw( align ) ),
h2 => _hash( @std, qw( align ) ),
h3 => _hash( @std, qw( align ) ),
h4 => _hash( @std, qw( align ) ),
h5 => _hash( @std, qw( align ) ),
h6 => _hash( @std, qw( align ) ),
head => _hash( @i18n, qw( profile ) ),
hr => _hash( @core, @events, qw( align noshade size width ) ),
html => _hash( @i18n, qw( version xmlns xml:lang ) ),
iframe => _hash( @core, qw( align frameborder height longdesc marginheight marginwidth name scrolling src width ) ),
img => _hash( @std, qw( align alt border height hspace ismap longdesc name src usemap vspace width ) ),
input => _hash( @std, qw( accept accesskey align alt border checked disabled maxlength name onblur onchange onfocus onselect readonly size src tabindex type usemap value ) ),
ins => _hash( @std, qw( cite datetime ) ),
isindex => _hash( @core, @i18n, qw( prompt ) ),
label => _hash( @std, qw( accesskey for onblur onfocus ) ),
legend => _hash( @std, qw( accesskey align ) ),
li => _hash( @std, qw( type value ) ),
'link' => _hash( @std, qw( charset href hreflang media rel rev target type ) ),
'map' => _hash( @std, qw( name ) ),
menu => _hash( @std, qw( compact ) ),
meta => _hash( @i18n, qw( content http-equiv name scheme ) ),
nobr => _hash( @std ),
noframes => _hash( @std ),
noscript => _hash( @std ),
object => _hash( @std, qw( align archive border classid codebase codetype data declare height hspace name standby tabindex type usemap vspace width )),
ol => _hash( @std, qw( compact start type ) ),
optgroup => _hash( @std, qw( disabled label ) ),
option => _hash( @std, qw( disabled label selected value ) ),
p => _hash( @std, qw( align ) ),
param => _hash( qw( id name type value valuetype ) ),
plaintext => _hash(),
pre => _hash( @std, qw( width ) ),
q => _hash( @std, qw( cite ) ),
script => _hash( qw( charset defer event for language src type ) ),
'select' => _hash( @std, qw( disabled multiple name onblur onchange onfocus size tabindex ) ),
span => _hash( @std ),
style => _hash( @i18n, qw( media title type ) ),
table => _hash( @std,
qw( align bgcolor border cellpadding cellspacing datapagesize frame rules summary width ),
_ie_only( qw( background bordercolor bordercolordark bordercolorlight ) ),
_ns_only( qw( bordercolor cols height hspace vspace ) ),
),
tbody => _hash( @std, qw( align char charoff valign ) ),
td => _hash( @std,
qw( abbr align axis bgcolor char charoff colspan headers height nowrap rowspan scope valign width ),
_ie_only( qw( background bordercolor bordercolordark bordercolorlight ) ),
),
textarea => _hash( @std, qw( accesskey cols disabled name onblur onchange onfocus onselect readonly rows tabindex wrap ) ),
th => _hash( @std,
qw( abbr align axis bgcolor char charoff colspan headers height nowrap rowspan scope valign width ),
_ie_only( qw( background bordercolor bordercolordark bordercolorlight ) ),
),
thead => _hash( @std, qw( align char charoff valign ) ),
tfoot => _hash( @std, qw( align char charoff valign ) ),
title => _hash( @i18n ),
tr => _hash( @std,
qw( align bgcolor char charoff valign ),
_ie_only( qw( bordercolor bordercolordark bordercolorlight nowrap ) ),
_ns_only( qw( nowrap ) ),
),
ul => _hash( @std, qw( compact type ) ),
);
=for oldobsoletestuffthatIwanttokeep
my %booger = (
'maybePaired' => 'LI DT DD P TD TH TR OPTION COLGROUP THEAD TFOOT TBODY COL',
'expectArgsRE' => 'A|FONT',
'headTagsRE' => 'TITLE|NEXTID|LINK|BASE|META',
'requiredContext' =>
{
'AREA' => 'MAP',
'CAPTION' => 'TABLE',
'DD' => 'DL',
'DT' => 'DL',
'FIELDSET' => 'FORM',
'FRAME' => 'FRAMESET',
'INPUT' => 'FORM',
'LABEL' => 'FORM',
'LEGEND' => 'FIELDSET',
'LI' => 'DIR|MENU|OL|UL',
'NOFRAMES' => 'FRAMESET',
'OPTGROUP' => 'SELECT',
'OPTION' => 'SELECT',
'SELECT' => 'FORM',
'TD' => 'TR',
'TEXTAREA' => 'FORM',
'TH' => 'TR',
'TR' => 'TABLE',
'PARAM' => 'APPLET|OBJECT',
},
'okInHead' =>
{
'ISINDEX' => 1,
'TITLE' => 1,
'NEXTID' => 1,
'LINK' => 1,
'BASE' => 1,
'META' => 1,
'RANGE' => 1,
'STYLE' => 1,
'OBJECT' => 1,
'!--' => 1,
},
## elements which cannot be nested
'nonNest' => 'A|FORM',
'requiredAttributes' =>
{
APPLET => 'WIDTH|HEIGHT',
AREA => 'ALT',
BASE => 'HREF',
BASEFONT => 'SIZE',
BDO => 'DIR',
FORM => 'ACTION',
IMG => 'SRC|ALT',
LINK => 'HREF',
MAP => 'NAME',
NEXTID => 'N',
SELECT => 'NAME',
TEXTAREA => 'NAME|ROWS|COLS'
},
'attributeFormat' =>
{
'ALIGN', 'BOTTOM|MIDDLE|TOP|LEFT|CENTER|RIGHT|JUSTIFY|'.
'BLEEDLEFT|BLEEDRIGHT|DECIMAL',
'ALINK' => 'color',
'BGCOLOR' => 'color',
'CLEAR', 'LEFT|RIGHT|ALL|NONE',
'COLOR' => 'color',
'COLS', '\d+|(\d*[*%]?,)*\s*\d*[*%]?',
'COLSPAN', '\d+',
'DIR' => 'LTR|RTL',
'HEIGHT', '\d+',
'INDENT', '\d+',
'LINK' => 'color',
'MAXLENGTH', '\d+',
'METHOD', 'GET|POST',
'ROWS', '\d+|(\d*[*%]?,)*\s*\d*[*%]?',
'ROWSPAN', '\d+',
'SEQNUM', '\d+',
'SIZE', '[-+]?\d+|\d+,\d+',
'SKIP', '\d+',
'TYPE', 'CHECKBOX|HIDDEN|IMAGE|PASSWORD|RADIO|RESET|'.
'SUBMIT|TEXT|[AaIi1]|disc|square|circle|'.
'FILE|.*',
'UNITS', 'PIXELS|EN',
'VALIGN', 'TOP|MIDDLE|BOTTOM|BASELINE',
'VLINK' => 'color',
'WIDTH', '\d+%?',
'WRAP', 'OFF|VIRTUAL|PHYSICAL',
'X', '\d+',
'Y', '\d+'
},
'badTextContext' =>
{
'HEAD', 'BODY, or TITLE perhaps',
'UL', 'LI or LH',
'OL', 'LI or LH',
'DL', 'DT or DD',
'TABLE', 'TD or TH',
'TR', 'TD or TH'
},
'bodyColorAttributes' =>
[
qw(BGCOLOR TEXT LINK ALINK VLINK)
],
);
=cut
1;
__END__
=head1 NAME
HTML::Lint::HTML4 -- Rules for HTML 4 as used by HTML::Lint.
=head1 SYNOPSIS
No user serviceable parts inside. Used by HTML::Lint.
=head1 SEE ALSO
=over 4
=item HTML::Lint
=back
=head1 AUTHOR
Andy Lester C<andy at petdance.com>
=head1 COPYRIGHT
Copyright (c) Andy Lester 2005. All Rights Reserved.
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
=cut
|