HTML::O...:Source(3)

πŸ“¦ version 0.6.0, in alpine 3.24

🌸 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 is 120px.
  • A medium image is used with a screen between 711px - 991px. The layout width is 193px.
  • A large image is used with a screen 992px and larger. The layout width is 278px.

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 parent HTML::Object::DOM::Element::Media's load method 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(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