Skip Menu |
 

This queue is for tickets about the HTML-Tree CPAN distribution.

Report information
The Basics
Id: 61673
Status: resolved
Priority: 0/
Queue: HTML-Tree

People
Owner: Jeff.Fearn [...] gmail.com
Requestors: sprout [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 4.1



From sprout [...] cpan.org Sun Sep 26 15: 29:00 2010
MIME-Version: 1.0 (Apple Message framework v1081)
X-Spam-Status: No, score=-9.853 tagged_above=-99.9 required=10 tests=[AWL=0.746, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8] autolearn=ham
X-Mailer: Apple Mail (2.1081)
X-Spam-Flag: NO
Message-ID: <673F0F9A-7F47-4172-9A17-39A42FE91612 [...] cpan.org>
content-type: text/plain; charset="utf-8"
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -9.853
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id D6D34240D1E for <cpan-bug+html-tree [...] hipster.bestpractical.com>; Sun, 26 Sep 2010 15:29:00 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dk6sW83R0ncf for <cpan-bug+html-tree [...] hipster.bestpractical.com>; Sun, 26 Sep 2010 15:28:58 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 68A75240261 for <bug-html-tree [...] rt.cpan.org>; Sun, 26 Sep 2010 15:28:58 -0400 (EDT)
Received: (qmail 10765 invoked by uid 103); 26 Sep 2010 19:32:10 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 26 Sep 2010 19:32:10 -0000
Received: from director.trueband.net (HELO trueband.net) (216.163.120.8) by 16.mx.develooper.com (qpsmtpd/0.80) with SMTP; Sun, 26 Sep 2010 12:32:09 -0700
Received: (qmail 22891 invoked by uid 1006); 26 Sep 2010 19:32:05 -0000
Received: from sprout [...] cpan.org by rs0 by uid 1003 with qmail-scanner-1.16 (spamassassin: 3.2.5. Clear:SA:0(2.3/100.0):. Processed in 0.117103 secs); 26 Sep 2010 19:32:05 -0000
Received: from unknown (HELO trueband.net) (172.16.0.8) by director.trueband.net with SMTP; 26 Sep 2010 19:32:05 -0000
Received: (qmail 27907 invoked from network); 26 Sep 2010 19:32:05 -0000
Received: from unknown (HELO ?10.10.10.22?) (65.170.242.70) by -v with SMTP; 26 Sep 2010 19:32:05 -0000
Delivered-To: cpan-bug+html-tree [...] hipster.bestpractical.com
Subject: Some methods die when elem isn’ta element_class
Return-Path: <sprout [...] cpan.org>
X-RT-Mail-Extension: html-tree
X-Original-To: cpan-bug+html-tree [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
X-Old-Spam-Status: No, hits=2.3 required=100.0
X-Old-Spam-Level: **
Date: Sun, 26 Sep 2010 12:32:04 -0700
X-Spam-Level:
To: bug-HTML-Tree [...] rt.cpan.org
Content-Transfer-Encoding: quoted-printable
From: Father Chrysostomos <sprout [...] cpan.org>
X-RT-Original-Encoding: windows-1252
Content-Length: 510
Download (untitled) / with headers
text/plain 510b
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.
From jefffearn [...] gmail.com Mon Sep 27 00: 23:19 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-9.913 tagged_above=-99.9 required=10 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8, SPF_NEUTRAL=0.686] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-24877-1285529536-582.61673-4-0 [...] rt.cpan.org>
X-Spam-Flag: NO
References: <RT-Ticket-61673 [...] rt.cpan.org> <673F0F9A-7F47-4172-9A17-39A42FE91612 [...] cpan.org> <rt-3.8.HEAD-24877-1285529536-582.61673-4-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Reply-To: Jeff.Fearn [...] gmail.com
Message-ID: <AANLkTikiU5rKNvyjT2purGzkEwVvSyvbG+No2ae7Rj4O [...] mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
X-Spam-Score: -9.913
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.from=jefffearn [...] gmail.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 5A158240E6E for <cpan-bug+HTML-Tree [...] hipster.bestpractical.com>; Mon, 27 Sep 2010 00:23:19 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V0vZTEvBCSjQ for <cpan-bug+HTML-Tree [...] hipster.bestpractical.com>; Mon, 27 Sep 2010 00:23:17 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 484E3240D27 for <bug-HTML-Tree [...] rt.cpan.org>; Mon, 27 Sep 2010 00:23:17 -0400 (EDT)
Received: (qmail 28741 invoked by uid 103); 27 Sep 2010 04:26:29 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 27 Sep 2010 04:26:29 -0000
Received: from mail-ew0-f50.google.com (HELO mail-ew0-f50.google.com) (209.85.215.50) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Sun, 26 Sep 2010 21:26:28 -0700
Received: by ewy24 with SMTP id 24so1161089ewy.9 for <bug-HTML-Tree [...] rt.cpan.org>; Sun, 26 Sep 2010 21:26:24 -0700 (PDT)
Received: by 10.213.40.75 with SMTP id j11mr2567874ebe.28.1285561584468; Sun, 26 Sep 2010 21:26:24 -0700 (PDT)
Received: by 10.14.127.73 with HTTP; Sun, 26 Sep 2010 21:26:24 -0700 (PDT)
Delivered-To: cpan-bug+HTML-Tree [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #61673] Some methods die when elem isn’ta element_class
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=DeljyIHuR/yXVdKbXh4eVOFXocxJEyiYCKLUilSRJUg7qwgzAxUnvMkExh10EX5BY3 vlEej48vN+SVca0h+PEkpqF42GHrkFAYNeNN1F0jqMDPfvdyOmf4gSpT3szGibtjOgR9 YFZfu054OBM9Dt2+V8w1xCgHoowp8S8P9NPcY=
Return-Path: <jefffearn [...] gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:reply-to :in-reply-to:references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=FuS+L8p0ScFUgdwJXmIS+gDOnOBfYCy5iag0/3MNorc=; b=O4S6MeyIBZKaT25FAdfKfqCgGaWKwlM4T42EBIy4z0L3lhrABPQLUF93HylgW4myzl Ds4LHV10qEUtXq3EjISjhm9rnmrN9WaFtDVrmXbB5fv3lcDfwkueGXKSeeas276bOYah mC+xUnDGhj6USDjx7bwtEc/cKXBoPxBXcTQLQ=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+HTML-Tree [...] hipster.bestpractical.com
X-RT-Mail-Extension: html-tree
Date: Mon, 27 Sep 2010 14:26:24 +1000
X-Spam-Level:
To: bug-HTML-Tree [...] rt.cpan.org
Content-Transfer-Encoding: quoted-printable
From: Jeff Fearn <jefffearn [...] gmail.com>
RT-Message-ID: <rt-3.8.HEAD-24889-1285561592-404.61673-0-0 [...] rt.cpan.org>
Content-Length: 1023
Download (untitled) / with headers
text/plain 1023b
Show quoted text
> 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. >
This is probably getting caught by the fix for https://rt.cpan.org/Ticket/Display.html?id=35948 The only place this is checked is in the traverse method in as_HTML, where it seems a relatively sane place to check since it is hitting internal features that will segfault given the wrong input. XML::TreeBuilder avoids this by setting_element_class in it's new function: $self->{'_element_class'} = 'XML::Element'; Maybe that's a cleaner approach to subclassing than munging the isa. Cheers, Jeff.
From sprout [...] cpan.org Sun Oct 3 16: 01:35 2010
MIME-Version: 1.0 (Apple Message framework v1081)
X-Spam-Status: No, score=-9.798 tagged_above=-99.9 required=10 tests=[AWL=0.801, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-24889-1285561593-1125.61673-6-0 [...] rt.cpan.org>
X-Mailer: Apple Mail (2.1081)
X-Spam-Flag: NO
References: <RT-Ticket-61673 [...] rt.cpan.org> <673F0F9A-7F47-4172-9A17-39A42FE91612 [...] cpan.org> <rt-3.8.HEAD-24877-1285529536-582.61673-4-0 [...] rt.cpan.org> <AANLkTikiU5rKNvyjT2purGzkEwVvSyvbG+No2ae7Rj4O [...] mail.gmail.com> <rt-3.8.HEAD-24889-1285561593-1125.61673-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <3C73DC99-372C-4343-9EFB-2CA49BF8F662 [...] cpan.org>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -9.798
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 7A84A240D3A for <cpan-bug+html-tree [...] hipster.bestpractical.com>; Sun, 3 Oct 2010 16:01:35 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 79S64jjq1pOl for <cpan-bug+html-tree [...] hipster.bestpractical.com>; Sun, 3 Oct 2010 16:01:33 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 4FD3F24078E for <bug-html-tree [...] rt.cpan.org>; Sun, 3 Oct 2010 16:01:32 -0400 (EDT)
Received: (qmail 28878 invoked by uid 103); 3 Oct 2010 20:04:53 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 3 Oct 2010 20:04:53 -0000
Received: from director.trueband.net (HELO trueband.net) (216.163.120.8) by 16.mx.develooper.com (qpsmtpd/0.80) with SMTP; Sun, 03 Oct 2010 13:04:51 -0700
Received: (qmail 17732 invoked by uid 1006); 3 Oct 2010 20:04:48 -0000
Received: from sprout [...] cpan.org by rs0 by uid 1003 with qmail-scanner-1.16 (spamassassin: 3.2.5. Clear:SA:0(2.3/100.0):. Processed in 0.275246 secs); 03 Oct 2010 20:04:48 -0000
Received: from unknown (HELO trueband.net) (172.16.0.8) by director.trueband.net with SMTP; 3 Oct 2010 20:04:47 -0000
Received: (qmail 1381 invoked from network); 3 Oct 2010 20:04:47 -0000
Received: from unknown (HELO ?10.10.10.22?) (65.170.242.70) by -v with SMTP; 3 Oct 2010 20:04:47 -0000
Delivered-To: cpan-bug+html-tree [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #61673] Some methods die when elem isn’ta element_class
Return-Path: <sprout [...] cpan.org>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+html-tree [...] hipster.bestpractical.com
X-RT-Mail-Extension: html-tree
X-Old-Spam-Status: No, hits=2.3 required=100.0
Date: Sun, 3 Oct 2010 13:04:46 -0700
X-Old-Spam-Level: **
X-Spam-Level:
To: bug-HTML-Tree [...] rt.cpan.org
Content-Transfer-Encoding: quoted-printable
From: Father Chrysostomos <sprout [...] cpan.org>
RT-Message-ID: <rt-3.8.HEAD-29980-1286136297-991.61673-0-0 [...] rt.cpan.org>
Content-Length: 1445
Download (untitled) / with headers
text/plain 1.4k
On Sep 26, 2010, at 9:26 PM, Jeff Fearn via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=61673 > >
>> 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. >>
> > This is probably getting caught by the fix for > https://rt.cpan.org/Ticket/Display.html?id=35948 > > The only place this is checked is in the traverse method in as_HTML, > where it seems a relatively sane place to check since it is hitting > internal features that will segfault given the wrong input. > > XML::TreeBuilder avoids this by setting_element_class in it's new function: > > $self->{'_element_class'} = 'XML::Element'; > > Maybe that's a cleaner approach to subclassing than munging the isa.
I am doing that. But it doesn’t work in my case, as the constructor that methods like objectify_text call (HTML::DOM::Element->new) is not in a package that all nodes inherit from. Again, constructors do not necessarily return objects belonging to, or inheriting from, the same package.
From jefffearn [...] gmail.com Mon Oct 4 05: 17:39 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-9.913 tagged_above=-99.9 required=10 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8, SPF_NEUTRAL=0.686] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-29980-1286136297-90.61673-5-0 [...] rt.cpan.org>
X-Spam-Flag: NO
References: <RT-Ticket-61673 [...] rt.cpan.org> <673F0F9A-7F47-4172-9A17-39A42FE91612 [...] cpan.org> <rt-3.8.HEAD-24877-1285529536-582.61673-4-0 [...] rt.cpan.org> <AANLkTikiU5rKNvyjT2purGzkEwVvSyvbG+No2ae7Rj4O [...] mail.gmail.com> <rt-3.8.HEAD-24889-1285561593-1125.61673-6-0 [...] rt.cpan.org> <3C73DC99-372C-4343-9EFB-2CA49BF8F662 [...] cpan.org> <rt-3.8.HEAD-29980-1286136297-90.61673-5-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Reply-To: Jeff.Fearn [...] gmail.com
Message-ID: <AANLkTim2ChYsKc-ux_WbxZo4twB2937n2BHX+XfzAwQK [...] mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
X-Spam-Score: -9.913
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.from=jefffearn [...] gmail.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id D4697240D45 for <cpan-bug+HTML-Tree [...] hipster.bestpractical.com>; Mon, 4 Oct 2010 05:17:39 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ip0qcvKyzxqm for <cpan-bug+HTML-Tree [...] hipster.bestpractical.com>; Mon, 4 Oct 2010 05:17:38 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id AE684240D3E for <bug-HTML-Tree [...] rt.cpan.org>; Mon, 4 Oct 2010 05:17:37 -0400 (EDT)
Received: (qmail 643 invoked by uid 103); 4 Oct 2010 09:20:59 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 4 Oct 2010 09:20:59 -0000
Received: from mail-ey0-f178.google.com (HELO mail-ey0-f178.google.com) (209.85.215.178) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Mon, 04 Oct 2010 02:20:57 -0700
Received: by eyh6 with SMTP id 6so1707478eyh.9 for <bug-HTML-Tree [...] rt.cpan.org>; Mon, 04 Oct 2010 02:20:54 -0700 (PDT)
Received: by 10.213.106.7 with SMTP id v7mr6728432ebo.31.1286184053888; Mon, 04 Oct 2010 02:20:53 -0700 (PDT)
Received: by 10.14.127.73 with HTTP; Mon, 4 Oct 2010 02:20:53 -0700 (PDT)
Delivered-To: cpan-bug+HTML-Tree [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #61673] Some methods die when elem isn’ta element_class
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=ifk6lBhG2EDmSAW2dzMUMCGTJIaRu2ktVkLGwFlSZQLkrxUSOj1g+VjYiZN0T98kAn Q6CMVGLxbDT/z60dqRh55AMfJzs7+lQG3wEFIQZsdxFfRFB/9Va8J2a+pGSv2obyl/z1 5dCgl++niVYa8CgU4UIi/xJcZPipN1XsaNZwk=
Return-Path: <jefffearn [...] gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:reply-to :in-reply-to:references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=q8ZzHSHMsm3mhJ7RQUzilq/T7mAh8fXkd9ZdtVNOqss=; b=OB46V++UiO8w4aSHroqINyTtYQxq8WMu+RbivUuIfGcvfP5C3G++uRUWN3dh8G+zRc saMYKJhFUtzoqDEoJNJZIVbTILWTAOcUA1PVCr4T6q7Lv6sfQHnRBt91CUElIdQJbnI/ ua5YoUpNzUzIQ2Jp6j/PeM4K1ZGzbk4ILjf94=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+HTML-Tree [...] hipster.bestpractical.com
X-RT-Mail-Extension: html-tree
Date: Mon, 4 Oct 2010 10:20:53 +0100
X-Spam-Level:
To: bug-HTML-Tree [...] rt.cpan.org
Content-Transfer-Encoding: quoted-printable
From: Jeff Fearn <jefffearn [...] gmail.com>
RT-Message-ID: <rt-3.8.HEAD-29979-1286184062-281.61673-0-0 [...] rt.cpan.org>
Content-Length: 2533
Download (untitled) / with headers
text/plain 2.4k
On Sun, Oct 3, 2010 at 9:04 PM, Father Chrysostomos via RT <bug-HTML-Tree@rt.cpan.org> wrote: Show quoted text
>       Queue: HTML-Tree >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=61673 > > > > On Sep 26, 2010, at 9:26 PM, Jeff Fearn via RT wrote: >
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=61673 > >>
>>> 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. >>>
>> >> This is probably getting caught by the fix for >> https://rt.cpan.org/Ticket/Display.html?id=35948 >> >> The only place this is checked is in the traverse method in as_HTML, >> where it seems a relatively sane place to check since it is hitting >> internal features that will segfault given the wrong input. >> >> XML::TreeBuilder avoids this by setting_element_class in it's new function: >> >> $self->{'_element_class'}      = 'XML::Element'; >> >> Maybe that's a cleaner approach to subclassing than munging the isa.
> > I am doing that. But it doesn’t work in my case, as the constructor that methods like objectify_text call (HTML::DOM::Element->new) is not in a package that all nodes inherit from. Again, constructors do not necessarily return objects belonging to, or inheriting from, the same package.
The check is making sure all the objects in the current tree are of a compatible type, it seems a reasonable thing to check. Presumably all the objects returned by a constructor inherit from some base class, even if it's not the one being use to call new. e.g. XML::DOM::Element->new() returns various XML::DOM::* objects.. So if XML::DOM::* was using HTML::Element I'd expect XML::DOM, or maybe XML::DOM::Node, would be setting $self->{'_element_class'} to 'XML::DOM::Node' or similar in the super constructor. In this case it looks like both HTML::DOM::Element and HTML::DOM::Comment both call SUPER::new so it should be just a matter of setting $self->{'_element_class'} in SUPER::new. I'm willing to have a class variable to disable sanity checking if you want, but I'd like to keep the sanity check in place for people who accidentally mix stuff up. Cheers, Jeff.
From sprout [...] cpan.org Sun Oct 10 19: 28:51 2010
MIME-Version: 1.0 (Apple Message framework v1081)
X-Spam-Status: No, score=-7.939 tagged_above=-99.9 required=10 tests=[AWL=-1.039, BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-29979-1286184063-765.61673-6-0 [...] rt.cpan.org>
X-Mailer: Apple Mail (2.1081)
X-Spam-Flag: NO
References: <RT-Ticket-61673 [...] rt.cpan.org> <673F0F9A-7F47-4172-9A17-39A42FE91612 [...] cpan.org> <rt-3.8.HEAD-24877-1285529536-582.61673-4-0 [...] rt.cpan.org> <AANLkTikiU5rKNvyjT2purGzkEwVvSyvbG+No2ae7Rj4O [...] mail.gmail.com> <rt-3.8.HEAD-24889-1285561593-1125.61673-6-0 [...] rt.cpan.org> <3C73DC99-372C-4343-9EFB-2CA49BF8F662 [...] cpan.org> <rt-3.8.HEAD-29980-1286136297-90.61673-5-0 [...] rt.cpan.org> <AANLkTim2ChYsKc-ux_WbxZo4twB2937n2BHX+XfzAwQK [...] mail.gmail.com> <rt-3.8.HEAD-29979-1286184063-765.61673-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <11C3F51F-91B9-4B78-AA7F-50617FAB71EA [...] cpan.org>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -7.939
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 0D6F2240D4D for <cpan-bug+html-tree [...] hipster.bestpractical.com>; Sun, 10 Oct 2010 19:28:51 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NlESFH7v3PAs for <cpan-bug+html-tree [...] hipster.bestpractical.com>; Sun, 10 Oct 2010 19:28:49 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id C4299240D4C for <bug-html-tree [...] rt.cpan.org>; Sun, 10 Oct 2010 19:28:48 -0400 (EDT)
Received: (qmail 1903 invoked by uid 103); 10 Oct 2010 23:28:49 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 10 Oct 2010 23:28:49 -0000
Received: from director.trueband.net (HELO trueband.net) (216.163.120.8) by 16.mx.develooper.com (qpsmtpd/0.80) with SMTP; Sun, 10 Oct 2010 16:28:46 -0700
Received: (qmail 30024 invoked by uid 1006); 10 Oct 2010 23:28:43 -0000
Received: from sprout [...] cpan.org by rs0 by uid 1003 with qmail-scanner-1.16 (spamassassin: 3.2.5. Clear:SA:0(2.3/100.0):. Processed in 0.261702 secs); 10 Oct 2010 23:28:43 -0000
Received: from unknown (HELO trueband.net) (172.16.0.20) by director.trueband.net with SMTP; 10 Oct 2010 23:28:43 -0000
Received: (qmail 27260 invoked from network); 10 Oct 2010 23:28:42 -0000
Received: from unknown (HELO ?10.10.10.22?) (65.170.242.70) by -v with SMTP; 10 Oct 2010 23:28:42 -0000
Delivered-To: cpan-bug+html-tree [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #61673] Some methods die when elem isn’ta element_class
Return-Path: <sprout [...] cpan.org>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+html-tree [...] hipster.bestpractical.com
X-RT-Mail-Extension: html-tree
X-Old-Spam-Status: No, hits=2.3 required=100.0
Date: Sun, 10 Oct 2010 16:28:41 -0700
X-Old-Spam-Level: **
X-Spam-Level:
To: bug-HTML-Tree [...] rt.cpan.org
Content-Transfer-Encoding: quoted-printable
From: Father Chrysostomos <sprout [...] cpan.org>
RT-Message-ID: <rt-3.8.HEAD-29961-1286753332-331.61673-0-0 [...] rt.cpan.org>
Content-Length: 694
Download (untitled) / with headers
text/plain 694b
On Oct 4, 2010, at 2:21 AM, Jeff Fearn via RT wrote: Show quoted text
> In this case it looks like both HTML::DOM::Element and > HTML::DOM::Comment both call SUPER::new so it should be just a matter > of setting $self->{'_element_class'} in SUPER::new.
The problem here, again, is that the base class they inherit from is not the class that has the constructor that objectify_text should call. element_class is now doing two different things. Show quoted text
> I'm willing to have a class variable to disable sanity checking if you > want,
That would be nice, or duck typing: Just check whether the $object->can('starttag'). Show quoted text
> but I'd like to keep the sanity check in place for people who > accidentally mix stuff up.
MIME-Version: 1.0
In-Reply-To: <rt-3.8.HEAD-29961-1286753332-331.61673-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <rt-3.8.HEAD-24889-1285561593-1125.61673-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2359-1286882342-1750.61673-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 454
Download (untitled) / with headers
text/plain 454b
On Mon Oct 11 09:28:52 2010, sprout@cpan.org wrote: Show quoted text
> > I'm willing to have a class variable to disable sanity checking if
> you
> > want,
> > That would be nice, or duck typing: Just check whether the $object-
> >can('starttag').
Oh I like this one! This way really crazy people, like me, can have trees with nodes from completely unrelated subclasses! http://github.com/jfearn/HTML-Tree/commit/b778b99e7a4b32ff94d6cf6875b4cdb36b86db74 Cheers, Jeff.
MIME-Version: 1.0
In-Reply-To: <673F0F9A-7F47-4172-9A17-39A42FE91612 [...] cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <673F0F9A-7F47-4172-9A17-39A42FE91612 [...] cpan.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2358-1288080344-1799.61673-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 44
Version 4.1 shipped with a fix for this bug.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.