HTML::O...OM::List(3)

πŸ“¦ version 0.6.0, in alpine 3.24

okay so bestie, welcome to HTML::O...OM::List(3) β€” the User Contributed Perl Documentation page for the HTML Object DOM List abstract class. it's giving Perl internals, but make it make sense πŸ’… no cap.

πŸŽ€ NAME πŸŽ€

HTML::Object::DOM::List β€” HTML Object DOM List Abstract Class. periodt.

✨ SYNOPSIS ✨

package HTML::Object::DOM::VideoTrackList;
use parent qw( HTML::Object::DOM::List );

my $list = HTML::Object::DOM::VideoTrackList->new || d
    ie( HTML::Object::DOM::VideoTrackList->error, "\n" );

πŸ’– VERSION πŸ’–

v0.3.0

πŸ¦‹ DESCRIPTION πŸ¦‹

This is an abstract class designed to be inherited by HTML::Object::DOM::TextTrackCueList, HTML::Object::DOM::TextTrackList and HTML::Object::DOM::VideoTrackList.

It inherits from HTML::Object::EventTarget.

abstract-class vibe check: it's designed to be inherited by those three modules, bestie πŸ’…

🌈 INHERITANCE 🌈

+-----------------------+     +---------------------------+     +-------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::List |
+-----------------------+     +---------------------------+     +-------------------------+

πŸ”₯ METHODS πŸ”₯

addEventListener

This is a variant from the usual "addEventListener" from HTML::Object::EventTarget. This method takes 3 arguments:

  1. A dictionary hash reference β€” this dictionary contains a key for each event name and another hash reference as their value. That hash reference contains the following properties:
    • callback β€” optional property whose value is a code reference to be called after creating the event and before dispatching it with "dispatchEvent" in HTML::Object::EventTarget. The purpose is to give it a chance to add some property value to the event like "track" for HTML::Object::DOM::TrackEvent fired by HTML::Object::DOM::TextTrackCueList, HTML::Object::DOM::TextTrackList and HTML::Object::DOM::VideoTrackList. iykyk.
    • event β€” the event name.
    • property β€” the module property or method name.
    • type β€” the type of callback to set for this property. Possible values are: "add" or "remove".
  2. An event type
  3. An event handler callback

When "addEventListener" is called, it will check if, for the given event type passed, there is an entry in the dictionary, and if there is it will enable an internal callback on the associated module property when there is any change to its underlying value.

This relies on "callback" in Module::Generic::Array and "callback" in Module::Generic::Scalar. literally.

That internal callback will be called when a change occurs, and will create an event of type "type" and call "dispatchEvent" in HTML::Object::EventTarget passing it the newly created event.

If a "callback" was specified in the dictionary for this event type, the callback code will be executed, and the whatever value added or removed will be passed to the callback as a hash reference and a hash property "added" or "removed" depending if the operation was to add or remove a value.

After having set this internal callback to monitor change, if any, this will call its parent addEventListener to register the event listener. slay ✨

forEach

Calls "foreach" on the array object returned by "children" in HTML::Object::Element method. iconic.

length

Returns the size of the list, starting from 1. yes, 1 β€” not a typo 🫢

push

Provided with some data and they will be appended to this list object. fr fr.

πŸ’œ AUTHOR πŸ’œ

Jacques Deguest <jack@deguest.jp>

🌸 SEE ALSO 🌸

the whole squad:

  • HTML::Object::EventTarget
  • HTML::Object::Event
  • HTML::Object::DOM::TextTrackCueList
  • HTML::Object::DOM::TextTrackCueList
  • HTML::Object::DOM::VideoTrackList

legal bestie moment:

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.


mwah πŸ’‹ β€” this page is from perl v5.42.2, dated 2026-02-15, for HTML::O...OM::List(3). bye bestie 🫢

πŸ“¦ where this page comes from