loge.hixie.ch

Hixie's Natural Log

2003-04-28 05:35 UTC This is why I hand-author

For reasons that I no longer try to fathom, I have to proof-read Narley's essays.

She writes them in Word. I don't accept Word documents, since they are in a proprietary format, yada yada, so she exports them to "HTML" before e-mailing them to me. Now I'm sure you're all very familiar with what Word calls HTML, but in case you're not, here is the header:

<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">

You might think it odd that Microsoft would use the wrong namespace for the HTML content, but you'd be wrong to think that that is the worst problem with the above markup. No, the worst problem is that it isn't XML, it's HTML. You can tell this from the fact that the rest of the markup isn't even remotely well-formed. (The missing DOCTYPE is something we'll gloss over, since frankly I'd rather this junk just be treated as quirks mode without any difficult questions.)

Let's have a look at one other bit of the markup:

...</p>
<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
<p class="MsoNormal">...

Say what? Let's ignore the utter invalidity of this line for one minute and focus on what it is trying to do... Increase the margin of the surrounding paragraphs. I think I can see the reasoning behind this (it almost certainly involved someone in a meeting one day saying "roundtripping is more important than cleanliness") but still, it should have been replaced by simply placing class "thematic-break" on the following element and then adding the following style rule, surely:

.thematic-break { margin-top: 2em; }

Now, fast forward a bit to when I try and edit this document to add my comments. Normally, I would switch to my Emacs window, and edit away. However, not even my regular expression search-and-replace skills are going to give me enough courage to try that, and I don't really trust HTML Tidy enough to remove the garbage from this file without removing things like extraneous spaces (part of proof-reading these documents involves pointing out when there are extra spaces that should be removed).

So instead, I go ahead and eat my own dogfood: I fire up Mozilla Composer.

My first problem is the font size is too small. So I fish around the UI, looking for an "increase font size" option. I eventually find one, and eventually figure out that to make it work, you have to have selected all the text first.

Net result (brace yourself):

...</big></big></big></p>
<big><big><big> </big></big></big>
<p class="MsoNormal"><!--[if !supportEmptyParas]--><!--[endif]--><big><big><big> <o:p></o:p></big></big></big></p>
<big><big><big> </big></big></big>
<p class="MsoNormal"><big><big><big>...

What on Earth! Now, added to the nonsense from Word, we have extra nonsense from Composer! If I say "increase the font size", I expect exactly one line to be added to the document, and that would be a style rule:

body { font-size: x-large; }

...with possibly some on-the-fly changes to the rest of the stylesheet to make sure it is expressed in ems and not absolute units. Sprinkling garbage all over the document markup really isn't acceptable.

Maybe if Web editors were forced to support alternate stylesheets this kind of nonsense would go away. After all, you can't support alternate stylesheets if you use style attributes and presentational markup.

Ahem. I think I'll just not look at the source view and pretend I'm using a WYSIWYG editor, I'm less likely to lose what remains of my sanity that way...

2003-04-22 17:11 UTC Buzz: Hallucinogenic drugs?

I used to be a firm supporter, and indeed (a long time ago) one of the few most active members, of the Web Standards Project. (You may remember the top 10 CSS problems in various browsers that the CSS Samurai wrote.)

A few years ago they started an "Upgrade Campaign", to try to entice users to upgrade to more compliant browsers. Today Mark announced that they had recently retired this campaign.

To quote:

The percentage of standards supporting browsers in use has increased tremendously. The percentage of non-standards supporting browsers is low and doing nothing but decreasing.

Well let's see. Google says:

Microsoft Internet Explorer 6.0's market share has been rising steadily since September 2001, and now has around three times more market share than the next two most popular browsers, Internet Explorer 5.0 and Internet Explorer 5.5. Other browsers have marginal market share.

Now, I don't mean any offense to Microsoft, but in what world is MSIE 6.0 a standards supporting browser that doesn't give authors a difficult time when trying to write Web sites?

Maybe I am too optimistic, but when I ask for standards support, the idea is that you can write the page once and know that all UAs will follow the specs. Given the many discussions I see on css-discuss, it is quite clear that we are not there yet. Even given that IE6 is over 18 months old now, and so cannot be expected to support things like CSS2 Selectors — let alone the CSS3 Selectors, support for which is already growing in many other UAs — or advanced CSS2 features like fixed positioning, table layout, generated content, or the inherit keyword; even given that because it is so old in Internet terms it can't be expected to support newer standards like XHTML or MathML; even given that Microsoft have limited resources and so can't be expected to support things such as data: URIs or alternate stylesheets; even granted that some of its bugs were technically correct when it was released and have only become non-compliant after the spec was clarified; even given all that, it still has numerous layout-breaking and script-breaking bugs. Totally broken margin collapsing. Totally broken box model. Totally broken float wrapping. Broken CSS parser. Buggy CSS1 selector engine. Buggy white space handling. Poor support for the 'ex' unit. Totally broken inline box model. Broken 'text-decoration' support Utterly broken HTML <object> support. No support for the HTML <link> element. Broken HTML comment parsing. Broken relative URI support. Need I go on?

Pingbacks: 1 2

2003-04-20 20:01 UTC DOM2 CSS needs work

I was sharply reminded today that we (the CSS working group) really need to do something about the CSS object model. I was given a simple task: Increase the width of element by 3em.

As far as I can tell, currently the official way of doing this is:

document.getOverrideStyle(element, null).getPropertyCSSValue("width").setFloatValue(CSS_EM, 3 + document.defaultView.getComputedStyle(element, null).getPropertyCSSValue("width").getFloatValue(CSS_EM));

Here is how I propose it be done (this would be exactly equivalent to the above):

element.computedStyle.width.em += 3;

Something to look at once we've finished with CSS2.1, maybe.

2003-04-17 21:14 UTC "Oh no I am so confused"

September 25th. I wanted to do some database work today, so one of my friends suggested I download something called "Firebird". I found two packages... one called "Mozilla Browser" whose codename was "Firebird™ Browser", and one called "Firebird, Relational Database for the New Millennium". How confusing! I don't know which I should download.

2003-04-17 13:23 UTC Handshake protocol showcase

--> Xiven (Xiven@modem-1098.crocodile.dialup.pol.co.uk) has joined #mrt
--- L gives channel operator status to Xiven
--> Kamakaze (Kam@dial-62-64-226-80.access.uk.tiscali.com) has joined #mrt
--- L gives channel operator status to Kamakaze
<Xiven> lo
<Kamakaze> lo
<Hixie> lo
<Hixie> bye, lunch
<Xiven> :)
<Kamakaze> bbl
<-- Kamakaze has quit (Quit)
<Xiven> cya
<Xiven> bbl
<-- Xiven has quit (Quit: Small flaw in d4 pl4n boo)