205 points · by ndesaulniers · 12y ago · 103 comments
https://www.destroyallsoftware.com/talks/the-birth-and-death...
Impressive. I can't say I see the practical implementations of this, but I'm sure there's some. But it's impressive nonetheless.
Theoretically, now you could render the DOM to a texture instead of to the screen and do some sweet deferred rending.
== Edit ==
Looks like one of Mozilla's Distinguished Engineers blogged about the technique. [1] [2] The creator of emscripten used this technique to render tweets as a texture in the bannabread demo. [3]
[0] https://medium.com/@deathcap1/six-months-of-voxel-js-494be64...
[1] http://robert.ocallahan.org/2011/11/drawing-dom-content-to-c...
[2] https://developer.mozilla.org/en-US/docs/Web/HTML/Canvas/Dra...
The nice part about CSS 3D transforms is that interactivity is maintained, and it's still hardware-accelerated. A fantastic example of this was made by the creator of Three.js over a year ago:
http://mrdoob.com/lab/javascript/threejs/css3d/
As you said above, there are severe drawbacks with that approach. It is very limited in terms of what's possible compared to a traditional 3D scene. Moreover, since CSS 3D transforms are essentially DOM content rendered to a texture, rasterization occurs, and as such there isn't clean scaling, even with SVG content.
var texture = new THREE.Texture(theCanvas);
texture.needsUpdate = true; //refreshes the texture from the source canvas
Now combine it with React.js to avoid redrawing unless necessary and forward the mouse events back to Webkit.js, and you have an interactive HTML texture :)Here, I'll give a simple example. Let's say there's a site that uses cookies to track logins. For example, hacker news. Now, hacker news does have the X-Frame-Option Deny, but let's assume it doesn't.
So to figure out my hacker news username, all you have to do now is create an iframe with hacker news, and then getPixel on the area of the frame that contains usernames, run some trivial OCR, and done.
Now, this issue is even more serious in other instances. For example, google talk widgets are embedded by iframes I believe.
In both these cases, a fresh rendering would still have the inappropriate material due to cookies. If cookies aren't sent, e.g. you do a fresh render in a private tab, it would still have security concerns for anything that displays different, sometimes private, content based on ip address.
For an example of that, you could render "private.internal.company.localsite" in an iframe and if a visitor from that company visited, even a cookie-less load would probably show private data due to the internal site relying on ip/nat controls.
https://developer.mozilla.org/en-US/docs/Web/CSS/element
I've written GUI builders that really could have used this for icons of views. Instead I had to render on the server. It'd be nice if it got more broadly adopted.
Also, even though people tend to not like this kind of thing here, it has to be said: Yo dawg...
GMail, a webapp email reader, is currently taking 368MB of RAM. Insane!
Maybe someday we'll code apps in Objective-C/Java that run in the browser, all inside a canvas.
Please make it easier. More simple.
You know all those malware issues regarding unsigned or compromised executables? Not a problem in the wonderful world where programs are incapable of acting overly malicious. There're specs like webgl and webcl that lets you take the scary topic of graphics programming, which is communication to an external piece of hardware, and make that as safe as loading some javascript to sort a table by dollar value.
</rant>
https://developer.gnome.org/gtk3/stable/gtk-broadway.html http://www.youtube.com/watch?v=fr8eo4RlPw4
Open FTW.
(Also WebGL support is new in iOS). Are people really clamoring for the Firefox engine to be supported in iOS?
For instance, as of about a week ago Safari on iOS just got WebGL support (as you alluded to). How long would we have had WebGL support on iOS if we could ship an alternative browser engine implementation with competitive JIT'ing JavaScript engine (like Firefox's Gecko & SpiderMonkey engines) on iOS since the beginning? Would alternative browser engines with more APIs drive the Safari for iOS team to ship features faster? Bottom line: competition is healthy; developers and thus users win.
Which is not possible on FirefoxOS. So I don't see how 'open' wins here (I'm using 'open' as the GP used it: a marketing buzzword synonymous with Mozilla).
No, they forked Webkit due to all the browser related #ifdef's they had scattered across the source code. They were diverging to much and damaging the quality of the code.
https://en.wikipedia.org/wiki/Blink_%28layout_engine%29
Edit: They're still pretty similar, though.
I don't see much difference between a single party and a cartel of 3-4 parties. They are all mega corporations that don't share my interests and even when there are several parties any one effectively has veto power over any changes to standards.
The push for browser-as-OS is only going to make things worse. You don't get any browser choice at all when your hardware is running ChromeOS or FirefoxOS
But nowadays, I see it as, multiple companies have a vested financial interest (including MS with their new leadership) to ensure that browsers are very powerful.
Even Apple, with iOS 8 has enabled 3rd party devs to have a full speed browser now with a JIT'd JS engine. They are simply not doing this from a position of weakness. There are no market forces. There's nobody out there saying "I won't use iOS because it only has Safari." Yet they still did it.
Your mobile platform won't succeed today unless it has a powerful browser built in, apps or not.
The browsers that are in the Apple App store are handicapped by legal limitations, which are not present on other, more open operating systems.
Is FirefoxOS more or less 'open' than iOS? You can't write a competitive javascript runtime for FirefoxOS either.
http://codeflow.org/entries/2014/jun/08/some-issues-with-app...
Also it's not a matter of "clamoring". People have no idea what they're missing. Do you think anyone would have been clamoring for Firefox on Windows in the 90s for they had never seen it and were limited to IE?
Maybe I'm showing my bias here but remember the browsers before Chrome and V8 came on the scene and heated up the competition? Well there's no competition on iOS because you can't write your own browser. Heck, I'd certainly like to see ASM.JS on iOS as one example.
56 on line 34 in webkit.api.js
Uncaught #<error> on line 15633 in webkit.bin.js
http://en.wikipedia.org/wiki/Brainfuck
so the reasons all the same.
Add it as a feature request on github and i'll add it to the api.
The engines worked, but where are they now? Nowhere. Just like Flash.
No matter how much effort you put into something, no matter how functional it is, now matter how much geek cred you'll get for it, if it doesn't have some sensible use, at least superficially, it'll linger and die. Wasted effort.
Just because you can do something...
I viewed the html source for this page and pasted it. I was quite impressed. It looks like this is supposed to be a browser engine written in Javascript?
So essentially we would have a sandbox browser within a browser? That would be awesome.
There's interesting research being done in the area of meta-circular interpreters. There's techniques for speeding them up; they're not as slow as I'd expect. For example, one interpreter can do type analysis and rewrite chunks of code.
The first thought that comes to mind would be to try to nest the things... a browser inside a browser inside a browser.