- From: Mike Shaver <mike.shaver@gmail.com>
- Date: Thu, 18 May 2006 04:05:46 +0200
- To: "Ian Hickson" <ian@hixie.ch>
- Cc: "Arthur Barstow" <art.barstow@nokia.com>, dev-tech-xbl@lists.mozilla.org, public-appformats@w3.org
On 5/18/06, Ian Hickson <ian@hixie.ch> wrote: > | 2.10. The handler Element > | > | ISSUE-J Why does the handler element not have a src attribute to > | facilitate script re-use? > > Because in practice you only want one JS file, not one per handler. To > do this, you would define the functions in the implementation, and > then invoke the functions from the handlers. I meant to ask this during Sicking's talk today at XTech, and then forgot in the kerfuffle about style scoping: What about using a fragment identifier, such that src="wibbleimpl.js#handleWobble" would let me have a |function handleWobble() { }| in wibbleimpl.js? It would seem easier to write than the pattern you describe, would permit more flexible source layout for binding implementations, and would let us give better diagnostics, too. (The latter because the XBL2 impl can tell if it'll be able to match up a given handler's "real" implementation when the binding is loaded, rather than having to wait until a possibly-uncommon event is actually fired.) I think this is basically the same reasoning I used with Hyatt to get the original fragment-to-pick-binding mechanism in XBL1, so I'm hoping for a repeat! Mike
Received on Thursday, 18 May 2006 05:30:52 UTC