Skip Menu |

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

Report information
The Basics
Id: 29332
Status: stalled
Priority: 0/
Queue: HTML-DOM

People
Owner: Nobody in particular
Requestors: agentzh [...] yahoo.cn
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.005
Fixed in: (no value)



Subject: Bugs in DOM property setters
I'd expect DOM property setters return the new value given rather than the old one. Consider the equivalent JS assignment: alert(document.title = "Foo"); which will give "Foo" instead of the old value of document.title. There may be other instances like this. Besides, I've found HTML::DOM's URI property is not writable. See the following test script (which is currently failing): use HTML::DOM; use Test::More tests => 4; my $doc = HTML::DOM->new(url => 'http://foo.org'); is($doc->URL('http://bar.com'), 'http://bar.com'); is($doc->URL, 'http://bar.com'); Thanks, agentz
On Thu Sep 13 02:28:09 2007, AGENT wrote: Show quoted text
> I'd expect DOM property setters return the new value given rather than > the old one. Consider the equivalent JS assignment: > > alert(document.title = "Foo"); > > which will give "Foo" instead of the old value of document.title. > > There may be other instances like this.
I’m afraid this one is just a matter of taste. This is the way that HTML::Tree does it, and that makes it a lot simpler to implement. Show quoted text
> > Besides, I've found HTML::DOM's URI property is not writable.
This is how the DOM spec. has it. Is there any reason you would need to set it after creating the object (you can pass it to the constructor)? If you really need it, I can still add it.