Flow browser passes the Acid tests

The three Acid tests have a long history; they really started the push for browser compatibility that is now driven by the Web Platform Tests project. Having finished Flow’s support for full Google Mail, Acid3 seemed like another interesting target.

Gecko, Webkit and Blink (and, not forgetting, Presto, Trident and EdgeHTML) have obviously passed these three tests for years, but they still are very useful stress-tests for new browser engines. For us, passing the original Acid1 test was useful early on to demonstrate to ourselves that our proof of concept layout code was taking the right approach. Acid2 was much trickier and took a lot longer, but it was a useful milestone for our layout engine. Acid3 focuses more on JavaScript APIs than layout, although it is equally challenging to pass.

A quick note about the score: Acid3 dates back to 2008 and the web platform specs have changed over time so a perfect score, using the version hosted on acidtests.org, is now only 97/100. The version hosted on the web platform tests site has been updated to match the specs and so, using that, browsers should score 100/100. Similarly, on all browsers, Acid2 on a retina screen renders slightly differently, so the image above was taken on a non-retina display.

Acid3 comprises a number of subtests. When fixing a failing subtest, we took the approach of trying to pass all the Web Platform Tests it covers, though that was not always possible as some tests require unrelated features. Acid3 stress tests corner cases for a range of features and APIs, but isn’t very broad with its testing. We could have been cheeky and just implemented the specific features needed to pass each subtest, which would have meant we could have passed a long time ago, but that wouldn’t really help us in the long run.

A number of the subtests were for Range which we hadn’t implemented, HTML forms where our API was minimal, and the CSS Object Model (CSSOM) which we had essentially no support for.

We also had many bugs to fix – a few asserts, a redraw problem where the score was only displayed after resizing the window, our support for CSS pseudos like :nth-of-type() was buggy, and we didn’t follow the HTMLObjectElement’s fallback rules correctly.

Our goal for Flow is to render websites correctly the first time that anyone tries them. Most of the Acid3 subtests are going to make a real difference. In particular, implementing the CSSOM caused a massive reduction in unhandled JavaScript exceptions reported by our nightly web crawling based testing. Most of those websites, understandably, assume that APIs dating from the 1990s are implemented, and don’t fail gracefully if they are missing.

It feels like quite an achievement in making Acid3 pass. No new browser engine has managed this since its creation over 12 years ago. Many fell by the wayside reflecting the complexity of the Acid tests. We are still implementing APIs so Flow will behave perfectly on more and more websites, and each milestone like this helps with its compatibility goals.

If you’d like to automatically receive our posts by email please join our mailing list.