Revision history for HTML::DOM
0.047 13 February, 2011
Bug fix: Implicitly-closed forms were being associated with
inputs in subsequent forms, resulting in there being two
forms that contain the same input element in their ->elements
and ->inputs arrays (RT #65363).
0.046 23 January, 2011
Bug fixes:
• Setting innerHTML and calling the insertAdjacent* methods
now cause node lists and collections to be updated.
• Calling ->checked(1) on a radio button now unchecks other
radio buttons in the same group.
• Checking a radio button via the HTML::Form interface
($form->value(...), $form->find_input(...)->value(...)) now
causes other radio buttons in the same group to become
unchecked.
0.045 21 November, 2010
Incompatible change: event_parent now holds a weak reference.
New feature: weaken_response constructor argument to indicate
that the HTML::DOM object should hold a weak reference to the
response object.
0.044 26 September, 2010
Bug fixes:
• Fixed to work with HTML::Tree 4
0.043 15 August, 2010
Bug fixes:
• Fixed to work with HTML::Tree 3.23_x
• HTML::DOM::Element can now be loaded without HTML::DOM
already loaded.
0.042 18 July, 2010
One bug fix: Unmatched and tags no longer close
elements that are outside the innermost enclosing table.
0.041 13 June, 2010
Bug fixes:
• A CharacterData node’s data method now stringifies its argu-
ment, to avoid tripping up HTML::Element methods like
as_text by storing a reference in the attribute. This also
affects other methods, including a title element’s text
method and a document’s title method.
• Setting the selected attribute of an orphaned option ele-
ment (one that is not inside a select elem) no longer
causes errors.
• innerText is now listed in %HTML::DOM::Interface.
• $element->getElementsByTagName used to start searching at
the $element itself, instead of its children. Now it starts
with the children.
• $element->setAttribute now stringifies the value. This
solves the problem of getAttributeNode’s returning just the
value instead of an Attr node, if the value happened to be
a reference.
• cloneNode with a true argument (deep clone) now sets the
ownerDocument properly.
• Setting a boolean attribute through the DOM 0 interface now
works properly: instead of being set to whatever value you
pass in converted to a string, it is set to the name of the
attribute (for true values) or deleted (for false values).
0.040 23 May, 2010
Bug fix: Calling $doc->write from an elem handler now parses
the HTML code immediately instead of buffering it and waiting
for the elem handler to return. This allows aberrations like
$doc->write(""); $doc->getElementById('i1')...
to work.
0.039 18 April, 2010
Bug fix: Submitting a GET form with a data: URL (or any URI
object without a query_form method) now just uses the URL
itself, discarding any data.
0.038 28 March, 2010
Bug fix: A run-time require that was causing problems in
taint mode has been removed.
0.037 3 January, 2010
New feature: getElementsByClassName
0.036 27 December, 2009
Incompatible change:
• A newly-created HTML::DOM object no longer has html, head
and body elements. These are not created until open, write
or parse_file is called.
New features:
• New innerText method on HTML elements
• css_url_fetcher used to have no return value. Now it
returns a previously assigned callback function.
• css_url_fetcher no longer clobbers an existing link element
handler, because it now uses a new, separate mechanism.
Bug fixes:
• $elem->innerHTML now encodes HTML character entities in
text nodes that are the element’s direct children.
• Modifying the href attribute of a link element whose rel
attribute is set to stylesheet now resets the style sheet.
• The target and currentTarget methods of events now return
empty lists (instead of lists containing undef) before
event dispatch.
• If an elem_handler removes the root element from the docu-
ment, it no longer causes an error when HTML::DOM next
tries to call an elem_handler.
• parse_file no longer dies if called after ‘close’ or when
the root element has been removed.
• The close, innerHTML and elem_handler methods of the docu-
ment no longer die if the root element has been removed.
• HTML::DOM’s innerHTML (as opposed to Element’s) now returns
an empty string when the document has no children. It used
to return undef.
Other changes:
• HTML::DOM::Interface no longer lists HTML::DOM::TreeBuilder,
as that internal-only class has gone.
0.035 1 November, 2009
Bug fixes:
• Silly me. I fixed a bug in getElementById in the previous
release, and in doing so caused a more serious bug. I
blinded getElementById to sub-elements of forms. This is
now fixed.
• The note below under 0.033 about base being ‘better at deal-
ing with invalid documents’ is wrong. That change actually
made it worse. Sometimes it would work, and sometimes not,
depending on previous regular expression matches. (This is
now fixed, of course.)
0.034 25 October, 2009
Incompatible change:
• Node insertion methods no longer produce WRONG_DOCUMENT_ERR
errors. It turns out that every web browser (except IE 6)
completely disregards the DOM spec in this regard.
• When attr_event_listener was renamed event_handler, the old
name was kept for temporary backward compatibility. The
internals still used the old name, so subclasses overriding
it would have to use it. Now the internals use the new name,
so subclasses have to change.
Bug fixes:
• HTML::DOM’s title method no longer dies when the title ele-
ment does not exist.
• Event dispatch no longer leaves junk in $@.
• Whitespace is now preserved when a
element’s inner-
HTML is assigned to. We fixed this by preserving all white-
space everywhere, which is what web browsers do anyway.
• The event handler wrapper that get_event_listeners returns
no longer closes over the event target, but gets it from
the event object passed as its first argument. This allows
the listener to be used on another object (e.g., if a sub-
class overrides get_event_listeners to retrieve listeners
from another object).
• getElementById now works when the element’s ID attribute is
set to a reference.
0.033 18 October, 2009
New features:
• HTML::DOM’s base method now falls back to the HTTP headers
(of the response object) if the document lacks a
elem. It is also better at dealing with invalid documents
that include a before a .
• Coderefs registered via elem_handler are now triggered when
a node is inserted into the document, as well as dur-
ing parsing.
Bug fix:
• HTML::DOM::Interface now includes the contentWindow method
in the HTMLFrameElement and HTMLIFrameElement interfaces.
0.032 9 October, 2009
Incompatible change:
• An event_attr_handler that provides a subroutine ending
with a line like
defined $ret and !$ret and $event->preventDefault
will now end up triggering preventDefault in the case
of an undefined $ret. This is the result of the first
new feature:
New features:
• The event dispatch mechanism now distinguishes between
event listeners (added via addEventListener) and event han-
dlers (those assigned via attr_event_listener or one of the
on* methods), calling preventDefault as appropriate based
on the latter’s return value. To achieve this, we have made
get_event_listeners return not the event handler itself,
but a closure that calls the event handler and checks its
return value.
• The closure returned by get_event_listeners also checks
whether the handler is an object with a call_with method.
If it is, it calls it with the current event target as its
first argument and the event object as the second.
• insertAdjacentHTML and insertAdjacentElement
Bug fixes:
• HTML::DOM::Interface now exports the UTF16 constant.
• innerHTML no longer omits before