line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Rose::HTML::Label; |
2
|
|
|
|
|
|
|
|
3
|
36
|
|
|
36
|
|
1794
|
use strict; |
|
36
|
|
|
|
|
277
|
|
|
36
|
|
|
|
|
1183
|
|
4
|
|
|
|
|
|
|
|
5
|
36
|
|
|
36
|
|
13151
|
use Rose::HTML::Text; |
|
36
|
|
|
|
|
133
|
|
|
36
|
|
|
|
|
341
|
|
6
|
|
|
|
|
|
|
|
7
|
36
|
|
|
36
|
|
240
|
use base 'Rose::HTML::Object'; |
|
36
|
|
|
|
|
89
|
|
|
36
|
|
|
|
|
11069
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.606'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
__PACKAGE__->add_valid_html_attrs |
12
|
|
|
|
|
|
|
( |
13
|
|
|
|
|
|
|
'for', # IDREF #IMPLIED -- matches field ID value -- |
14
|
|
|
|
|
|
|
'accesskey', # %Character; #IMPLIED -- accessibility key character -- |
15
|
|
|
|
|
|
|
'onfocus', # %Script; #IMPLIED -- the element got the focus -- |
16
|
|
|
|
|
|
|
'onblur', # %Script; #IMPLIED -- the element lost the focus -- |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
0
|
1
|
0
|
sub element { 'label' } |
20
|
790
|
|
|
790
|
1
|
3320
|
sub html_element { 'label' } |
21
|
48
|
|
|
48
|
1
|
236
|
sub xhtml_element { 'label' } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub contents |
24
|
|
|
|
|
|
|
{ |
25
|
416
|
|
|
416
|
0
|
2251
|
my($self) = shift; |
26
|
416
|
50
|
|
|
|
1157
|
$self->children(map { UNIVERSAL::isa($_, 'Rose::HTML::Object') ? $_ : |
|
416
|
50
|
|
|
|
2403
|
|
27
|
|
|
|
|
|
|
Rose::HTML::Text->new(html => $_) } @_) if(@_); |
28
|
416
|
|
|
|
|
1097
|
return join('', map { $_->html } $self->children) |
|
416
|
|
|
|
|
991
|
|
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 NAME |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Rose::HTML::Label - Object representation of the "label" HTML tag. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 SYNOPSIS |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my $label = Rose::HTML::Label->new(for => 'name', |
42
|
|
|
|
|
|
|
contents => 'Name'); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# <label for="name">Name</label> |
45
|
|
|
|
|
|
|
print $i->html; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
$i->accesskey('n'); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# <label accesskey="n" for="name">Name</label> |
50
|
|
|
|
|
|
|
print $i->xhtml; |
51
|
|
|
|
|
|
|
... |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 DESCRIPTION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
L<Rose::HTML::Label> is an object representation of the E<lt>labelE<gt> HTML tag. Yes, there really is a E<lt>labelE<gt> tag in both HTML 4.01 and XHTML 1.0. Look it up. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
This class inherits from, and follows the conventions of, L<Rose::HTML::Object>. Inherited methods that are not overridden will not be documented a second time here. See the L<Rose::HTML::Object> documentation for more information. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 HTML ATTRIBUTES |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Valid attributes: |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
accesskey |
64
|
|
|
|
|
|
|
class |
65
|
|
|
|
|
|
|
dir |
66
|
|
|
|
|
|
|
for |
67
|
|
|
|
|
|
|
id |
68
|
|
|
|
|
|
|
lang |
69
|
|
|
|
|
|
|
onblur |
70
|
|
|
|
|
|
|
onclick |
71
|
|
|
|
|
|
|
ondblclick |
72
|
|
|
|
|
|
|
onfocus |
73
|
|
|
|
|
|
|
onkeydown |
74
|
|
|
|
|
|
|
onkeypress |
75
|
|
|
|
|
|
|
onkeyup |
76
|
|
|
|
|
|
|
onmousedown |
77
|
|
|
|
|
|
|
onmousemove |
78
|
|
|
|
|
|
|
onmouseout |
79
|
|
|
|
|
|
|
onmouseover |
80
|
|
|
|
|
|
|
onmouseup |
81
|
|
|
|
|
|
|
style |
82
|
|
|
|
|
|
|
title |
83
|
|
|
|
|
|
|
xml:lang |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 AUTHOR |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
John C. Siracusa (siracusa@gmail.com) |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 LICENSE |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Copyright (c) 2010 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |