Re: Use of "instanceof SomeDOMInterface" in chrome and extensions

2012-12-31 Thread Robert O'Callahan
Another way of looking at the problem: should there be an API to determine
if an object implements a particular WebIDL interface? I hope we agree the
answer is yes... In that case, what would we call it? Can we call it
something that doesn't sound like "instanceOf", and explain with a straight
face why it should be used instead of instanceOf, and expect that authors
will actually use it instead of just using instanceOf?

Rob
-- 
Jesus called them together and said, “You know that the rulers of the
Gentiles lord it over them, and their high officials exercise authority
over them. Not so with you. Instead, whoever wants to become great among
you must be your servant, and whoever wants to be first must be your
slave — just
as the Son of Man did not come to be served, but to serve, and to give his
life as a ransom for many.” [Matthew 20:25-28]
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Use of "instanceof SomeDOMInterface" in chrome and extensions

2012-12-31 Thread Boris Zbarsky

On 12/31/12 8:25 PM, Boris Zbarsky wrote:

They were, as roc points out, apathetic.  Or rather, there was some talk
about it being a good idea but no concrete proposals and nothing
actually happening.


That said, I posted one more time on public-script-coord (and bcced 
es-discuss) just to see if people bite this time.


-Boris
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Use of "instanceof SomeDOMInterface" in chrome and extensions

2012-12-31 Thread Boris Zbarsky

On 12/31/12 5:08 PM, Bobby Holley wrote:

I think we should consider any reliance on this behavior a bug for
now


Fine.  Then the question becomes: how do we _not_ rely on this behavior? 
 As smaug pointed out upthread there is actually no sane way to do that 
right now.



It also sounds from your initial post that other vendors weren't very
receptive to the idea.


They were, as roc points out, apathetic.  Or rather, there was some talk 
about it being a good idea but no concrete proposals and nothing 
actually happening.



This can't be an unreasonable requirement to place on
Gaia, since it's also the state of affairs on the open web.


The state of affairs on the open web is totally broken.

-Boris

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Use of "instanceof SomeDOMInterface" in chrome and extensions

2012-12-31 Thread Robert O'Callahan
On Tue, Jan 1, 2013 at 2:26 PM, Bobby Holley  wrote:

> But IIUC the magic already works via XPConnect/nsDOMClassInfo quirks. This
> is why Gaia developers are starting to rely on it, and why Boris is
> wondering whether he should propagate that magic into WebIDL bindings.
>
> So we've already been implementing this for years, and so continuing to do
> it is unlikely to pique the interest of other vendors. Thus, if we can't
> solve this at the spec level now, it's unclear to me what else we can do.
> And I'm more in favor of aligning with the spec than preserving our
> non-standard sugar.
>

Yes, that is a good point. I hadn't considered that other browsers already
follow the spec here, so following the spec isn't likely to break Web
content.

Though, if you look at pages like
http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object,
it's sad to see that all the answers are wrong, and the closest-to-correct
answer fails because of the issue at hand.

Rob
-- 
Jesus called them together and said, “You know that the rulers of the
Gentiles lord it over them, and their high officials exercise authority
over them. Not so with you. Instead, whoever wants to become great among
you must be your servant, and whoever wants to be first must be your
slave — just
as the Son of Man did not come to be served, but to serve, and to give his
life as a ransom for many.” [Matthew 20:25-28]
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Use of "instanceof SomeDOMInterface" in chrome and extensions

2012-12-31 Thread Bobby Holley
On Mon, Dec 31, 2012 at 5:12 PM, Robert O'Callahan wrote:

> I interpreted Boris to mean other vendors were apathetic rather than
> opposed.
>
> If it was just apathy, then I think we should go for it and make
> instanceof magic for WebIDL interface objects in both content and chrome,
> and try to get specs and other engines to follow suit.
>

But IIUC the magic already works via XPConnect/nsDOMClassInfo quirks. This
is why Gaia developers are starting to rely on it, and why Boris is
wondering whether he should propagate that magic into WebIDL bindings.

So we've already been implementing this for years, and so continuing to do
it is unlikely to pique the interest of other vendors. Thus, if we can't
solve this at the spec level now, it's unclear to me what else we can do.
And I'm more in favor of aligning with the spec than preserving our
non-standard sugar.

bholley
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Use of "instanceof SomeDOMInterface" in chrome and extensions

