The open source WebKit project has announced that it intends to replace vendor prefixes for experimental CSS properties with a runtime flag. Developers rely on vendor prefixes to experiment with — and often to use in production — CSS features that have yet to be finalized.
Vendor prefixes were introduced because the web platform needs both stability and the ability to evolve. Standards bodies are constantly working on new CSS features, and those features need to be tested by browser developers and web developers. As the standards develop, different browsers implement them at different times with different interpretations of the specification. Prefixes allow browser developers to implement experimental features without exposing web developers to a constantly changing set of standards.
The system works for the most part, but it also introduces problems. Web developers need to know which prefixes to use for each browser. And, if they use a lot of experimental features, their style sheets become ever more bloated and difficult to maintain.
Web developers have created tools that make dealing with vendor prefixes a little easier, including AutoPrefixer and related tools that will automatically insert the relevant prefixes.
But web developers aren’t the only ones inconvenienced by vendor prefixes.
Ideally, when new features are finalized, browser developers should be free to discontinue the experimental prefixed version, but in reality, that’s not proven as easy as it should be. Many sites depend on the vendor prefixed version and would break if it was retired. To maintain backwards compatibility, browser developers are forced to keep the prefixes long after they’ve fulfilled their original purpose. In some cases, browser vendors have been forced to adopt the prefixes of competing browsers to maintain compatibility with the web.
Vendor prefixes aren’t a good solution to the problem of testing experimental features. WebKit intends to move away from vendor prefixes and implement experimental features behind a runtime flag. Browsers with the flag enabled will be able to use experimental features, allowing developers to test them. The flags may be activated by default in experimental browser versions like the Safari Technology Preview.
Whereas with vendor prefixes, developers could rely on users’ browsers supporting experimental features — sites like Can I Use provide a database of what is implemented in each browser — runtime flags are different. Web developers can’t assume that a specific browser has the necessary flags, and they won’t be able to rely on experimental features in production (something that’s more common than it should be with vendor prefixes).
There’s no need for web developers to panic just yet. Prefixes will continue to work for the time being, but WebKit’s developers, at least, intend to start removing vendor prefix support for CSS features on a case-by-case basis over time.