I liked $dom_getComputedStyle because the other one you scared me away from by demanding some Future stuff or something. Those APIs I used in a very synchronous way as they were being used from common functions being called indirectly. If I were to turn them into asynchronous calls, I have no idea what would happen. I know that recently you turned getComputedStyle into synchronous call so perhaps I can switch to it now.
I use $dom_getElementById quite a bit because I give elements generated IDs that are more easily found. I then keep the returned instance of Element stored for quicker turnaround.
$dom_createElement I use for creating all the elements based on information I collect via this class:
On Tue, Feb 19, 2013 at 5:19 PM, Joao Pedrosa <joaop...@gmail.com> wrote:I liked $dom_getComputedStyle because the other one you scared me away from by demanding some Future stuff or something. Those APIs I used in a very synchronous way as they were being used from common functions being called indirectly. If I were to turn them into asynchronous calls, I have no idea what would happen. I know that recently you turned getComputedStyle into synchronous call so perhaps I can switch to it now.Agreed. I think getComputedStyle is synchronous now (as of last week's SDK?).
I use $dom_getElementById quite a bit because I give elements generated IDs that are more easily found. I then keep the returned instance of Element stored for quicker turnaround.You should be able to use query('#elemId') for this.
$dom_createElement I use for creating all the elements based on information I collect via this class:Would "new Element.tag" work here?
You should be able to use query('#elemId') for this.Yup. As I store the IDs in a "DRId678" format, prepending it with "#" whenever I wanted to find an Element would be a little wasteful. I think many library authors would rather have a lookItUpById method alongside the more broad query one. I recall looking at the Ext.JS code once upon a time, and it too used a byId() method. I think libraries that work from generating Elements at runtime rather than HTML at development time do better with a byId() method.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
It is good to see the cleanup. However, some of methods shall be public since there are no good alternatives. Here is what we use in Rikulo UI.1. $dom_addEventListener/$dom_removeEventListener: without them, it is not easy to listen an event that is known at run time (as a framework, we usually don't know which event at compile time). Of course, we can go over EventStreamProvider, but it is too heavy and stupid with such small feature. It will be great if you just rename them to addEventListener/removeEventListener.
2. UIEvent's $dom_charCode and $dom_keyCode. Reason: there are charCode and keyCode for KeyEvent and KeyboardEvent, but not UIEvent. This one is not critical but better to clarify.3. Element's $dom_setAttribute. Is it the same as `attributes[key] = value`? If so, it is safe to remove it. (BTW, how about $dom_setAttributeNS? I didn't use it but I think it is worth to explain how is the alternative)Regards,Tom
On Wednesday, February 20, 2013 2:30:23 AM UTC+8, Pete Blois wrote:As part of our API cleanup process, we're planning on converting all of the DOM $dom_ APIs to be private.These APIs have been available as lower-level alternatives to existing APIs, but their use has not been recommended.Please let us know if you are using any of the $dom_ APIs and why, we'd like to fix those up before making this change.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
On Tue, Jul 9, 2013 at 8:33 AM, Tom Yeh <tom....@gmail.com> wrote:
It is good to see the cleanup. However, some of methods shall be public since there are no good alternatives. Here is what we use in Rikulo UI.1. $dom_addEventListener/$dom_removeEventListener: without them, it is not easy to listen an event that is known at run time (as a framework, we usually don't know which event at compile time). Of course, we can go over EventStreamProvider, but it is too heavy and stupid with such small feature. It will be great if you just rename them to addEventListener/removeEventListener.The EventStreamProvider looks like a very light-weight class. Did you run into any problems using it?2. UIEvent's $dom_charCode and $dom_keyCode. Reason: there are charCode and keyCode for KeyEvent and KeyboardEvent, but not UIEvent. This one is not critical but better to clarify.
3. Element's $dom_setAttribute. Is it the same as `attributes[key] = value`? If so, it is safe to remove it. (BTW, how about $dom_setAttributeNS? I didn't use it but I think it is worth to explain how is the alternative)
On Tue, Jul 9, 2013 at 8:33 AM, Tom Yeh <tom....@gmail.com> wrote:
It is good to see the cleanup. However, some of methods shall be public since there are no good alternatives. Here is what we use in Rikulo UI.1. $dom_addEventListener/$dom_removeEventListener: without them, it is not easy to listen an event that is known at run time (as a framework, we usually don't know which event at compile time). Of course, we can go over EventStreamProvider, but it is too heavy and stupid with such small feature. It will be great if you just rename them to addEventListener/removeEventListener.The EventStreamProvider looks like a very light-weight class. Did you run into any problems using it?
void main() { document.query("#id").$dom_addEventListener("click", (evt) {});}
void main() { document.query("#id").on["click"].listen((evt) {});}