Cygnet in peril

June 13, 2009

This morning on the way to market in Esslingen, Germany, I discovered a new family of swans, living in a canal that leads through the center of town. The mother and father swans were there with their 3 cygnets, looking something about like this. The ones I saw looked a bit older and larger than those in the photo. My friends had seen the eggs earlier and we think they’re about 2-3 weeks old. I watched as the cygnets practiced diving for food. This was a very tight family, which is to be expected from swans. who are extremely loyal to each other and even mate for life.

Other waterfowl live there as well, including a graceful blue heron.

The little family really struck me and I came back after dinner to see how they were doing. Unfortunately, one of the cygnets was caught in the current of a small, man-made waterfall that drains the canal back to the Neckar river (where it originates from). The slope and current there are navigable for a larger bird, but this cygnet was having real trouble getting back up to the calm, safe part of the river. As the rest of the cygnet’s family watched helplessly, it was simultaneously crying and swimming, desperately trying to rejoin them. And it kept getting so close! The pattern was the same every time: the cygnet would swim hard enough get its feet onto some rough stone at the top of the tiny falls, and the rushing current would take it back where it was.

The cries for help were heart-wrenching but no one could help — the river was fenced off and far below all of us humans observing the drama. The parent swans were a little less helpless, but they had to simultaneously prevent the other two curious siblings from getting caught in the same current. They took turns watching the two siblings and trying to help. Sometimes one would get close enough to touch the cygnet with a beak, but they did not really find a way to push or pull. Neither tried to get behind and push. Sadly, the little swan ran out of energy after 15 minutes or so of trying and crying, and was finally swept away under a bridge into the darkness and eventually to the other side in a fast moving stream. The rest of the family was exhausted from the whole thing and went back to their nesting ground to quit the day.

The cygnet probably survived the swift journey to the Neckar, which will open up to be wide and calm. Despite how afraid it is, I can imagine that the cygnet would be impressed by the immense, still beauty relative to the little urban world it had known. But, I doubt there is any realistic chance for it to survive on its own out there. It may be able to find food, but there will be predators. I only hope Walt Disney is watching from somewhere and will make something wonderful happen. However, nature is probably a little harsher than my imagination of a happy ending. In any case, good luck out there little cygnet, you can make it if you can think like Huckleberry Finn.


How to hack your app to make contenteditable work

May 8, 2009

The mission? Build a rich text editor widget using contenteditable. Mark Pilgrim described this contenteditable use case as “alive and well on the web” with the warning that it is still “evolving”. Nevertheless, because of various problems we had using an <iframe> our group decided to switch from using designMode to contenteditable.

Note: this article has been updated several times to add up-to-date information as it becomes available. Please add your tips and tricks or any corrections as a comment.

Most of the issues are in the Mozilla editor implementation. IE and WebKit seem to work fine.

Mark’s document is an excellent resource, but now it’s time for a reality check. Here are some problems I had to work around in Firefox 3.5 beta 4:

  1. Large caret,  tiny caret, no caret, or two carets on initial focus.
    Workaround: ensure the magic sequence of <p><br/></p> as end-of-document content. Watch everything that happens to make sure it’s never changed, removed or even selected. (Bonus: this is also the fix for several other items in this issues list). Don’t let the caret go after it. If selection ends up extending past it, then just use window.selection.extend to move just before the caret. If the selection had been “collapsed” (just a caret), then set the caret before it (for example set the start before andthen  use window.selection.collapseToEnd to make the selection match).
  2. Many execCommand commands, such as bold, do not work after select all, or may have issues when the caret is at the end of content.
 Workaround: the fix for item #1 above also addresses this.
  3. The “indent” and “outdent” execCommand will actually indent the entire contenteditable region! 
Workaround: the fix for item #1 above also addresses this.
  4. Caret and selection are not restored when you tab or click out of the contenteditable area and later tab back in.
    Workaround: store selection onblur and onmouseout, and restore onfocus. Unfortunately onblur was not enough, because by the time the user has clicked outside of the editable area, the selection has already been forgotten.
  5. Double clicking on any HTML Form input in the same document as a contenteditable no longer selects a word.
    Workaround: you have to cleverly set contenteditable=”false” on all area in the document onmousedown in the inputs, and then set them back to “true” as soon as possible.
  6. You can paste the editor back into itself etc. This is arguably a feature, not a bug, since contenteditable could be used to develop web authoring tools. However, it’s something to be aware of.
    Workaround: create styles for all children in contenteditable for overflow: hidden !important. You’ll need to think about what styles to override. Remember that users can drag or paste in comment from anywhere.
  7. Can’t select text and do operations such as delete if the text includes the beginning or end of the content.
    Workaround: make sure the root editor element is a <div>. Style it how you want (e.g. display: inline), but if it’s a <span> at least, this bug will occur.

