Articles Tagged ‘W3C’

Vendor Prefixes and Evangelism

If you follow any front-end web developers on Twitter today, you’ll probably have come across articles on vendor prefixes and the latest CSSWG fight over Mozilla, Microsoft and Opera wanting to implement -webkit- vendor prefixes. Before I delve into why this is happening, I want to make something very clear – this is wrong and must not happen.

So why is it happening?

The February 2012 face-to-face meeting of the CSSWG [complete transcript] had vendor prefixes on the agenda because:

glazou: Title is: Why and How to Implement Other Vendors' Prefixes
   tantek: This is a specific subtopic of vendor prefixes
   tantek: The problem statement right now, and this is a problem for
           Mozilla and any other non-WebKit browser
   tantek: Sites have webkit-specific content, and serve backup content to
           everyone else. Specifically for mobile content.
   tantek: Non-WebKit browsers face prisoners dilemma
   tantek: similar to quirks in 2003 or so

FYI: glazou is Daniel Glazman, chair of the CSSWG, tantek is from Mozilla. Other parties who appear in quotes are Peter Linss (HP), Florian Rivoual (Opera), Sylvain Galineau (Microsoft) and Simon Fraser (smfr from Apple).

So far, sounds reasonable, then tantek continues:

tantek: At this point we're trying to figure out which and how many webkit
           prefix properties to actually implement support for in Mozilla
   plinss: Zero.
   tantek: Currently we have zero. Zero is no longer an option for us.

Suddenly, everything is turned upside down. Opera and Microsoft start saying the same thing – the argument is that of the top 1000 websites, a significant percentage uses webkit-only prefixes without the other browser prefixes.

glazou: A long time ago, Mozilla had an Evangelism team that would call up
           the website owners and ask them to change.

This refers to developer evangelism, people like Bruce Lawson, Martin Beeby and Rob Hawkes to name just three (Google has a huge team – [Thanks to Michael for the correct link]). All of these people are pioneers in web technology and use vendor prefixes every day, and all of them tell developers to use the other browser’s vendor prefixes too. This is not the opinion of the CSSWG:

 Florian, Sylvain: Evangelism has failed.
   glazou: Have you tried pinging the WASP about that? Other activists of web
           standards?
   sylvaing: If MS can't scale to handle this, you think WASP can?
   tantek: Opposite is happening right now. Web standards activists are teaching
           people to use -webkit-
   tantek: People like Lea Verou.
   tantek: Their demos are filled with -webkit-. You will see presentations
           from all the web standards advocates advocating people to use
           -webkit- prefixes.

These words make me sad indeed. The CSSWG has lost faith in evangelists and the community upon which it relies so much that they are prepared to implement other vendor’s non-standard code and prefixes to help them gain market share back.

Quirks mode all over again

Yes, this is where we’re at. The current dominance of webkit, especially on mobile, is causing developers to adopt non-standard technology and only those bits of technology for webkit. This cannot happen. Daniel Glazman understands:

tantek: What are the thresholds, even approximate, for implementing
           -webkit- properites (or none)?
   glazou: Unbelieveable we are having this discussion.
   Florian: Our job is to solve interoperability. We want to discuss it here,
            because that's our job.
   tantek: Help us minimize the damage.

There are two problems that have been raised: that webkit has an “IE6 style” dominance over mobile, and that developers are making matters worse.

Time for action

The first problem is not a problem at all. It is a symptom of developer knowledge being controlled by the “latest sexy and experimental technology”. Developers are fixated on making all of those great effects that we used to have with Flash work on iPads and iPhones, and because that’s webkit only, they pay no attention to the other browsers that can use their sites. Web standards is going backwards, and it’s our fault. It’s not Apple’s, it’s not Google’s, they simply make technology available, we produce code that only targets them.

The first step is to admit that there is a problem. Look at your code. If there is a vendor prefix for any property ask yourself why you chose to use it. If there’s a good reason (like 2d transforms are cool) then look closer – have you put all of the other vendor prefixes there as well? Have you checked the syntax to make sure it’s the same (because that’s what vendor prefixes are for). One final thing is to make sure you never do it again. There’s tools to help like prefix-free and SASS and LESS CSS pre-processors all do this for you.

Do it.

Change for browsers is harder

I’ll quote directly from Remy Sharp on this one:

Browsers need to:

  1. Fucking drop experimental prefixes. It’s unacceptable and a disservice to the developers working with your browser. You need to give timelines to dropping these things.
  2. Non-production ready browsers should support experimental prefixes, production ready releases should not. If it’s Chrome 16 – the stable version – experimental support should not be baked in. The properties should be full available without the prefix.
  3. Work with the working groups (…Apple).

I especially like item 2 here. Too many developers use dev channels as their main browser (I know I do). This is fine, but by removing prefixes from stable browser versions has the great advantage of breaking for your clients who will be on the stable channel. This will raise bugs and force developers to change their code. It works for me has never been a good excuse, and with this change it never will be.

Make some noise, Internet

None of these changes will be made if we don’t get the evangelism community back on its feet. For too long have we assumed that everything is hunky-dory now that HTML5 has ridden in and saved us from non-standard implementations. I implore you, blog about this, shout about this, tell your friends and make them review their code. Vendor prefixes are here to stay, and so are the five major browsers. You must code for all of them, all the time. Shout it from the rooftops, the only good vendor prefix, is every vendor prefix.

Why Validate? – Arran Ross-Paterson #LWSWorld

This month, Marcus Alexander of EMC Consulting and Arran Ross-Paterson (of this parish) talk about HTML in the real world, dealing with clients, and what a quality project actually looks like.

These are my notes on Arran’s talk:

LWSWorld - Why Validate - Arran Ross-Paterson

Greeted by boos from the crowd, Arran’s controversial talk focused on why we shouldn’t worry that our web sites don’t validate in the W3C checker.

Validation
Browsers don’t care, nor does Google. Unless it’s a requirement, just use it as a sanity checker. Your code doesn’t always have to validate to be valid.

Alt tags
Alt tags never fully describe a picture. There’s no point in having an alt tag on an image if it’s not completely descriptive. If the image is just to attract attention, then don’t worry. If it’s an image map, you will need to add some more description.

Calendars
Calendars look like tables, but they could be a list, and surely it’s ordered, but if you’re doing an event calendar, a definition list is the most semantic markup, except that <dl>s are really hard to style and missing tags can cause problems. Having <dd> inside a <dt> isn’t correct according to the validator, but feels more correct semantically.

Don’t abandon standards
Standards are very useful, so don’t abandon them. They’re great for learning and teaching people, to bring them up to a certain level, but as long as it works, don’t sweat it.

Thanks again to Arran for his talk. See my notes tonight’s other talk: Marcus Alexander’s on real world HTML