接頭辞外しと-webkit-サポート

もう書くのだるいんだけど、またまたベンダー接頭辞的なおはなし。

Opera 12.50では標準と-webkit-のみ (-o-さよなら)

今月に入って、Opera 12.50で使われるPrestoのバージョンが2.12になった。

まず3日のsnapshotでは、接頭辞なしのTransitions, 2D Transforms, Animationsのサポートが行われ、さらに接頭辞付きの実装が削除された。

続いて10日のsnapshotで、接頭辞なしのグラデーションもサポートされ、3日のと同じように接頭辞付きの実装が削除された。

つまり、12.50からは、-o-fooなコードは単に無視されることになる。

-o-のサポートを消した理由は、standards compliance的なところもあるんだろうけれど、Opera 12.50で-webkit-なものをエイリアスとしてサポートするのが大きいんだろう。-o-を書いてるなら-webkit-も書かれてるってことなのか、-o-なコードはあまりなくて、-webkit-のサポートのが互換性が高いってことだったんだろうか。嗚呼デファクト標準。

Firefox-webkit-サポートは?

-webkit-を(消極的にだけど)サポートしないとと考えているのはOperaだけではなく、MozillaもMicrosoftもそうなはず。ではこの2つはどうなったのか。

Mozillaについては、ちょっと前にMozillaのLawrence MandelがWebKitとの互換性について触れている。

13日の時点では、-webkit-な機能にエイリアスを張るかまだ決定していないと。その次にこう書いてある。

As our current research has shown, the problems with the mobile Web extend beyond CSS prefixing to user agent sniffing and Webkit specific functionality. It is unclear that aliasing Webkit CSS prefixes in Firefox will provide much benefit to mobile Web compatibility.

モバイルWebの問題はCSSだけではなく、UA SniffingWebKitの独自拡張にも及んでおり、CSSエイリアスがどれだけ意味を成すかがわからないと。

で、その翌週。

After our initial discussion last week, David Baron created a build of Firefox for Android that includes a number of Webkit CSS property aliases. John Jensen put together a short list of sites to test based on market analysis and top site data and Aaron Train and Jason Smith got to work testing these sites using David’s build to see what impact, if any, aliasing CSS properties has on site compatibility. [...]

The partial test results show that the experience of the majority of the sites in this set did not improve by adding Webkit CSS aliases. In one case the experience of the site was actually worse after adding the aliases. There are a couple of notable exceptions where the experience did significantly improve. In both of these cases the sites make heavy use of animations and transformations. Our next step is to investigate more sites that make heavy use of these two categories of CSS properties to see if the impact is more notable on this category of sites. We plan to review the new test results at the end of this week.

-webkit-をサポートした実験的なビルドでいくつかのサイトをテストしたところ、互換性が向上したサイトはあまりなかった。それどころか逆に下がるところもあったと。

もちろん、互換性が上がったところもあって、そういうサイトはAnimations, Transformsを使っているところだったと。これら2つの互換性に対する影響はどれくらいなのかというのは、またこれから調査するらしい。

互換性が逆に下がったというのが面白い。なんだろう。Firefoxはけっこうなシェアがあるから、-mozも一定割合書かれていて、それが継承や上書きで悪影響を及ぼしたんだろうか。Animationsなどのコードで互換性が上がったのは、@-webkit-keyframesに加えて@-moz-keyframesなんて書いてらんないから数が少なくて、ってことかなあ。

IEはどうなるんだろう

今回の接頭辞削除のきっかけになった、IE10でのunprefixing。強引ではあったけど、他のベンダーも追従して、リリーズ時期もいい具合に重なりそうで、よさげな感じになっている。

さて、MicrosoftはIEで-webkit-エイリアスを設けるんだろうか。接頭辞に関してはほぼ無視されてるであろうIEだから、-webkit-を解釈すると互換性は上がりそうな気がするけれど、素直に実装するかというと、違うかなあと。

あくまで予想だけれど、互換表示リストを使うんじゃないか。せっかくそういう仕組みがあるし、ドメインやパス単位で細かいカスタマイズも可能だから、エンジン側でどんな時でも-webkit-を-ms-にマップさせるのではなく、互換表示リストに指定されたサイトのみ-webkit-なコードを解釈させるというのは十分に考えられるかなと。Windows 8のRTMが配布され始めたら、もっと何かわかるかな。

追記 (2012-08-16): Firefoxエイリアスの方針

Twitterでの言及で、Mozillaの該当バグを教えてもらう。ありがとうございます。

ざっと読むと、2つの方針があるようだ。

  • すべての-webkit-な機能をサポートするわけではない
  • Mozillaで接頭辞なしの実装が行われてから、エイリアスを張るか検討する

前者については前からそうだった気がする。後者については、やることやってからにしようってところか。

ただ、何の機能についてエイリアスを張るかなどについては言及なし。

追記 (2012-08-19): FirefoxWebKit互換性調査、仮報告

Lawrenceが新しいエントリを起こしていた。

曰く、現時点では-webkit-エイリアスとしてマップしてもあまり益にはならないと。なんと。

ただ、これは「CSSのみをマップしても」ということらしい。

The results thus far indicate that there is a very small benefit of adding Webkit CSS aliases to Gecko. However, our research is not yet complete, so we will refrain from making any definitive decisions until all our research has been carried out.

The consensus from dbaron, jet, jsmith, tchung, aaronmt, jjensen, and me is that the value of aliasing Webkit CSS properties in Gecko alone appears to be pretty low and the benefit does not warrant its inclusion in the platform at this time.

Lawrenceのニュースグループへの投稿にもう少し詳しい事やデータが書いてある。今回のテストではUA SniffingとAliasingをしたけれど、それだけではあまり効果は見込めず、DOMのaliasingやGeckoで未サポートの機能を含めた調査が必要と。

ちょっと意外だった。どうなんだろう。Firefoxについてはそこまで無視されてないってことなんだろうか。ふうむ。