My team is still discovering some issues, but they are harder to reproduce. Sometimes the editor becomes unfocusable and it becomes impossible to do further editing. I’m not sure what gets it into this state.

There are over 70 filed contenteditable bugs, and when I am done filing there will be more. The fact that most of these bugs were not yet filed by anyone else yet seems to indicate that contenteditable just isn’t being used much out there. I can see why, and unless the issues get cleaned up, it will stay that way.

The low quality of contenteditable support is unacceptable, especially for something that shipped in a previous version of Firefox. There was plenty of time between Firefox 3 and 3.5, to circle back, gather what was learned, and fix the most important bugs. Yet, I could only find 7 behavior-related contenteditable bugs fixed since June, 2008. That means it’s mostly being allowed to exist as it is.

I would like to make an observation, after 8 years working on the Mozilla code base, and now as a developer of web applications. Please don’t read on if you are allergic to sports analogies, or if you just want to hear how great Mozilla technology is. Quality would be higher if there were one or two fewer  initiatives for the Next Great Leap, and more concentration on just fixing the old boring bugs. There are obviously a lot of big world-changing initiatives going on at Mozilla, and there should be. However, as a community we should be realistic that three point shots are awesome when they go in, but they are easy to miss. Lots of simple plays, like rebounds and layups, are still necessary. Sometimes I think that fundamental bug fixing gets lost in the drive to make news headlines. Honestly, you don’t have to go that far out on the edge to find problems. I don’t believe this is an engineering issue. I think it’s actually Mozilla’s leadership not wanting to pour resources into what seems like an endless problem where great results don’t provide immediate mind-share benefits. However, as we all know, this stuff is super complicated, and in order for the web to move forward things have to “just work”. Either Mozilla has to fix the behavioral bugs or every web developer who uses the feature has to track down what the problems are and try to find a hack for it.

P.S.  FWIW, other than selection memory, WebKit has worked perfectly so far.  That said, Mobile WebKit for the iPhone has a major issue. It doesn’t actually support contenteditable at all. Worse, it reports that it does — node.contentEditable and node.isContentEditable are true for a node with the attribute contenteditable=”true”, yet . So if you want a fallback, you have to sniff for the user agent rather than use the technique of capability detection, which is better because you never know which future version will support contenteditable.

Frank Hecker, Catalyst for the Web

February 19, 2009

It’s time to take a moment to thank and congratulate Frank Hecker, winner of the 2009 Catalyst Award, for his work to improve the lives of people with disabilities.

The Catalyst award page describes Frank perfectly:

Catalysts are elements or chemicals that can cause or accelerate reactions but do not, themselves, get used up. They are, in this case, people who make things happen by their presence and by what they do. They don’t necessarily do everything themselves, but they bring out and enable the best in the rest of us. They connect the rest of us, and facilitate our interactions so that we all can do great things. They connect us, and facilitate us so that we all can do great things.

Not only has Frank done a lot for accessibility, he’s behind a lot of the work on the open web, which we all enjoy and appreciate. Frank has helped many individuals live up to their true potential. Please see the 2009 Catalyst Award announcement page for more details on what Frank enabled, and how he did it. This award was an easy choice.

Anything is possible if you don’t care who takes the credit. Thanks again Frank, not only for teaching us that, but for all you’ve done for this community. We could use a few more people like you.

IBM, Open Accessibility and Change

January 23, 2009

Richard Schwerdtfeger, my mentor and technical lead at IBM, explains why IBM let go of myself and Pete Brunet, and what it says about IBM strategy in open accessibility going forward. Although it was done suddenly, it makes a certain amount of business sense.

To summarize what I’m reading and thinking: IBM realized that our efforts in driving WAI-ARIA and IAccessible2 forward were a success.Things are now at a point where IBM can use these technologies in products without devoting full time employees to drive them. IBM believes browser manufacturers must carry forth any further efforts necessary to make web applications accessible.

