To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
It would certainly open the doors up to more patch contributions from the JS community.
In the interests of streamlining the engine by self-hosting more features, I wonder if we should consider replacing our current implementation of <marquee> with this implementation running in Blink-in-JS. (Gecko's implementation of <marquee> is similarly self-hosted in XBL.)
Thoughts?
Is that totally separate from the JavaScript of the page?
(Say, a page overrides and neutralizes Object.defineProperty, string.prototype.match and so - will it break your code?)
I ask because I know Chrome extension API implementations (browser side) had problems with such implementations.
I'm curious if agreeing to this might set a precedent for future simplistic tags to similarly be implemented using Custom Elements in Blink-in-JS.
I'm curious if agreeing to this might set a precedent for future simplistic tags to similarly be implemented using Custom Elements in Blink-in-JS.
It would certainly open the doors up to more patch contributions from the JS community.
(tangential)if there is a way to sensibly do self-hosted JS in blink, I'd very much like to know. There are a number of features in the WebRTC spec, and in the tricks we do for backwards compatibility, that just seem to cry out for a JS implementation.
Last time I asked around, the response was something like "not without side effects we don't like".
PhistucK:Is that totally separate from the JavaScript of the page?
(Say, a page overrides and neutralizes Object.defineProperty, string.prototype.match and so - will it break your code?)I ask because I know Chrome extension API implementations (browser side) had problems with such implementations.Yes. Blink-in-JS runs in a separate world from user's JavaScript. No JavaScript objects are shared between user's JavaScript and Blink-in-JS. (As explained above, we've fixed a lot of cross-world leakage and inserted RELEASE_ASSERTs to catch the leakage if any.)
On Sunday, June 15, 2014 4:33:12 AM UTC-4, Kentaro Hara wrote:PhistucK:Is that totally separate from the JavaScript of the page?
(Say, a page overrides and neutralizes Object.defineProperty, string.prototype.match and so - will it break your code?)I ask because I know Chrome extension API implementations (browser side) had problems with such implementations.Yes. Blink-in-JS runs in a separate world from user's JavaScript. No JavaScript objects are shared between user's JavaScript and Blink-in-JS. (As explained above, we've fixed a lot of cross-world leakage and inserted RELEASE_ASSERTs to catch the leakage if any.)
Hmm, could you explain how this works, so I could update my mental model? For example, how is the Blink-in-JS code able to use e.g. `someObj.hasOwnProperty` without being susceptible to the page changing `Object.prototype.hasOwnProperty`, and yet it is still producing objects that inherit from the page's `Object.prototype`?
My naive mental model doesn't work very well. For example, when implementing (say) HTMLDivElement.prototype.align's getter, I might do `this.getAttribute("align")`. But what if someone on the page overwrote `Element.prototype.getAttribute`?
The solution I thought we'd have to do was to save a reference to anything potentially under user control, and then ensure the Blink code gets run first. So instead of doing `this.getAttribute("align")`, we would (at the top of the script) say `getAttribute = Element.prototype.getAttribute`, and then later, do `getAttribute.call(this, "align")`.
Is that still necessary with Blink-in-JS's protections, or did you find a way around such contortions?