Hacker News new | ask | show | jobs
by Mikhail_Edoshin 3685 days ago
Imagine I want to display a menu in a browser. The right behavior for a menu is to open in such a way that it's visible. Normally menus expand down and to the right, but if there's not enough space in these directions, they will expand in up and/or left. Try to move a Windows app so that its menu is very close to the bottom of the screen -- it will start opening its menus up. (Not to mention that they open outside of the app's window.)

In a browser menus are not like that. Normally they're imitated with CSS: a JavaScript or even a CSS selector swaps CSS classes from visible to invisible. There's no support for real menu behavior; you either have to do this all by yourself (probably pre-build the menu offscreen to measure it and then decide where to place it) or give up and use sub-par menus-like imitations And this is the only glitch here; there's lots of them (submenu behavior, shortcuts, behavior of text fields, etc.) In the standard GUI these things are implemented for you and polished long time ago; in browsers they simply do not exist.

And CSS is not that good even as a high-level layout engine.