[Html-widget] Nested fieldsets: first steps
mjg17 at eng.cam.ac.uk
Mon Aug 7 18:50:55 CEST 2006
I have got to a working half-way stage in implementing this. The
enclosed patch against SVN revision 54 shows what I've done:
* Implemented a generic H::W::Element::Block and associated
* Used H::W::Element::Block to implement H::W::Element::Fieldset and
* Moved H::W::_instantiate up into H::W::Accessor so that it's
available to H::W::Element::Block.
* Written tests: t/element_block.t - which doubles as a demonstration.
* Not broken any of the other tests - yet!
I'd be really pleased for a little feedback on this before I move onto
the next stage. It is useful as it stands but not yet production
quality and introduces some code duplication (see below). Does the
structure look right? (The start of t/element_block.t is a kind of
synopsis for now.)
To support H::W::E::OrderedList (and the as-yet unwritten but trivial
UnorderedList), I've given my new H::W::BlockContainer a wrap_sub
member which takes a subroutine reference. I coded this in a bit
quickly, so any hints or tips in that area would be gratefully
The next (scarier!) stage is to refactor HTML::Widget and H::W::Result
to make use of H::W::E::Fieldset and remove code duplication.
(PS: Moose looks really nice for a future major release, but I don't
have time to look further at the moment.)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 13133 bytes
Desc: Block Level Elements patch
Url : http://lists.rawmode.org/pipermail/html-widget/attachments/20060807/ca4b72b9/attachment.obj
More information about the Html-widget