What still remains to be done? There is more work in W3C to finalize the WAI-ARIA 1.0 standard, and Rich will still be chairing that effort. There is more work to support WAI-ARIA within various JavaScript toolkits and assistive technologies such as screen readers. However, the biggest missing piece in the infrastructure now are solid, consistent, support across all browsers. Firefox support for WAI-ARIA is strong, although some advanced uses such as complex grids with expandable parts will take time to sort out. In addition, consistent support across other browsers will be elusive for some time. Hint: IE 8 betas need work, but are easily beating WebKit and Opera.

But what’s really needed now is WAI-ARIA support in popular web applications. Killer WAI-ARIA applications will drive the need for better browser support, by putting meaning behind the efforts. One would think that a killer consumer application using Dojo’s Dijit or native WAI-ARIA support would emerge, but I haven’t seen one yet (please correct me if I’m wrong). You will still hear this note of resistance when discussing the need for WAI-ARIA with developers of some browser engines. WAI-ARIA bugs in ATs and browsers are simply more likely to get fixed if real users must switch browsers in order to access their web mail, calendar or web-based office application.

The solid Firefox and AT support, and upcoming IE support, are reason enough for developers to rally behind WAI-ARIA. Web application developers, please, implement WAI-ARIA and push browser manufacturers to fix their bugs. Finally, JavaScript front-end developers — please help contribute WAI-ARIA questions and documentation to the free-aria mailing list and wiki.

So in summary, IBM is right. They really did a lot for the community in developing WAI-ARIA and IAccessible2. A major aspect of this was their support for Pete Brunet and myself. We did a great job and IBM will continue to use the results for accessibility in their products. Now, the community will bring these technologies to the next level — mostly, by embracing them.

I want to end by lauding the work Pete did with IAccessible2. Without IAccessible2, advanced web application accessibility would not be available on Windows. IAccessible2 also allows any desktop application to support full accessibility. Like myself, Pete is obviously considering opportunities — he is brunet at And hey Pete … open some champagne. Both Rich’s post and our body of work show the facts. We were profoundly successful.

Goodbye IBM

January 21, 2009

This came as shock to me today, but I was just laid off from IBM. It was not a result of performance. They tell me it was because ARIA and working with external browser vendors is no longer a priority. There is still the chance to find work for another group in IBM, and I will probably be looking into that.

I have enjoyed working there, especially on Web 2.0 accessibility and Mozilla.

But, perhaps this will be the opening of new opportunities. I’m always optimistic.

Update: Some more thoughts … I’ve never been laid off before. In fact, everyone I ever worked for was more than pleased with my output. I know that people who understood my work in IBM really appreciated it. We certainly rocked the accessibility world!

I’m not too worried right now, and I’m very open to hearing about opportunities. Mostly, I just like doing things that benefit society. It doesn’t have to be accessibility, and probably doesn’t even have to be software. Realistically, it may be difficult to be given a great opportunity to move and shake outside of software, but you never know. I do like the kind of projects that Benetech gets going. I’m fascinated in potential in Obama’s plans for using technology to better utilize the public in decision-making. I’ve had some cool ideas around that in the past, which in fact can be more general and could be quite fun to work on.

And, don’t be too surprised if I stay in accessibility or even if I find some new opportunity to work on accessibility within Big Blue itself.

If you have a challenging opportunity to run by me, please send a note to aaron at

Podcast on ARIA, JAWS, Firefox and Chatzilla

January 18, 2009

JAWS screen reader manufacturer Freedom Scientific has published their January podcast. In it, Glen Gordon describes the design of WAI-ARIA and how it improves accessibility in Web 2.0 applications.

This is followed by a number of ARIA demonstrations by Jonathan Mosen. Jonathan first shows ARIA-enabled websites with JAWS 10 + Firefox 3.04. He then demonstrates JAWS with Chatzilla, an accessible IRC client. Chatzilla is based on Mozilla’s rendering engine, utilizing XUL for the user interface, HTML for the chat log, and ARIA to enhance accessibility.  To quote Jonathan, “and thanks to all the ARIA they have enabled now in that window, chat works seamlessly with JAWS — very impressive”.

Microsoft listens, and addresses WAI-ARIA concerns

January 17, 2009

A few months ago, I blogged that Internet Explorer 8 beta 2 was not using standard syntax for WAI-ARIA properties. The syntax actually varied depending on the mode chosen for the page, which was confusing. Sometimes the standard worked, and other times you had to use non-standard camelCase for WAI-ARIA.

Microsoft has listened and is correcting WAI-ARIA property support in IE 8 RC1. Here’s a big thank you. It’s important to have a healthy portion of WAI-ARIA work the same across both browsers. Many look forward to test-driving the WAI-ARIA support in IE 8 final.