> On another tack, Daniel Glazman had an interesting thought on the
menu API:
What do other people think about what he says? Which is:
-----
I like Jetpack. Not sure I am going to use it myself but I like it. What
I'm not sure to like is the following line, taken from Jetpack Image
Editor (from Aza's blog):
jetpack.menu.context.page.on("img").add(...)
I clearly see an attempt at approaching natural language here. But it's
inside code that's supposed to be object-oriented. And I find it a bit
puzzling. If I read one word after another, it's not natural and not
even hierarchical. I think something like
jetpack.page.foreach("img").contextmenu.add(...) is more readable, more
instantaneously understandable. And then better tailored for the target
of Jetpack, people who are not XUL experts nor commonly versed into
add-on authoring.
-----
My thoughts are:
1. jetpack is an object. jetpack.menu is an object.
jetpack.context.page is an object. jetpack.context.page.on("img") is an
object. They're all objects. You can stop at any of those objects and
do anything you want with them.
2. How is it not hierarchical? You're going from the least-specific
menu object to the most. It's very plain.
3. What does that line of code have to do with XUL or add-ons experts?
That's a non sequitur.
I think Daniel's proposed code is fine, but it's just another way of
looking at it, and none of the English around it is relevant. It does
introduce the idea of
jetpack.page, though, which is interesting. What
else would live there?
> My understanding here was that Blake is working on wrappers (COWs) that
> mean we won't have to worry about that sort of privilege escalation.
AIUI, COWs prevent content from accessing properties on chrome objects,
but they don't prevent chrome from accessing potentially dangerous
properties on content objects.
Drew