Re: [HTML Imports]: Sync, async, -ish?

2013-11-27 Thread John J Barton
h graphical and >non-visible, purely-functional elements >- Flexible enough to allow for complex cases, while being (relatively) >easy to grok for beginners >- Doesn't require devs to juggle a mix of declarative, top-level >settings, and imperative, pe

Re: [HTML Imports]: Sync, async, -ish?

2013-11-27 Thread John J Barton
I just can't help thinking this is whole line of reasoning all too complicated to achieve wide adoption and thus impact. The supposed power of declarative languages is ability to reason from top to bottom. Creating all of these exceptions causes the very problems being discussed: FOUC occurs becau

Re: [HTML Imports]: what scope to run in

2013-11-23 Thread John J Barton
On Sat, Nov 23, 2013 at 1:51 AM, Jonas Sicking wrote: > > > It would technically be possible to define that

Re: [HTML Imports]: Sync, async, -ish?

2013-11-22 Thread John J Barton
On Fri, Nov 22, 2013 at 8:22 AM, Daniel Buchner wrote: > Personally I don't have any issues with this solution, it provides for the > use-cases we face. Also, it isn't without precedent - you can opt for a > sync XMLHttpRequest (not much different). > > The best part of an explicit 'sync' attribu

Re: [HTML Imports]: Sync, async, -ish?

2013-11-22 Thread John J Barton
o giving developers > the ability to choose what's best for them. Right now I don't see a way for > a developer to choose to have a custom element block rendering, as opposed > to be backfilled later. Do we think this is important? (I think so.) If so, > what's a go

Re: [HTML Imports]: Sync, async, -ish?

2013-11-21 Thread John J Barton
Ok, so my 2 cents: it's ok but it gives a very Web 1.0 solution. We had to invent AJAX so developers could control the user experience in the face of significant network delay. As I said earlier, most apps will turn this problem over to the design team rather than cause users to leave while the bro

Re: [HTML Imports]: Sync, async, -ish?

2013-11-21 Thread John J Barton
> names, it would block rendering until the associated link import has > finished loading and registering the containing custom elements. > > Thoughts? > > - Daniel > > > On Wed, Nov 20, 2013 at 11:19 AM, Daniel Buchner wrote: > >> >> On Nov 20, 2013 11:07

Re: [HTML Imports]: what scope to run in

2013-11-20 Thread John J Barton
On Wed, Nov 20, 2013 at 7:34 PM, Ryosuke Niwa wrote: > On Nov 21, 2013, at 10:41 AM, Hajime Morrita wrote: > > Seems like almost everyone agrees that we need better way to > > modularize JavaScript, and ES6 modules are one of the most promising > > way to go. And we also agree (I think) that we

Re: [HTML Imports]: Sync, async, -ish?

2013-11-20 Thread John J Barton
On Wed, Nov 20, 2013 at 10:41 AM, Daniel Buchner wrote: > Dimitri: right on. > > The use of script-after-import is the forcing function in the blocking > scenario, not imports. > Yes. > Let's not complicate the new APIs and burden the overwhelming use-case to > service folks who intend to use th

Re: [HTML Imports]: Sync, async, -ish?

2013-11-20 Thread John J Barton
Another alternative: First let's agree that Souder's example must block: ... var link = document.querySelector('link[rel=import]'); var content = link.import.querySelector('#imported-content'); document.getElementById('import-container').appendChild(content.cloneNode(true)); If we don't bl

Re: [HTML Imports]: Sync, async, -ish?

2013-11-19 Thread John J Barton
Now a correction: On Tue, Nov 19, 2013 at 4:25 PM, John J Barton wrote: > Last is an asynchronous "declarative" model (quote because such solutions > are not declarative). > Broadly I am advocating using ES6 modules with HTML imports. The particular example I made up ea

Re: [HTML Imports]: Sync, async, -ish?

2013-11-19 Thread John J Barton
nfusion by simulating imperative actions with declarative syntax. FOUC is a sign of the failing of this kind of solution: the unstyled content hits the rendering engine in the wrong order, before the JS that it depends upon. If our dependency design is correct, we only deliver useful content to the

Re: [HTML Imports]: what scope to run in