2012-12-31 Thread Robert O'Callahan
On Tue, Jan 1, 2013 at 2:08 PM, Bobby Holley  wrote:

> It also sounds from your initial post that other vendors weren't very
> receptive to the idea. If so, that's a shame. Maybe we could try again?
>

I interpreted Boris to mean other vendors were apathetic rather than
opposed.

If it was just apathy, then I think we should go for it and make instanceof
magic for WebIDL interface objects in both content and chrome, and try to
get specs and other engines to follow suit.

Rob
-- 
Jesus called them together and said, “You know that the rulers of the
Gentiles lord it over them, and their high officials exercise authority
over them. Not so with you. Instead, whoever wants to become great among
you must be your servant, and whoever wants to be first must be your
slave — just
as the Son of Man did not come to be served, but to serve, and to give his
life as a ransom for many.” [Matthew 20:25-28]
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Use of "instanceof SomeDOMInterface" in chrome and extensions

2012-12-31 Thread Bobby Holley
On Mon, Dec 31, 2012 at 4:45 PM, Boris Zbarsky  wrote:

> On 12/31/12 4:26 PM, Bobby Holley wrote:
>
>> Well, if we're talking about JS-implemented WebAPIs, then that stuff
>> should
>> be running as chrome, potentially in the content process (unless I'm
>> mistaken - I'm still a bit behind on all the b2g architecture). If we're
>> talking about web apps, then they're supposed to be regular old web
>> content, and we shouldn't do anything special for them in Gecko. Doing so
>> undermines our position that these apps are open and portable.
>>
>
> We're talking about the b2g UI.  And I'm not talking theoretically; it's
> using instanceof on HTML elements right now.  So either we change that
> code, or we make those instanceof checks work or something.


Gaia? I think we should consider any reliance on this behavior a bug for
now, otherwise the project is standards-based in name only. Gecko is
currently the only engine implementing all the WebAPIs, but we're hoping
that will change. And when it does, it would suck if the apps still didn't
work because they were actually relying on all sorts of non-standard Gecko
junk.

 I'd think the arguments should be based on improving the HTML5 developer
> experience
>

Yes, of course.  As I said, this has come up multiple times in the past,
> precisely on those grounds.


It also sounds from your initial post that other vendors weren't very
receptive to the idea. If so, that's a shame. Maybe we could try again?
Nevertheless, if they won't listen, I think we should remove our hacks and
align with the spec (fixing any gaia breakage), rather than entrenching our
nonstandard behavior. This can't be an unreasonable requirement to place on
Gaia, since it's also the state of affairs on the open web.

bholley
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Use of "instanceof SomeDOMInterface" in chrome and extensions

2012-12-31 Thread Boris Zbarsky

On 12/31/12 4:26 PM, Bobby Holley wrote:

Well, if we're talking about JS-implemented WebAPIs, then that stuff should
be running as chrome, potentially in the content process (unless I'm
mistaken - I'm still a bit behind on all the b2g architecture). If we're
talking about web apps, then they're supposed to be regular old web
content, and we shouldn't do anything special for them in Gecko. Doing so
undermines our position that these apps are open and portable.


We're talking about the b2g UI.  And I'm not talking theoretically; it's 
using instanceof on HTML elements right now.  So either we change that 
code, or we make those instanceof checks work or something.



I'd think the arguments should be based on improving the HTML5 developer
experience


Yes, of course.  As I said, this has come up multiple times in the past, 
precisely on those grounds.


-Boris
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Use of "instanceof SomeDOMInterface" in chrome and extensions

2012-12-31 Thread Bobby Holley
On Mon, Dec 31, 2012 at 3:58 PM, Boris Zbarsky  wrote:

> On 12/30/12 11:14 PM, Bobby Holley wrote:
>
>> 1)  How do we want this to work going forward for chrome touching content?
>>
>> |obj instanceof Node| should return true.
>>
>>  2)  How do we want this to work going forward for web pages touching
>>> other
>>> web pages?
>>>
>>
>> |obj instanceof Node| should return false until the standards community
>> decides something to the contrary and specs it.
>>
>
> OK.  What do we do with b2g?  I'm not quite sure whether the code in there
> I see using instanceof is running in "chrome"; most of b2g doesn't do
> that


