Live data from Hacker News

Get on the CSS Grid

updates.html5rocks.com

21–30 of 46 posts

Re: Get on the CSS Grid

#21
post #17

Great, but I feel horrible at the same time because browser just slowly reinvents everything, and is still limited to a single specific implementation. How about just make Javascript frigging fast so everyone can code their own layout system? How about standard NaCl interface for layouting? Browser needs to be an open platform, not a framework.

> How about just make Javascript frigging fast so everyone can code their own layout system? How about standard NaCl interface for layouting?

If layout were in JS (or PNaCl), we wouldn't be able to run it off the main thread, or parallelize it in Servo, or experiment with running it on the GPU. We would also lose the ability to do text reformatting on mobile, accessibility would be harder, etc.

To elaborate in regards to running CSS off the main thread: We got very lucky that IE's extensions to allow JavaScript in the middle of CSS evaluation (and also possibly XBL) never caught on, and so CSS can be done more or less entirely independent of the main JS event loop (unless the styling is performed in response to a direct JS query, e.g. getComputedStyle). If layout were performed by JS, there would be no hope: layout could perform arbitrary JS manipulations and we would be no choice other than to stall the main event loop while styling is happening (as current browsers do). But because CSS is largely separated from JS, we can just run it off the main thread and allow JavaScript to run uninterrupted by layout.

Re: Get on the CSS Grid

#22
post #17

Great, but I feel horrible at the same time because browser just slowly reinvents everything, and is still limited to a single specific implementation. How about just make Javascript frigging fast so everyone can code their own layout system? How about standard NaCl interface for layouting? Browser needs to be an open platform, not a framework.

> just slowly reinvents everything

Yep. Not sure why they didn't just copy WPF or even Android's way years ago.

Re: Get on the CSS Grid

#23
post #17

Great, but I feel horrible at the same time because browser just slowly reinvents everything, and is still limited to a single specific implementation. How about just make Javascript frigging fast so everyone can code their own layout system? How about standard NaCl interface for layouting? Browser needs to be an open platform, not a framework.

> How about just make Javascript frigging fast so everyone can code their own layout system?

Because separating content (HTML) from layout (CSS) from behavior (JS) is a good thing, and because, particularly, being able to have content work without layout or behavior (for situations where you just need the content), and to have content and layout work without behavior (for situations where you just need static presentation) are important.

Re: Get on the CSS Grid

#24
post #2

This seems very similar to Java's gridbag layout manager ( http://docs.oracle.com/javase/tutorial/uiswing/layout/gridba... ) in terms of functionality. I always liked the flexibility of using that layout manager (although I always managed it via visual editors) so if this does reach mainstream compatibility it could be good! As comments on the article point out, it seems to overlap with FlexBox quite a bit though.

I think it's actually based on the grids in WPF ( http://en.wikipedia.org/wiki/Windows_Presentation_Foundation ). This is no bad thing; those grids are superb for UI layout. Look at the editors list; this comes out of MS. Again, it's good that they feed this out into web standards.

Very much reminded me of WPF, where grids are awesome. This being CSS, the syntax is a bit wonky, but it is certainly very good news for a world stuck in "pick any one of three sizes" bootstrap grids.
Post reply on HN