2013-11-19 Thread John J Barton
On Tue, Nov 19, 2013 at 2:07 PM, Rick Waldron wrote: > > > > On Mon, Nov 18, 2013 at 7:14 PM, Jonas Sicking wrote: > >> Hi All, >> >> Largely independently from the thread that Dimitri just started on the >> sync/async/-ish nature of HTML imports I have a problem with how >> script execution in t

Re: [HTML Imports]: Sync, async, -ish?

2013-11-18 Thread John J Barton
On Mon, Nov 18, 2013 at 3:06 PM, Scott Miles wrote: > >> I'll assert that the primary use case for JS interacting with HTML > components ought to be 'works well with JS modules'. > > You can happily define modules in your imports, those two systems are > friends as far as I can tell. I've said th

Re: [HTML Imports]: Sync, async, -ish?

2013-11-18 Thread John J Barton
On Mon, Nov 18, 2013 at 2:33 PM, Scott Miles wrote: > >> I love the idea of making HTML imports *not* block rendering as the > default behavior > > So, for what it's worth, the Polymer team has the exact opposite desire. I > of course acknowledge use cases where imports are being used to enhance

Re: [HTML Imports]: Sync, async, -ish?

2013-11-18 Thread John J Barton
Maybe Steve's example[1] could be on JS rather than on components: System.component("import.php", function(component) { var content = component.content document.getElementById('import-container').appendChild(content.cloneNode(true)); }); Here we mimic System.load(jsId, success, error). Then m

Re: The JavaScript context of a custom element

2013-05-20 Thread John J Barton
Aren't ES6 modules is a good-enough solution for this issue? They make global collision rare and likely to be what the author really needed. jjb On Mon, May 20, 2013 at 1:00 PM, Aaron Boodman wrote: > Hello public-webapps, > > I have been following along with web components, and am really exci

Re: webcomponents: instead of

2013-05-16 Thread John J Barton
On Wed, May 15, 2013 at 11:03 AM, Dimitri Glazkov wrote: > On Wed, May 15, 2013 at 10:59 AM, Jonas Sicking wrote: > > On Wed, May 15, 2013 at 10:21 AM, John J Barton > > wrote: > >> > >> > >> > >> On Tue, May 14, 2013 at 8:04 PM, Jonas Sick

Re: Does JS bound to need to inherit from HTMLElement?

2013-04-19 Thread John J Barton
On Thu, Apr 18, 2013 at 11:11 PM, Dominic Cooney wrote: > On Wed, Apr 17, 2013 at 12:01 AM, John J Barton < > johnjbar...@johnjbarton.com> wrote: > >> I wonder if there may be a "cultural" difference involved in our >> different points of view. As a C++

Re: Does JS bound to need to inherit from HTMLElement?

2013-04-16 Thread John J Barton
rote: > On Sat, Apr 13, 2013 at 12:03 PM, John J Barton < > johnjbar...@johnjbarton.com> wrote: > >> While I completely understand the beauty of having any JS object bound to >> an inherit functions that make that object 'be an element', I'm >> unsur

Re: [webcomponents]: Of weird script elements and Benadryl

2013-04-15 Thread John J Barton
include a jQuery plugin > script at the bottom of the body that 'upgrades' various elements on the > page after render - basically, it's an unfortunate case of That's Just Life™ > > > Daniel J. Buchner > Product Manager, Developer Ecosystem > Mozilla Cor

Re: [webcomponents]: Of weird script elements and Benadryl

2013-04-15 Thread John J Barton
this appropriately for our application. > Gee, that's not very encouraging: this is the most important kind of issue for a developer, more so than whether the API is inheritance-like or not. > > > On Mon, Apr 15, 2013 at 1:46 PM, John J Barton < > johnjbar..

Re: [webcomponents]: Of weird script elements and Benadryl

2013-04-15 Thread John J Barton
On Mon, Apr 15, 2013 at 11:29 AM, Scott Miles wrote: > Thank you for your patience. :) > ditto. > > > > ? user's instance code? Do you mean: Running component instance > initialization during document construction is Bad? > > My 'x-foo' has an 'init' method that I wrote that has to execute bef

Re: [webcomponents]: Of weird script elements and Benadryl

2013-04-15 Thread John J Barton
On Mon, Apr 15, 2013 at 10:38 AM, Scott Miles wrote: > Dimitri is trying to avoid 'block[ing] instance construction' because > instances can be in the main document markup. > Yes we sure hope so! > > The main document can have a bunch of markup for custom elements. If the > user has made eleme

Re: [webcomponents]: Of weird script elements and Benadryl

2013-04-15 Thread John J Barton
On Mon, Apr 15, 2013 at 9:44 AM, Scott Miles wrote: > >> Why do the constructors of component instances run during component > loading? > > I'm not sure what you are referring to. What does 'component loading' mean? > > >> Why not use standard events rather than callbacks? > > > I'll some of the

Re: [webcomponents]: Of weird script elements and Benadryl

2013-04-15 Thread John J Barton
Why do the constructors of component instances run during component loading? Why not use standard events rather than callbacks? Thanks, jjb On Apr 15, 2013 9:04 AM, "Scott Miles" wrote: > Again, 'readyCallback' exists because it's a Bad Idea to run user code > during parsing (tree construction)

Does JS bound to need to inherit from HTMLElement?

2013-04-12 Thread John J Barton
While I completely understand the beauty of having any JS object bound to an inherit functions that make that object 'be an element', I'm unsure of the practical value. To me the critical relationship between the JS and the element is JS object access to its corresponding element instance without

Re: [webcomponents]: Platonic form of custom elements declarative syntax

2013-04-11 Thread John J Barton
On Thu, Apr 11, 2013 at 7:57 AM, Erik Arvidsson wrote: > The problem here is how do you register `My_yay` as the class that goes > with the tag name `my_yay`. One option could be to use the completion > value but it seems too magical/unreliable. It also does not scale well. I > would like us to b

Re: [webcomponents]: Platonic form of custom elements declarative syntax

2013-04-10 Thread John J Barton
On Wed, Apr 10, 2013 at 3:30 PM, Daniel Buchner wrote: > @John - in my opinion, is the wrong > direction. You should be declaring which *template* an *element* uses, not > which element a template captures. Having templates latch onto element > types from afar breaks the one-to-many case, preven

Re: Shrinking existing libraries as a goal

2012-05-17 Thread John J Barton
On Thu, May 17, 2012 at 10:10 AM, Tab Atkins Jr. wrote: > On Thu, May 17, 2012 at 9:56 AM, John J Barton > wrote: >> On Thu, May 17, 2012 at 9:29 AM, Rick Waldron wrote: >>> Consider the cowpath metaphor - web developers have made highways out of >>> sticks, g

Re: Shrinking existing libraries as a goal

2012-05-17 Thread John J Barton
On Thu, May 17, 2012 at 9:29 AM, Rick Waldron wrote: > Consider the cowpath metaphor - web developers have made highways out of > sticks, grass and mud - what we need is someone to pour the concrete. I'm confused. Is the goal shorter load times (Yehuda) or better developer ergonomics (Waldron)?

Re: Shrinking existing libraries as a goal

2012-05-16 Thread John J Barton
On Wed, May 16, 2012 at 9:53 AM, Dimitri Glazkov wrote: > I think it's a great idea. Shipping less code over the wire seems like > a win from any perspective. How about a cross-site secure (even pre-compiled) cache for JS libraries as well? We almost have this with CDN now, if it were formally s

Re: Synchronous postMessage for Workers?

2012-02-15 Thread John J Barton
On Tue, Feb 14, 2012 at 10:39 PM, Jonas Sicking wrote: ... > The problem is when you have functions which call yieldUntil. I.e. > when you have code like this: > > function doStuff() { >  yieldUntil("x"); > }; > > now what looks like perfectly safe innocent code: > > function myFunction() { >  ...

Re: Synchronous postMessage for Workers?

2012-02-14 Thread John J Barton
On Tue, Feb 14, 2012 at 11:14 AM, David Bruant wrote: > Le 14/02/2012 14:31, Arthur Barstow a écrit : > Another addition will be promises. > An already working example of promises can be found at > https://github.com/kriskowal/q Just to point out that promises are beyond the working example stag

Re: connection ceremony for iframe postMessage communications

2012-02-13 Thread John J Barton
On Mon, Feb 13, 2012 at 12:57 PM, Ian Hickson wrote: > On Fri, 10 Feb 2012, John J Barton wrote: >> > >> > Why would the connectivity part of this be the hard part? >> >> Because the existing information on cross-domain iframe communications >> is inco

Re: Synchronous postMessage for Workers?

2012-02-13 Thread John J Barton
On Mon, Feb 13, 2012 at 11:44 AM, Ian Hickson wrote: > On Thu, 17 Nov 2011, Joshua Bell wrote: >> >> Wouldn't it be lovely if the Worker script could simply make a >> synchronous call to fetch data from the Window? > > It wouldn't be so much a synchronous call, so much as a blocking get. >.. > Any

Re: connection ceremony for iframe postMessage communications

2012-02-10 Thread John J Barton
On Fri, Feb 10, 2012 at 1:37 PM, Ian Hickson wrote: > On Fri, 10 Feb 2012, John J Barton wrote: >> On Fri, Feb 10, 2012 at 10:58 AM, Ian Hickson wrote: >> > On Fri, 10 Feb 2012, John J Barton wrote: >> >> >> >> Just to clarify, I want to see the layer

Re: connection ceremony for iframe postMessage communications

2012-02-10 Thread John J Barton
On Fri, Feb 10, 2012 at 10:58 AM, Ian Hickson wrote: > On Fri, 10 Feb 2012, John J Barton wrote: >> > >> > What I meant was just to do this on the receiving side (inside the >> > iframe), after the onmessage handler has been set up (which we are >> > assu

Re: connection ceremony for iframe postMessage communications

2012-02-10 Thread John J Barton
On Fri, Feb 10, 2012 at 10:58 AM, Ian Hickson wrote: > On Fri, 10 Feb 2012, John J Barton wrote: >> >> Just to clarify, I want to see the layer you just outlined be standard >> so we can design iframe components and apps to mix and match. This can >> be two simple laye

Re: connection ceremony for iframe postMessage communications

2012-02-10 Thread John J Barton
On Thu, Feb 9, 2012 at 11:53 PM, Ian Hickson wrote: > On Thu, 9 Feb 2012, John J Barton wrote: >> On Thu, Feb 9, 2012 at 4:42 PM, Ian Hickson wrote: >> > On Thu, 9 Feb 2012, John J Barton wrote: >> >> >> >> However the solution has two significant probl

Re: connection ceremony for iframe postMessage communications

2012-02-09 Thread John J Barton
On Thu, Feb 9, 2012 at 4:42 PM, Ian Hickson wrote: > On Thu, 9 Feb 2012, John J Barton wrote: >> >> However the solution has two significant problems: >>   1. There is no way to know if portToOtherWindow is connected before >> you issue postMessage() > > Just have

Re: connection ceremony for iframe postMessage communications

2012-02-09 Thread John J Barton
On Thu, Feb 9, 2012 at 11:49 AM, Boris Zbarsky wrote: > That doesn't help with the second problem, of course Ok here are some ideas, riffing off the web messaging doc 1 To iframe element add: readonly attribute MessagePort port; 'message' events from the iframe to the containing window

Re: connection ceremony for iframe postMessage communications

2012-02-09 Thread John J Barton
On Thu, Feb 9, 2012 at 11:49 AM, Boris Zbarsky wrote: > On 2/9/12 1:15 PM, John J Barton wrote: >> >> This leads developers to look for events that will tell them about >> 'load' on iframes, and that leads them to try >> iframe.contentWindow.addEventList

connection ceremony for iframe postMessage communications

2012-02-09 Thread John J Barton
Recently I've been working with iframe messaging. The postMessage solution has a lot of advantages and good traction across iframes, WebWorkers, and browser extensions, with lots of overlap with Web Sockets. However the technology has two significant problems. First is the "contentWindow that is

Re: xframe or iframe type='cross-domain'

2012-02-09 Thread John J Barton
On Thu, Feb 9, 2012 at 10:01 AM, Boris Zbarsky wrote: > On 2/9/12 12:43 PM, John J Barton wrote: >>> >>> The drawback is that your fallback behavior in UAs without support for >>> the >>> new feature is quite different.  Is that a problem?  Develop

Re: xframe or iframe type='cross-domain'

2012-02-09 Thread John J Barton
On Thu, Feb 9, 2012 at 9:22 AM, Boris Zbarsky wrote: > On 2/9/12 12:04 PM, John J Barton wrote: >> >> As far as I can tell, a cross-domain iframe contentWindow has only one >> valid property, postMessage(). By no stretch of anyone's imagination >> is the object a

xframe or iframe type='cross-domain'

2012-02-09 Thread John J Barton
I've been working with cross-domain iframes. This technology has a lot of potential, but the current API is very difficult to use. Just search the web for cross-domain iframe info and you can read how many developers are confused. I believe a simple change could make a huge difference. My suggesti

Re: A proposal for Element constructors

2011-10-28 Thread John J Barton
On Thu, Oct 27, 2011 at 12:35 AM, Kentaro Hara wrote: > > ... > John-David wrote: > > Something like Element('') is so so soo nice compared with more > > verbose alternatives and you can still add attributes to elements via > > a second argument. I know some prefer smth like Element('div#foo') ->

Re: Adding Web Intents to the Webapps WG deliverables

2011-09-25 Thread John J Barton
On Thu, Sep 22, 2011 at 2:36 PM, Ian Hickson wrote: > There's no difference between two people coming up with the name "foo" and > two people coming up with the name "http://webintents.org/foo";, unless > you're saying you're confident that people won't use the prefix the spec > uses for its verbs

Re: Adding Web Intents to the Webapps WG deliverables

2011-09-22 Thread John J Barton
On Thu, Sep 22, 2011 at 5:22 PM, Charles Pritchard wrote: >> I don't see why. Just have a wiki page that people can list their verbs on >> and then point to their documentation. > > I agree here. The "standard" is sufficient for stewardship. Why won't I create a bot that fills with wiki with a di

Re: Component Model Update

2011-08-25 Thread John J Barton
On Thu, Aug 25, 2011 at 1:41 AM, Olli Pettay wrote: > One thing missing is some kind of declarative way to define > shadow trees, similar to XBL1's . > > I think this omission is a big plus. XBL1 is mysterious. If a dev tool wants to add support for building Components from declarative markup, a

Re: Component Model Update

2011-08-24 Thread John J Barton
I'm still trying to digest this, but it seem pretty clear the 'confinement' is the "clear scope" thing I was asking about on es-discuss. According to that discussion, this means needs to fit with the 'modules' thing on ecmascript. That seems to be where you are headed, but basing a new proposal on

Re: Component Model Update

2011-08-24 Thread John J Barton
On Wed, Aug 24, 2011 at 7:50 PM, Dimitri Glazkov wrote: > > Independent of our different point of view on control, shadow DOM needs > > debug APIs. So much the better if these are available to extensions. > > Let me see if I can capture this into a feature: user scripts may have > access to shado

Re: Component Model Update

2011-08-24 Thread John J Barton
On Wed, Aug 24, 2011 at 2:30 PM, Dominic Cooney wrote: > On Thu, Aug 25, 2011 at 2:03 AM, Dimitri Glazkov > wrote: > > Yes, shadow DOM gives the author an extra lever to control visibility > > and hackability of their code. It's up to them to use this lever > > wisely. > Maybe I grew up on to m

Re: Overview of behavior attachment as a general problem on the Web

2011-07-08 Thread John J. Barton
On 7/8/2011 1:18 PM, Dimitri Glazkov wrote: As a background for the wider Component Model discussion, I put together an overview of the general behavior attachment problem on the Web: http://wiki.whatwg.org/wiki/Behavior_Attachment Please take a look. Comments, additions, and critique are appre

Re: Mutation events replacement

2011-07-07 Thread John J. Barton
On 7/7/2011 6:38 PM, Jonas Sicking wrote: On Thu, Jul 7, 2011 at 5:23 PM, Rafael Weinstein wrote: So yes, my proposal only solves the usecase outside mutation handlers. However this is arguably better than never solving the use case as in your proposal. I'm sure people will end up writing buggy

Re: Mutation events replacement

2011-07-07 Thread John J Barton
Olli Pettay wrote: On 07/08/2011 01:43 AM, John J Barton wrote: Rafael Weinstein wrote: On Thu, Jul 7, 2011 at 1:58 PM, Ryosuke Niwa wrote: On Thu, Jul 7, 2011 at 12:18 PM, Jonas Sicking wrote: I don't think John J Barton's proposal to fire "before mutation notification

Re: Mutation events replacement

2011-07-07 Thread John J Barton
Rafael Weinstein wrote: On Thu, Jul 7, 2011 at 1:58 PM, Ryosuke Niwa wrote: On Thu, Jul 7, 2011 at 12:18 PM, Jonas Sicking wrote: I don't think John J Barton's proposal to fire "before mutation notifications" is doable. I concur. Being synchronous was one of the reasons why t

Re: Mutation events replacement

2011-07-07 Thread John J Barton
Jonas Sicking wrote: We are definitely short on use cases for mutation events in general which is a problem. 1. Graphical breakpoints. The user marks some DOM element or attribute to trigger break. The debugger inserts mutation listeners to watch for the event that causes that element/attri

Re: [WebIDL] Exceptions

2011-07-06 Thread John J. Barton
On 7/6/2011 6:06 PM, Allen Wirfs-Brock wrote: I'd much prefer to see code that looks like: try {doSomeDOMStuff() } catch (e) { switch (e.name) { case "NoNotificationAllowedError": ...; break; case "HierarchyRequestError": ...; break;

Re: Mutation events replacement

2011-07-06 Thread John J. Barton
On 7/6/2011 5:38 AM, Boris Zbarsky wrote: On 7/6/11 4:27 AM, Dave Raggett wrote: How does that scale to the case where you set the observer on the document or on a div element acting as a contained for content editable content? If I am not mistaken you would have to keep a copy of the document,

Re: Mutation events replacement

2011-07-04 Thread John J. Barton
On 7/4/2011 6:39 PM, Boris Zbarsky wrote: On 7/4/11 12:23 PM, John J. Barton wrote: By restricting mutation listeners to explicitly avoid DOM mutation, the most sophisticated case is no different than the simple case. Then all three can be accommodated. If such a restriction were feasible

Re: Mutation events replacement

2011-07-04 Thread John J. Barton
On 7/4/2011 6:34 PM, Boris Zbarsky wrote: On 7/4/11 12:09 PM, John J. Barton wrote: In the current proposal, the DOM API is manipulated while the onModelChange mutation listeners run. Citation please? I see nothing like that in the proposal. http://www.mail-archive.com/public-webapps@w3.org

Re: Mutation events replacement

2011-07-04 Thread John J. Barton
On 7/4/2011 9:38 AM, Olli Pettay wrote: On 07/04/2011 07:23 PM, John J. Barton wrote: On 7/3/2011 1:23 PM, Boris Zbarsky wrote: On 7/3/11 2:43 PM, John J. Barton wrote: I'm not sure what you're asking... The whole point of the proposed model is that if someone tries to do a mu

Re: Mutation events replacement

2011-07-04 Thread John J. Barton
On 7/3/2011 1:23 PM, Boris Zbarsky wrote: On 7/3/11 2:43 PM, John J. Barton wrote: I'm not sure what you're asking... The whole point of the proposed model is that if someone tries to do a mutation the mutation _will_ happen and will complete. _Then_ listeners, if any, will b

Re: Mutation events replacement

2011-07-04 Thread John J. Barton
On 7/3/2011 10:26 AM, Ryosuke Niwa wrote: On Sun, Jul 3, 2011 at 8:41 AM, John J. Barton mailto:johnjbar...@johnjbarton.com>> wrote: On 7/2/2011 8:50 PM, Boris Zbarsky wrote: On 7/2/11 1:46 PM, John J. Barton wrote: 2) element transformation. The replacement

Re: Mutation events replacement

2011-07-03 Thread John J. Barton
On 7/3/2011 10:25 AM, Ryosuke Niwa wrote: On Sun, Jul 3, 2011 at 10:04 AM, John J. Barton mailto:johnjbar...@johnjbarton.com>> wrote: The only part that is async in the Mutation Event replacement is further DOM events. No! Consider execCommand. To notify scripts of node re

Re: Mutation events replacement

2011-07-03 Thread John J. Barton
On 7/2/2011 12:36 PM, Ryosuke Niwa wrote: On Sat, Jul 2, 2011 at 10:46 AM, John J. Barton wrote: 1) break on mutation. In Firebug we add DOM mutation listeners to implement graphical breakpoints. The replacement would work fine for local, element observation breakpoints like add/remove

Re: Mutation events replacement

2011-07-03 Thread John J. Barton
On 7/2/2011 8:50 PM, Boris Zbarsky wrote: On 7/2/11 1:46 PM, John J. Barton wrote: 2) element transformation. The replacement fires "after" a mutation. Library or tools that want to transform the application dynamically want to get notification "before" the mutation. A com

Re: Mutation events replacement

2011-07-02 Thread John J. Barton
Olli Pettay Tue, 28 Jun 2011 04:32:14 -0700 These are *not* DOM-Event listeners. No DOM Events are created, there are no capture phases or bubbling phases. Instead you register a listener on the node you are interested in being notified about, and will get a call after a mutation takes place.

Re: Storage 'length' and enumeration

2009-04-29 Thread John J. Barton
Ian Hickson wrote: On Wed, 29 Apr 2009, John J Barton wrote: So why call the property |length|? Wouldn't an enumerable JS host object be just as fabulous with getNumberOfItems()? All the other host objects use |length|. For purposes that I hope are

Re: Storage 'length' and enumeration

2009-04-29 Thread John J. Barton
Ian Hickson wrote: On Wed, 29 Apr 2009, John J Barton wrote: Ian Hickson wrote: On Thu, 30 Apr 2009, Sean Hogan wrote: sessionStore[2] = "howdy"; print(sessionStore[2]); // prints null? print(sessionStore["2"]); // prints "howdy" To my knowle

