On Wed, Apr 29, 2009 at 1:10 PM, AndrĂ© Bargull <[email protected]>wrote:

> I don't think the UserData handler implementation is right, see [1].
> We don't need to resp. we cannot support:
> - NODE_ADOPTED (we don't support the concept of Document.adoptNode())
> - NODE_DELETED (this is not removal of a node)
> - NODE_IMPORTED (we don't support the concept of Document.importNode())
>
> There is only left:
> - NODE_RENAMED (already supported through onnodeName event)
> - NODE_CLONED
>
> And the handler is not a function but an instance of UserDataHandler:
>
>> +public function setUserData(key:String, data:*, handler:Function):* {
>>
>
> So that needs to be more like:
>
>> public function setUserData(key:String, data:*, handler:Object):* {
>>
> Or more strictly typed:
>
>> public function setUserData(key:String, data:*, handler:UserDataHandler):*
>> {
>>
>

OK I think we should go with using type "Object",  which will let someone
 write
a compact handler inline more easily

mynode.setUserData(key, val, {handler: function (...) { ... }})

rather than having to formally declare a subclass of UserDataHandler

>
> where `handler` needs to have a function-property called "handle". An
> example is provided at MDC [2].
>
>
> And related to that:
>
>> +        handler.call(this, op, k, val, src, dst);
>>
>
> This should be:
> handler.handle(op, k, val, src, dst);
>
>
>
> [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/
> core.html#ID-UserDataOperation
> [2] https://developer.mozilla.org/En/DOM/Node.setUserData
>
>
>
>
> On 4/29/2009 5:18 PM, Henry Minsky wrote:
>
>> Change 20090429-hqm-L by [email protected] on 2009-04-29 11:13:14 EDT
>>    in /Users/hqm/openlaszlo/trunk4
>>    for http://svn.openlaszlo.org/openlaszlo/trunk
>>
>> Summary: Implement the DOM Level3 UserData interface
>>
>> New Features:
>>
>> Bugs Fixed: LPP-8122
>>
>> Technical Reviewer: max
>> QA Reviewer: andre
>> Doc Reviewer: (pending)
>>
>> Documentation:
>>
>> Release Notes:
>>
>> Details:
>>
>> + implement the UserData API on LzDataElement
>>
>> + still need to write a few more tests, but wanted to get this out for
>> review
>>
>> Tests:
>>
>> test/lfc/data/alldata.lzx in swf9, swf8,dhtml
>>
>> Files:
>> M      test/lfc/data/alldata.lzx
>> A      test/lfc/data/userdata.lzx
>> M      WEB-INF/lps/lfc/data/ LzDataElement.lzs
>>
>> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20090429-
>> hqm-L.tar
>>
>>


-- 
Henry Minsky
Software Architect
[email protected]

Reply via email to