NAME

HTML::Object::DOM::Element::Body - HTML Object DOM Body Class

SYNOPSIS

use HTML::Object::DOM::Element::Body;
my $body = HTML::Object::DOM::Element::Body->new || 
    die( HTML::Object::DOM::Element::Body->error, "\n" );

VERSION

v0.2.0

INHERITANCE

+-----------------------+     +---------------------------+     +-------------------------+     +----------------------------+     +----------------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Body |
+-----------------------+     +---------------------------+     +-------------------------+     +----------------------------+     +----------------------------------+

DESCRIPTION

The HTML::Object::DOM::Element::Body interface provides special properties (beyond those inherited from the regular HTML::Object::DOM::Element interface) for manipulating <body> elements.

PROPERTIES

Inherits properties from its parent HTML::Object::DOM::Element

OBSOLETE PROPERTIES

Those properties all return undef

Is a string that represents the color of active hyperlinks.

See also Mozilla documentation

background

Is a string that represents the description of the location of the background image resource. Note that this is not an URI, though some older version of some browsers do expect it.

See also Mozilla documentation

bgColor

Is a string that represents the background color for the document.

See also Mozilla documentation

Is a string that represents the color of unvisited links.

See also Mozilla documentation

text

Is a string that represents the foreground color of text.

See also Mozilla documentation

Is a string that represents the color of visited links.

See also Mozilla documentation

METHODS

Inherits methods from its parent HTML::Object::DOM::Element

EVENT HANDLERS

Below are the event handlers you can use and that are implemented in this interface. However, it is up to you to fire those related events.

onafterprint

Is an event handler representing the code to be called when the afterprint event is raised.

See also Mozilla documentation

onbeforeprint

Is an event handler representing the code to be called when the beforeprint event is raised.

See also Mozilla documentation

onbeforeunload

Is an event handler representing the code to be called when the beforeunload event is raised.

Example:

use HTML::Object::DOM qw( window );
window->addEventListener( beforeunload => sub
{
    # Cancel the event
    # If you prevent default behavior in Mozilla Firefox prompt will always be shown
    $e->preventDefault();
    # Chrome requires returnValue to be set
    $e->returnValue = '';
});

See also Mozilla documentation

onhashchange

Is an event handler representing the code to be called when the hashchange event is raised.

See also Mozilla documentation

onlanguagechange

Is an event handler representing the code to be called when the languagechange event is raised.

Example:

object->onlanguagechange = function;

window->onlanguagechange = sub
{
    say( 'languagechange event detected!' );
};

See also Mozilla documentation

onmessage

Is an event handler called whenever an object receives a message event.

See also Mozilla documentation

onmessageerror

Is an event handler called whenever an object receives a messageerror event.

See also Mozilla documentation

onoffline

Is an event handler representing the code to be called when the offline event is raised.

See also Mozilla documentation

ononline

Is an event handler representing the code to be called when the online event is raised.

See also Mozilla documentation

onpagehide

Is an event handler representing the code to be called when the pagehide event is raised.

See also Mozilla documentation

onpageshow

Is an event handler representing the code to be called when the pageshow event is raised.

See also Mozilla documentation

onpopstate

Is an event handler representing the code to be called when the popstate event is raised.

Example:

window->onpopstate = sub
{
    my $event = shift( @_ );
    say( "location: " . $doc->location . ", state: " . JSON->new->encode( $event->state ) );
};

$history->pushState({page => 1}, "title 1", "?page=1");
$history->pushState({page => 2}, "title 2", "?page=2");
$history->replaceState({page => 3}, "title 3", "?page=3");
$history->back(); # alerts "location: https://example.org/example.html?page=1, state => {"page" => 1}"
$history->back(); # alerts "location: https://example.org/example.html, state: null
$history->go(2);    # alerts "location: https://example.org/example.html?page=3, state => {"page" =>3}

See also Mozilla documentation

onrejectionhandled

An event handler representing the code executed when the rejectionhandled event is raised, indicating that a Promise was rejected and the rejection has been handled.

See also Mozilla documentation

onresize

Is an event handler representing the code to be called when the resize event is raised.

See also Mozilla documentation

onstorage

Is an event handler representing the code to be called when the storage event is raised.

See also Mozilla documentation

onunhandledrejection

An event handler representing the code executed when the unhandledrejection event is raised, indicating that a Promise was rejected but the rejection was not handled.

See also Mozilla documentation

onunload

Is an event handler representing the code to be called when the unload event is raised.

See also Mozilla documentation

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Mozilla documentation, Mozilla documentation on anchor element

COPYRIGHT & LICENSE

Copyright(c) 2022 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.