W3C home > Mailing lists > Public > www-tag@w3.org > May 2012

Re: W3C discussion of CSS prefixes

From: Florian Rivoal <florianr@opera.com>
Date: Fri, 18 May 2012 18:51:47 +0200
Cc: "www-tag@w3.org" <www-tag@w3.org>
To: "Larry Masinter" <masinter@adobe.com>, "Linss, Peter" <peter.linss@hp.com>
Message-ID: <op.weijsle34p7avi@localhost.localdomain>
On Wed, 16 May 2012 06:37:45 +0200, Linss, Peter <peter.linss@hp.com>

>>> Except for the fundamental problem that it defeats the primary purpose that vendor
>>> prefixes were invented for in the first place, namely, pollution of the core CSS namespace
>>> by browser implementers outside the standards process.
> The term "pollution" in this context is referring to the days before we had vendor prefixes in CSS. In those days browser implementers (myself included) would simply add new properties, values and units to their CSS implementations. There was no distinction between an identifier that was part of the standard and one an implementer simply made up themselves, often in a vacuum. Sometimes to solve a genuine problem, other times because they simply thought it was a good idea.
> Some of those identifiers were in shipped products and authors wrote content for them (and/or tools also generated content for them). Now, some 13 years later or so, we still have a few properties in CSS that were eventually added by the WG, not by design, but simply because there was too much existing content that relied on them. Some of these have confusing names and behaviors because they weren't thought out properly and didn't benefit from peer review and all the other goodness of the standards process. The 'word-wrap' property is an example.
> Once the vendor prefix was instituted, the only identifiers that look like CSS identifiers are those sanctioned by the CSS working group (except for the legacy exceptions).

Unfortunately, I don't think the current policy actually succeeds at
preventing pollution. For two reasons:

1) Authors actually use the prefixed properties, and we can (and have)
end up with fairly large amounts of content using a prefixed syntax.
A large part of this content uses the prefixed syntax of a single
vendor (the one who introduced it first), without fallback.

This has happened with -webkit- prefixed properties, to the point
where webkit vendors have decided they would never drop support
for the prefixed syntax of some properties.

As you said, we may never be rid of text-wrap, even if we
introduce a better name side by side. But with prefixes,
we may never be rid of display:-webkit-box, or -webkit-gradient,
or -webkit-border-radius. I don't like these names any better.

Yes, these names can easily be identified as special, but as long
as we are stuck with them (and I think we are), that does not make
me feel any better about them.

2) Another large group of authors, when using prefixed properties,
do add a fallback to the unprefixed property, even when the specification
isn't final. As they do so, a lot of content accumulates using that
even if no browser implements it unprefixed.

All that content means that even if we later decide to change the name of
the property, the original name has been polluted, and we can't use
it for something else without precautions.

> Florian's proposal removes the ability of the WG to use experimental implementations for what they were intended for, to learn what works and what doesn't, and then make changes as needed.
> For the simplest gradient, instead of:
>  background-image: linear-gradient(to bottom, black, white);
> we would have been stuck with:
>  background-image: gradient(linear, left top, left bottom, color-stop(0, black), color-stop(1.0, white));

Not at all. Under my proposal, we could still have made the changes we
made. Once the "linear-gradient(" syntax had been proposed, nothing would
have prevented webkit to implement it side by side with the
"gradient(linear..." syntax. They supported both syntaxes under a prefix,
they could have supported both syntaxes without a prefix.

Today, there is enough content using the "-webkit-gradient(linear..."
syntax that webkit vendors have decided to never drop it, and other
vendors are considering supporting it was well in addition to the standard

Actually, I think there are chances that we would be less stuck with
'gradient' than we are with '-webkit-gradient'. Today, a fair amount of
authors write the following:

background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, black), color-stop(1.0, white));
background-image: -moz-linear-gradient(to bottom, black, white);
background-image: -ms-linear-gradient(to bottom, black, white);

Notice that they don't include -webkit-linear-gradient, since they already
provide something that works under webkit. They also don't always provide
unprefixed linear-gradient. This reinforces Apple and Google's position
that they can never drop the -webkit-gradient syntax.

With my proposal, authors could have written this:

background-image: gradient(linear, left top, left bottom, color-stop(0, black), color-stop(1.0, white));
background-image: linear-gradient(to bottom, black, white);

Under that scenario, Apple and Google *can* drop the gradient syntax,
since the linear-gradient syntax also applies to them. Maybe they still
wouldn't, due to sites that only use the first syntax without any fall
back, but their case would be weakened.

If you look at properties for which we have not changed the name, the
current prefixing policy actually causes more pollution. Because a non
negligible number of authors
have written (and continue to write) -webkit-border-radius withouth
fallback to border-radius, webkit will support the -webkit-border-syntax
forever, and others vendors may feel they have to as well. With the
proposal I defend, this would not happen.

> The consequence is that the author's web page is fragile and will break (or at least fail to render as it once did) at some point in the future when the browser vendor who's prefixes they relied on remove the support for the prefixed version. Mozilla has been pretty good about deprecating support for prefixed properties once the feature is standardized, Microsoft as well to some extent. Apple tends to support the prefixes for way too long to prevent content breakage. This has led to many authors feeling that they can rely on the prefixed property forever.

Apple and Google don't merely keep them for way too long, they publicly
stated they would never drop some properties.

There is no direct benefit for Apple and Google to drop their prefixes,
and some benefit in keeping them: don't break sites that used to work,
make life harder for the competition.

As far as I know, Opera has been the best at dropping prefixed properties
when we introduce the unprefixed ones, as we do it instantly, while even
Mozilla keeps them for quite a while. That hasn't shielded us from the
pain caused by other vendors or authors behaving poorly.

A policy that harms most strongly those who follow it best is in my mind
a bad policy.

> Authors using experimental features also (IMO at least) have an obligation to update their content once the standard equivalent is available, or accept that their page will break.

Authors ought to update their sites, but they don't. And when they don't,
they don't suffer from it. Users of other browsers (and by consequence,
other browser vendors) do. Authors use the simplest thing available
to them to provide their clients with the features they want on the
browsers targeted, and we can't really expect them to behave

> I won't argue that there are issues with vendor prefixes, we all agree there. But I don't like using the term 'failure' when describing them. Fundamentally, they were an overwhelming success. They did what they were designed to do, protect the CSS language. Please let's not lose sight of that.

CSS as a language is successful, and we have a prefixing policy. I am
far from sure that the former is a consequence of the later.CSS might
very well be successful despite prefixing.

The CSS working group is successful because you and Daniel have done
a great job of making it a space where fruitful discussions can happen,
and because vendors are interested in cooperating. Both these points
remain true with or without prefixes, and prefixes would not save
us if vendors did not want to cooperate, or had no good space to do so.

> We do manage extensibility in that there is a mechanism in place to add features to CSS that don't conflict with the standard or other vendor's extensions. There is a process in place to add those extended features to the standard. The CSS language has forward-compatible parsing rules and fallbacks to allow author experimentation with non-standard features in such a way as to maintain compatibility with standards compliant browsers.

The forward compatible parsing rules and fallbacks of CSS give us the
flexibility we need to experiment, without having to involve prefixes.

Due to prefixes as we currently use them, even successful experiments
(whether successful on first try or after heavy modification) need to
be migrated away from prefixes, onto the standard syntax, and this is
proving painful.

  - Florian
Received on Friday, 18 May 2012 16:52:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:56:45 UTC