Re: Storage 'length' and enumeration

2009-04-29 Thread John J Barton
Ian Hickson wrote: On Thu, 30 Apr 2009, Sean Hogan wrote: sessionStore[2] = "howdy"; print(sessionStore[2]); // prints null? print(sessionStore["2"]); // prints "howdy" To my knowledge that's not consistent with any other object or interface in the browser. Unless I'm

Re: Storage 'length' and enumeration

2009-04-29 Thread John J Barton
Anne van Kesteren wrote: On Wed, 29 Apr 2009 20:51:33 +0200, John J Barton wrote: Yes and Firebug has to have special code for HTMLCollection because this mistake was made in the past. Now we will have to have different special code for Storage. Rather than modeling new API on old mistakes

Re: Storage 'length' and enumeration

2009-04-29 Thread John J Barton
Ian Hickson wrote: On Wed, 29 Apr 2009, John J Barton wrote: Yes and Firebug has to have special code for HTMLCollection because this mistake was made in the past. Now we will have to have different special code for Storage. Rather than modeling new API on old mistakes, consider

Re: Storage 'length' and enumeration

2009-04-29 Thread John J Barton
Ian Hickson wrote: On Wed, 29 Apr 2009, John J. Barton wrote: I reiterate my criticism: using a length property in this type is inconsistent with _javascript_ and with developers expectations about objects. Every time we use this object we will make pointless mistakes because

