Live data from Hacker News

HTML is object code

rondam.blogspot.com

61–68 of 68 posts

Re: HTML is object code

#61
post #42

Earlier quoted context omitted.

CSS1 was mostly about typography, but CSS2 supports layout equivalent to (or rather a superset of) what is possible with HTML tables.

Here's a simple task you can't do in CSS2: Create a multi-line form where the labels are right-aligned to the fields, the fields all line up, and everything expands to fill the contents.

    
	label { display: table-row; }
	span { display: table-cell; }
    
    Label:
       
    Longer label:
       

Re: HTML is object code

#62
post #41

Earlier quoted context omitted.

CSS does support flexible grids (with power equivalent to HTML tables), it is just that IE has not supported it until IE8, which means it hasn't been used widely. I fint it strange that people keep blaming the shortcomings of IE6+7 on the CSS standard.

Reference? Are you referring to http://www.w3.org/TR/css3-grid/ ? Which is at the working draft status?

CSS2 (which has been a recommendation for a decade) supports display:table, which is equivalent to the layout model of HTML-tables: http://www.w3.org/TR/CSS21/tables.html#value-def-table

The working draft you refer to is a new model which is more powerful than either HTML tables or CSS2.

Re: HTML is object code

#63
post #33

Earlier quoted context omitted.

HTML should not be used for UI, it's for inserting content and from elements into a presentation. CSS, with the help of graphics and javascript for interactivity should do the UI. Doing something like: with-html :ul :id "site-menu" dolist (menu-item (list "home" "news" "blog" "aboutus")) :li (:a :href concat(*server-root* menu-item) menu-item) Should generate this: home news blog aboutus Then in a CSS page referenced…

In what universe are content, forms and menus not part of the UI?

In a world where you can layer truly higher-level UI elements on top of them? Just because some elements map 1:1 doesn't mean all do. You can generate a button from or but that goesn't mean you can't generate image "buttons". The final generation of a "button" should be left to your rendering module.

This is very similar to addition being a far higher level process than the ADD opcode present in every instruction set. Sure, sometimes addition translates to a single ADD, but not always.

Re: HTML is object code

#64
post #61

Earlier quoted context omitted.

Here's a simple task you can't do in CSS2: Create a multi-line form where the labels are right-aligned to the fields, the fields all line up, and everything expands to fill the contents.

label { display: table-row; } span { display: table-cell; } Label: Longer label:

My bad, didn't check my facts, table-cell is in CSS2! Of course, in my defense, it doesn't matter which standard it's defined in if it isn't supported by IE. It isn't even supported in IE7 and we've just recently dropped support for IE6.

Re: HTML is object code

#65
post #62

Earlier quoted context omitted.

Reference? Are you referring to http://www.w3.org/TR/css3-grid/ ? Which is at the working draft status?

CSS2 (which has been a recommendation for a decade) supports display:table, which is equivalent to the layout model of HTML-tables: http://www.w3.org/TR/CSS21/tables.html#value-def-table The working draft you refer to is a new model which is more powerful than either HTML tables or CSS2.

...which will be great in 2015 when enough browsers implement it to be useful. :)

Re: HTML is object code

#66
post #62

Earlier quoted context omitted.

Reference? Are you referring to http://www.w3.org/TR/css3-grid/ ? Which is at the working draft status?

CSS2 (which has been a recommendation for a decade) supports display:table, which is equivalent to the layout model of HTML-tables: http://www.w3.org/TR/CSS21/tables.html#value-def-table The working draft you refer to is a new model which is more powerful than either HTML tables or CSS2.

CSS emulation of tables doesn't meet the requirement though.

The question was whether CSS supports the primitives required to do grid layouts without coupling the CSS to HTML, effectively requiring the two of them to be treated as object code.

If you're going to require that the markup contain divs that are ordered and nested just so, so that they can be styled to layout like a table, then you might as well just use a table. Either way you are coupling presentation to semantics.

Re: HTML is object code

#67
post #63

Earlier quoted context omitted.

In what universe are content, forms and menus not part of the UI?

In a world where you can layer truly higher-level UI elements on top of them? Just because some elements map 1:1 doesn't mean all do. You can generate a button from or but that goesn't mean you can't generate image "buttons". The final generation of a "button" should be left to your rendering module. This is very similar to addition being a far higher level process than the ADD opcode present in every instruction set…

What you're describing is what most would call "skinning" or "theming", whereas "user interface" is generally considered to penetrate much deeper into the functionality of the app. Decoupling UI requires an incredibly abstract description of functionality. I've never seen a practical and generalizable example of such a thing.

Skinning, as you point out, often demands modification to the DOM, a task to which HTML and CSS alone are unsuited. It can be done with JavaScript, but it's much more practical and reliable to use a server-side abstraction a la ASP.NET or Seaside. This is more or less the point made by the original article.

Re: HTML is object code

#68
post #62

Earlier quoted context omitted.

CSS2 (which has been a recommendation for a decade) supports display:table, which is equivalent to the layout model of HTML-tables: http://www.w3.org/TR/CSS21/tables.html#value-def-table The working draft you refer to is a new model which is more powerful than either HTML tables or CSS2.

CSS emulation of tables doesn't meet the requirement though. The question was whether CSS supports the primitives required to do grid layouts without coupling the CSS to HTML, effectively requiring the two of them to be treated as object code. If you're going to require that the markup contain divs that are ordered and nested just so, so that they can be styled to layout like a table, then you might as well just use…

CSS is obviously always coupled to HTML in the sense that CSS applies styling and layout to elements in HTML. If you don't have an element to delimit the chunk of content you want to style, you cant do it with CSS. The point is just that the markup HTML should be independent of any particular presentation.

You don't have to use divs, you can use semantic elements (P, whatever) if that is appropriate for the content.

You definitely might not just as well use a table. The trouble with tables for layout is that they have the wrong semantics, which means they makes the page less accessible.

Post reply on HN