News for hackers. Stuff that matters.
Re:Edit like an Ace by simonsarris on Monday August 15, 2011 @04:56PM (#2888662)
Implementing good text controls in Canvas is a fool's errand. The spec itself warns against it:

http://www.whatwg.org/specs/web-apps/current-work/multipage/...

They wanted to be ambitious and to their credit they got very far. They gave a few talks on the hurdles they had to overcome. Measuring the height of text, making their own custom scrollbars, resizing woes, etc. They did a good job with a lot of it.

They admitted it was fun but too hard to get everything right. They ran into most of the problems in the spec: "Unlike Skywriter, Ace uses the DOM to render instead of the <canvas> element making it compatible with a wider range of browsers and potentially giving it a leg up in accessibility."

http://mozillalabs.com/skywriter/2011/01/18/mozilla-skywrite...

The code for Skywriter was actually really good. I used a lot of it to make my in-canvas scrollbars before moving on to my own code.

There are no comments on this comment yet.