Re: Storage 'length' and enumeration

2009-04-29 Thread John J. Barton
Ian Hickson wrote: On Tue, 28 Apr 2009, John J. Barton wrote: And then afterwards the |length| is ? one? three? One. If I iterate for(var i = 0; i < sesssionStore.length; i++) foo(i, sessionStore[i]); what can I expect in foo()? (0, null), (1, n

Re: Storage 'length' and enumeration

2009-04-28 Thread John J. Barton
Ian Hickson wrote: On Tue, 28 Apr 2009, John J. Barton wrote: I could not figure out from the WebIDL what happens in this case: sessionStore[2] = "howdy"; // no other keys in sessionStore I guess this does not work like _javascript_ arrays or objects, rather I expec

Re: Storage 'length' and enumeration

2009-04-28 Thread John J. Barton
Ian Hickson wrote: On Tue, 28 Apr 2009, John J Barton wrote: Sorry, I don't follow what you mean. The loop is possible of course, but what should the result be? If I have a sessionStorage object |s| with 10 items, the length will be 10. Should I expect |s[i]| for i=0,.

Re: Storage 'length' and enumeration

2009-04-28 Thread John J Barton
Ian Hickson wrote: On Tue, 28 Apr 2009, John J. Barton wrote: Hi. I work on Firebug, a web page debugger for Firefox (http://getfirebug.com). In attempting to show developers relevant information about all objects in their program I was trying to display window.sessionStorage

Storage 'length' and enumeration

2009-04-28 Thread John J. Barton
;. Using the term "enumeration" to mean "property enumeration" is also confusing, but I suppose ECMA script made that mistake too long ago. jjb -- __ John J. Barton email: johnjbartonjohnjbarton.com http://www.johnjbarton.com