| 1 | package SVG::DOM2::Element::Document; | ||
| 2 | |||
| 3 | =pod | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | SVG::DOM2::Element::Document - svg document functions | ||
| 8 | |||
| 9 | =head1 SUMMARY | ||
| 10 | |||
| 11 | Provides the svg document object with the required DOM | ||
| 12 | interface for document wide element requests. | ||
| 13 | |||
| 14 | =head1 METHODS | ||
| 15 | |||
| 16 | =cut | ||
| 17 | |||
| 18 | 1 | ▶ | use base "XML::DOM2::Element::Document"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | use Carp; | ||
| 20 | |||
| 21 | sub new | ||
| 22 | { | ||
| 23 | my ($proto, %args) = @_; | ||
| 24 | return $proto->SUPER::new(%args); | ||
| 25 | } | ||
| 26 | |||
| 27 | sub _attribute_handle | ||
| 28 | { | ||
| 29 | my ($self, $name, %opts) = @_; | ||
| 30 | my $ns = $opts{'namespace'}; | ||
| 31 | return SVG::DOM2::Attribute::Metric->new(%opts) | ||
| 32 | if $name eq 'width' | ||
| 33 | or $name eq 'height'; | ||
| 34 | return $self->SUPER::_attribute_handle($name, %opts); | ||
| 35 | } | ||
| 36 | |||
| 37 | sub attr | ||
| 38 | { | ||
| 39 | my ($self, $name, $set) = @_; | ||
| 40 | $self->setAttribute($name, $set) if defined($set); | ||
| 41 | return $self->getAttribute($name); | ||
| 42 | } | ||
| 43 | |||
| 44 | sub width { shift->attr('width', @_); } | ||
| 45 | sub height { shift->attr('height', @_); } | ||
| 46 | |||
| 47 | =head1 AUTHOR | ||
| 48 | |||
| 49 | Martin Owens, doctormo@postmaster.co.uk | ||
| 50 | |||
| 51 | =head1 SEE ALSO | ||
| 52 | |||
| 53 | perl(1), L<XML::DOM2>, L<XML::DOM2::Element>, L<XML::DOM2::DOM> | ||
| 54 | |||
| 55 | L<http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html> DOM at the W3C | ||
| 56 | |||
| 57 | =cut | ||
| 58 | |||
| 59 | return 1; | ||