Re: XForms Basic

Ian Hickson wrote:

> On Tue, 9 Dec 2003, Daniel Brooks wrote:
> 
>>Well, you do have a point there. Just how expensive is a global
>>attribute? It seems like you're trading a trivial amount of memory for a
>>trivial amount of cpu time.
> 
> 
> It's expensive in terms of intrusiveness. In the middle of a MathML
> document you don't suddenly want half a dozen attributes from another
> namespace -- if you can keep as much as possible in one attribute, it is
> generally, IMHO, neater.
> 
> In any case, the repeat attribute is pretty simple now. It's only a
> keyword -- "template" or "repeated" -- optionally followed by an integer.
> What's the problem?
> 

I just think it's neater to have one piece of information per attribute 
I guess.

>>Also, I seem to have forgotten to mention that the second parameter for
>>the repitition template (called index, but really just a count of the
>>copies of the template) isn't really needed in the source
> 
> 
> That number is just the initial index to use. It's not ever really useful
> to be honest. I don't see why anyone would really use it. Maybe I should
> just get rid of it.
> 
> 
> 
>>it could be exposed simply as a dom attribute.
> 
> 
> It is. repetitionIndex.
> 

I meant that it could be omitted from the attribute completely and still 
be available through the dom.

> 
>>That, and you never specify that it's supposed to be decremented when
>>you remove a copy of the template.
> 
> 
> It's not.
> 
> 
> 
>>That's either a simple omission, or it's just used as a way to make sure
>>the next repitition block gets a unique index.
> 
> 
> That's what it's used for.
> 
> 
> 
>>The former is easily fixed, but I'm not sure the latter will work.
> 
> 
> The algorithm walks all the repetition blocks until the index is greater
> than all of them, and uses that for the new block. So why wouldn't it
> work?
> 

<foo repeat="template 5"/>
<foo repeat="repeated 8"/>

In that situation, the next repeat block would have an index of 9, right?

>>Sure, just make <form> something that knows which of it's children are
>>selected, and draws them appropriately.
> 
> 
> I'm confused as to why the form needs to have anything to do with this.
> There is not a 1:1 mapping of forms to repetition blocks. The two are
> designed to be independent.
> 
> 
> 
>>Something like this:
>>
>>...
>><table>
>>  <form id="foo">
>>    <tr repeat="template" id="row">...</tr>
>>  </form>
>></table>
>><input type="add" template="row" form="foo">
>><input type="move_up" template="row" form="foo">
>><input type="move_down" template="row" form="foo">
>>...
> 
> 
> I don't see why you need the form in that example (not to mention <form>
> can't be a child of <table>):
> 
>    ...
>    <table>
>     <tr repeat="template" id="row">...</tr>
>    </table>
>    <input type="add" template="row">
>    <input type="move_up" template="row">
>    <input type="move_down" template="row">
>    ...
> 
> Either way, that doesn't solve the problem -- how do you know which row is
> selected? How do you select a row? What if the "row" is actually a button?
> 
>    <button repeat="template"/>
> 
> 
>>Obviously the <form> tag would be a bit different than we use today, and
>>you wouldn't be able to put it in the <head>, it'd have to go places
>>it's never been allowed but where people have always put it anyway, etc.
> 
> 
> Oh, you wanted to make the form be a <select> widget or some such.
> 
> That seems like excessive overloading. :-)
> 

Hmm, probably. Call it <repititiongroup> or something. It would catch 
onclick events as they bubble past, and have a property selected="" with 
the numerical index of the selected row, and would cause the :selected 
pseudo-class to apply to that row.

db48x

Received on Wednesday, 10 December 2003 11:57:42 UTC