Revision history for HTML::DOM 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_listener 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_listener 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