|Subject:||Some methods die when elem isn’ta element_class|
|Date:||Sun, 26 Sep 2010 12:32:04 -0700|
|To:||bug-HTML-Tree [...] rt.cpan.org|
|From:||Father Chrysostomos <sprout [...] cpan.org>|
In HTML::Tree 4, some methods check that the element passed as an argument belongs to the element_class or a subclass of it. Up till now, element_class only determined which constructor to call to create the element object. The ability for a constructor to return an object of any class I would consider a *feature* of Perl. HTML::Tree now breaks that. HTML::DOM::Element->new sometimes returns an HTML::DOM::Comment object. I’ve had to add a specialised isa method to HTML::DOM::Comment to work around this.