Well, if we're talking about JS-implemented WebAPIs, then that stuff should
be running as chrome, potentially in the content process (unless I'm
mistaken - I'm still a bit behind on all the b2g architecture). If we're
talking about web apps, then they're supposed to be regular old web
content, and we shouldn't do anything special for them in Gecko. Doing so
undermines our position that these apps are open and portable.

If we think it would significantly improve the web as a platform, I'm
certainly down to push for it (in the front seat) with other vendors. But
I'd think the arguments should be based on improving the HTML5 developer
experience, rather than improving the B2G developer experience.
Theoretically, there isn't supposed to be much of a difference. ;-)

bholley
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Use of "instanceof SomeDOMInterface" in chrome and extensions

2012-12-31 Thread Boris Zbarsky

On 12/30/12 11:14 PM, Bobby Holley wrote:

1)  How do we want this to work going forward for chrome touching content?

|obj instanceof Node| should return true.


2)  How do we want this to work going forward for web pages touching other
web pages?


|obj instanceof Node| should return false until the standards community
decides something to the contrary and specs it.


OK.  What do we do with b2g?  I'm not quite sure whether the code in 
there I see using instanceof is running in "chrome"; most of b2g doesn't 
do that



See (2). I'm in favor of Mozilla taking the back seat on this one - I'm
happy to implement it if other vendors are pushing for it, but think we
have bigger things to be pushing for ourselves.


If we weren't running into this problem head-on ourselves, including in 
b2g, I wouldn't be worrying about it as much as I am, yeah.  But we are.


-Boris

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Use of "instanceof SomeDOMInterface" in chrome and extensions

2012-12-31 Thread Bobby Holley
On Mon, Dec 31, 2012 at 6:22 AM, Neil  wrote:

> Bobby Holley wrote:
>
>  In the long term, I'd like for Xray wrappers to behave more logically
>> with respect to the prototype chain than they have in the past. I believe
>> that Peter has already taken the first step by giving us meaningful Xrays
>> to DOM prototypes and interface objects
>>
>>  What does meaningful mean here? I don't think I've ever looked at the
> prototype of an Xrayed content node from chrome; I can just about see the
> use case of looking at the prototype of a waived node from chrome.


Meaningful in this case means that they're not entirely opaque, as was the
case for the traditional [xpconnect wrapped native prototype] XPCWN protos
and constructors. You can do things like "new
contentWindow.XMLHttpRequest", and I believe you can access constants,
properties, and methods.

The goal of Xrays is that waiving should be unnecessary unless you actually
want to see content expandos, so we want them to behave as naturally as
possible.

Anyway, this is getting off-topic for this thread. I'm happy to talk about
it more in another thread or on IRC though. ;-)

Cheers,
bholley
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: jsm source (mercurial )

2012-12-31 Thread Margaret Leibovic
Which jsm files are you looking for? You can browse the mozilla-central
repo (and download individual files) on the web here:
http://hg.mozilla.org/mozilla-central/

Margaret

On Mon, Dec 31, 2012 at 9:59 AM, rvj  wrote:

> do I need to install windows mercurial to download the jsm files ..
>
> or is there an alternative (simpler) method?
> __**_
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/**listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


jsm source (mercurial )

2012-12-31 Thread rvj

do I need to install windows mercurial to download the jsm files ..

or is there an alternative (simpler) method?
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Use of "instanceof SomeDOMInterface" in chrome and extensions

2012-12-31 Thread Neil

Bobby Holley wrote:


In the long term, I'd like for Xray wrappers to behave more logically with 
respect to the prototype chain than they have in the past. I believe that Peter 
has already taken the first step by giving us meaningful Xrays to DOM 
prototypes and interface objects

What does meaningful mean here? I don't think I've ever looked at the 
prototype of an Xrayed content node from chrome; I can just about see 
the use case of looking at the prototype of a waived node from chrome.


--
Warning: May contain traces of nuts.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Use of "instanceof SomeDOMInterface" in chrome and extensions

2012-12-31 Thread Neil

Boris Zbarsky wrote:


On 12/30/12 4:43 PM, Neil wrote:

(I would actually expect the proto of an Xray for a content object to 
be an [xpconnect wrapped native prototype]


If you expect that for WebIDL objects... you're going to be 
disappointed.  ;)


Yeah, well I still wish Xrays had been implemented as completely 
distinct wrappers for the underlying C++ object, with 
XPCNativeWrapper.unwrap() and wrap() the only links between the two sets 
of wrappers. I don't know whether that would have an equivalent in 
WebIDL though.


--
Warning: May contain traces of nuts.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform