Web Platform Tidbits #2

I should think of a better name for these posts.

DirectWrite coming to Chrome

One of the most longstanding complaints about Chrome on Windows is the poor quality with which it renders some fonts in comparison with Internet Explorer and Firefox. The reason is that the latter browsers use Window’s newer DirectWrite API to render text, whereas Chrome still uses the older GDI+ API. Apparently, Chrome’s sandbox architecture made it harder for them to use DirectWrite than for other browsers, and while Google engineers said they were aware of the problem and working on it, not much visible progress seemed to happen for a long time. In the meantime, many developers have taken to using hacks, such as the application of a semi-transparent CSS text-stroke, or forcing the use of SVG fonts, in order to reduce the jagginess of the displayed text.

Well, it’s not definite yet, but it looks like a real fix might be soon on its way. Google promised as much during their I/O conference, and in the past month this meta bug in the Chromium tracker has seen a lot of acitivity and blocking bugs closed. The meta bug, to switch the Windows font code from GDI to Skia, is apparently a prerequisite to turning on the DirectWrite backend. Fingers crossed we’re about to see this switch completed and landed in Chrome soon.

Custom at-rules in CSS

Recent talk about the “extensible web” got me thinking about some ideas I’d like to polyfill in CSS, particularly new declarative syntaxes for animations and state machines. To that end, I’ve posted a suggestion to the W3C’s www-style mailing list suggesting a new API for authors (e.g. web developers) to register custom JavaScript handlers for processing “var-” prefixed at-rules that the CSS parser comes across. The idea is that polyfills and libraries could then register at-rule handlers that process declarations. This would let people using those polyfills and libraries put the declarative configuration within CSS. I think it’s a good idea, but it remains to be seen if it gets a positive reception (or any reception at all, a lot of ideas posted to www-style sink without a trace, particularly if they’re not from W3C member employees).

I’ll try and post a more detailed explanation with examples when I get a chance.

Internet Explorer 11 Preview

Microsoft released a preview of IE11, as part of Windows 8.1. I don’t have Windows 8, or space to run a VM right now, so I haven’t tried it, but David Storey has posted a great round-up of all the new features. The four that caught my eye are WebGL (the big one), Fullscreen API, Web Crypto, and Mutation Observers, but there’s quite a few others. In all, it’s not a bad improvement for ten months work.

Unfortunately, as I expected nothing from Web Components is in there. I was hoping HTML templates might sneak in, as the spec is co-edited by Microsoft, but given it’s still a working draft that was never very likely.