HTML::O...:Source(3)
πΈ NAME πΈ
HTML::O...:Source(3) β from the User Contributed Perl Documentation β is the page for HTML::Object::DOM::Element::Source, the HTML Object DOM Source Class. Slay, let's get into it π
β¨ SYNOPSIS β¨
okay bestie, load it like this:
use HTML::Object::DOM::Element::Source;
my $source = HTML::Object::DOM::Element::Source->new ||
die( HTML::Object::DOM::Element::Source->error, "\n" );
π VERSION π
v0.2.0
π¦ DESCRIPTION π¦
This interface provides special properties (beyond the regular HTML::Object::DOM::Element object interface it also has available to it by inheritance) for manipulating <source> elements. It's giving "I have extra source-element powers" energy β¨
π INHERITANCE π
the family tree is giving main-character lineage, no cap:
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +------------------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Source |
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +------------------------------------+
π PROPERTIES π
Inherits properties from its parent HTML::Object::DOM::Element β iconic inheritance behavior, periodt.
media
Is a string reflecting the media HTML attribute, containing the intended type of the media resource.
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLSourceElement/media π
sizes
The sizes HTML attribute on an "source" element specifies different image widths.
These widths are tied to browser conditions which helps create responsive images.
Example:
<picture>
<source srcset="/some/where/image-sm.jpg 120w,
/some/where/image.jpg 193w,
/some/where/image-lg.jpg 278w"
sizes="(max-width: 710px) 120px,
(max-width: 991px) 193px,
278px" />
<img src="/some/where/image-lg.jpg" alt="Some image" />
</picture>
This means that:
- A small image is used with a screen between
0 - 710px. The layout width is120px. - A medium image is used with a screen between
711px - 991px. The layout width is193px. - A large image is used with a screen
992pxand larger. The layout width is278px.
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLSourceElement/sizes π¦
src
Is a string reflecting the src HTML attribute, containing the URL for the media resource. The "src" property has a meaning only when the associated "source" element is nested in a media element that is a video or an audio element. It has no meaning and is ignored when it is nested in a "picture" element.
Note bestie: if the"src"property is updated (along with any siblings), the parentHTML::Object::DOM::Element::Media'sloadmethod should be called when done, since"source"elements are not re-scanned automatically. π
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLSourceElement/src πΈ
srcset
Is a string reflecting the srcset HTML attribute, containing a list of candidate images, separated by a comma (,, U+002C COMMA). A candidate image is a URL followed by a 'w' with the width of the images, or an 'x' followed by the pixel density.
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLSourceElement/srcset π₯
type
Is a string reflecting the type HTML attribute, containing the type of the media resource.
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLSourceElement/type π
π§ METHODS π§
Inherits methods from its parent HTML::Object::DOM::Element. No extra method list here, bestie β it's inheritance only, and that's the vibe π
π AUTHOR π
Jacques Deguest <jack@deguest.jp> β icon behavior, fr fr π
π« SEE ALSO π«
Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLSourceElement, and Mozilla documentation on source element https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source π«Ά
π COPYRIGHT & LICENSE π
Copyright(c) 2021 DEGUEST Pte. Ltd.
All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay bestie, that's a wrap π this was HTML::O...:Source(3) from perl v5.42.2, dated 2026-02-15 β bye, ilysm π
π¦ where this page comes from
- alpine 3.24: perl-html-object-doc 0.6.0-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms