kraih/mojo — pull request #344 by jamadam (2012-06-23 11:10:13+00:00)
Title: made dom a collection

This makes Mojo::DOM to inherite Mojo::Collection
so that we always can expect the return value of retrieving methods
to be both DOM and Collection.

is ref $dom->find('div'), 'Mojo::DOM';
is ref $dom->find('div'), 'Mojo::Collection';

# find method results are capable of Mojo::DOM methods
$dom->find->text
$dom->find('div')->find('a')->to_xml

The patch is almost compatible to the actual version except the autoloaded
child methods such as $dom->c or $dom->map.

The current behavior is sometimes confusing to me since I used to jQuery.
How do you think?