Web Devout tidings

Archive for April, 2006

W3C to standardize the Window object

Monday, April 10th, 2006

Following the recent XMLHttpRequest draft, the World Wide Web Consortium (W3C) is continuing its move to define standards for common-in-practice technologies with a new Window object draft. The Window object is one of the oldest, most commonly used proprietary technologies for use on webpages, and the W3C has set out to define a minimal standard feature set for it.

The specification draft notes that dispite the name, which is “Window” for legacy reasons, the object is not limited to visual user agents. The Window object extends the previously standardized DOM Level 2 AbstractView interface and provides interfaces for document locations and time-based events.

Several commonly supported features of the Window object, such as history navigation, dynamic generation of new windows, alerts, and prompts, are not yet covered in this draft. The draft is only a work-in-progress and is expected to be superceded by following drafts.

W3C to standardize the XMLHttpRequest object

Thursday, April 6th, 2006

The World Wide Web Consortium (W3C) has published the first working draft for the XMLHttpRequest object.

XMLHttpRequest is a popular tool for making dynamic requests on webpages to remote servers. It is the cornerstone for what has come to be known as AJAX. It was originally implemented by Internet Explorer 5.0 as an ActiveX object, followed by Mozilla 1.0 as a native object, and then Opera 8.0 as a simple native frontend to the W3C-standardized DOM Load and Save model, currently unsupported by Internet Explorer and Mozilla browsers. Internet Explorer 7 will offer the object natively like Mozilla and Opera.

Although DOM Load and Save became a W3C Recommendation in April 2004, its lack of support and relative difficulty of use has made it less attractive to web developers than the much simpler XMLHttpRequest object. Two years later, the W3C has acknowledged the popularity of XMLHttpRequest and is now attempting to standardize a minimal implementation of the object based on the WHATWG’s research on existing behavior in modern web browsers.

From the draft:

The XMLHttpRequest object is implemented today, in some form, by many popular Web browsers. Unfortunately the implementations are not completely interoperable. The goal of this specification is to document a minimum set of interoperable features based on existing implementations, allowing Web developers to use these features without platform-specific code. In order to do this, only features that are already implemented are considered. In the case where there is a feature with no interoperable implementations, the authors have specified what they believe to be the most correct behavior.

This specification is currently a working draft and is thus subject to change.

CSS Naked Day

Wednesday, April 5th, 2006

Today is the first annual CSS Naked Day. This is the day we take down our stylesheets in support of structural markup.

As all professional web designers know, it is important to separate webpage content from presentation. The purpose of HTML is to express the content of the webpage — to describe the meaning of each component of the webpage in a way that would interest automated agents such as search engines that are attempting to understand the information that your webpage is expressing. CSS then provides a presenation layer to define how human beings should experience the page content.

If you aren’t following this model correctly, there will likely be problems when the stylesheet is disabled. You may see things shoved up against the right side of the page, images cut up into pieces, border or background images placed oddly here and there, or other oddities that make the webpage very difficult to use. However, if you’re following the model correctly, everything should be nicely lined up against one side of the page, the font and color should be consistant, images don’t look out of place, navigation and heirarchical information structures should be in nice organized lists, and the page should generally look like a well-organized text document ready for printing.

Annual CSS Naked Day is a way to encourage web developers to write proper structural markup. The idea is that the quality of your markup should be reflected by how readable and usable your webpage is when stylesheets are disabled. The exercise is pointless if you are using presentation elements like font, big, and b. In most cases, those elements should be replaced with some combination of structural elements like p, h2, and strong and CSS to define how the elements should appear. There are special cases where elements like b and br should be used, but they are quite rare.

And the big problem this exercise is trying to show is the use of tables for layout purposes. Table elements have structural meaning and are the correct elements to use in cases where the information being presented is tabular in nature. However, when table elements are used just to visually position things on a page, it sends the wrong message to search engines and other agents that try to make use of the markup semantics. The agent is told that each row and column is a set of strictly related data, when in fact the only relationship is the intended visual position of the table cell contents. Imagine that the agent is trying to learn something new from you and you tell it that a pig is to bacon as a list of cities is to both a book and a copyright statement. You can see how the agent might walk away quite confused by your website. That probably isn’t what you want to do to your blind visitors who expect the page to be read out in some kind of logical order, or to search engines if you want them to give you a high ranking.

So check out how your page looks without a stylesheet. In Firefox, go to the View menu » Page Style » No Style to see the current page without stylesheets. In Opera, go to the View menu » Style » User mode and uncheck any boxes below it. Internet Explorer and Safari don’t have a straight-forward way to disable author stylesheets even though it is a CSS 2.1 conformance requirement. Fix up your page if you need to, make sure it validates with a Strict doctype, and have a nice CSS Naked Day!

Internet Explorer 7 DOM support information available

Saturday, April 1st, 2006

I have finished the DOM and ECMAScript support information for Internet Explorer 7.

There isn’t much to say. As far as I could see, only three things have been changed:

  • Element.style.maxHeight is now supported.
  • Element.style.maxWidth is now supported.
  • Element.style.minWidth is now supported.

It’s surely a disappointment for those who were hoping for more of a move toward the DOM standards. There were also some changes regarding XMLHttpRequest, but that’s proprietary and thus beyond the scope of my tables.

And sadly, this is not an April Fool’s joke. Sorry.