line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Rose::HTML::Label; |
2
|
|
|
|
|
|
|
|
3
|
36
|
|
|
36
|
|
1379
|
use strict; |
|
36
|
|
|
|
|
315
|
|
|
36
|
|
|
|
|
1125
|
|
4
|
|
|
|
|
|
|
|
5
|
36
|
|
|
36
|
|
13416
|
use Rose::HTML::Text; |
|
36
|
|
|
|
|
123
|
|
|
36
|
|
|
|
|
318
|
|
6
|
|
|
|
|
|
|
|
7
|
36
|
|
|
36
|
|
245
|
use base 'Rose::HTML::Object'; |
|
36
|
|
|
|
|
77
|
|
|
36
|
|
|
|
|
10838
|
|
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
|
3250
|
sub html_element { 'label' } |
21
|
48
|
|
|
48
|
1
|
247
|
sub xhtml_element { 'label' } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub contents |
24
|
|
|
|
|
|
|
{ |
25
|
416
|
|
|
416
|
0
|
2267
|
my($self) = shift; |
26
|
416
|
50
|
|
|
|
1107
|
$self->children(map { UNIVERSAL::isa($_, 'Rose::HTML::Object') ? $_ : |
|
416
|
50
|
|
|
|
2437
|
|
27
|
|
|
|
|
|
|
Rose::HTML::Text->new(html => $_) } @_) if(@_); |
28
|
416
|
|
|
|
|
1060
|
return join('', map { $_->html } $self->children) |
|
416
|
|
|
|
|
921
|
|
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. |