为什么到处都没有使用CSS3 PIE和其他类似脚本? [英] Why are CSS3 PIE and other similar scripts not in use everywhere?

查看:91
本文介绍了为什么到处都没有使用CSS3 PIE和其他类似脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题已经在 htc文件中提出:为什么不使用它们?,但是答案并没有真正回答任何问题.

This question has already been asked at htc files: Why not to use them?, but the answer didn't answer anything really.

问题是,为什么会出现 CSS3 PIE 之类的东西? 在许多网站上都没有使用?我希望较小的人不知道它,但是引起我注意的人是不使用它的Twitter.

The question is, why is something like CSS3 PIE not in use on many sites? I'd expect smaller ones to not know about it, but the one that caught my eye was Twitter, who doesn't use it.

是因为它不标准吗?还是会导致网站速度明显下降?

Is it because it's not standard? Or does it cause a noticeable slow-down of the site?

谢谢您的答复.

推荐答案

我不能为所有人说话,但我的感觉是,您不会在大型网站上看到使用此类工具的原因,

I can't speak for everyone, but my sense is that you don't see tools like these in use on large sites because:

1)它们确实会产生一定的性能成本.特别是CSS3 PIE在使用了大约二十个元素(根据我的经验,YMMV)后开始产生明显的渲染延迟.因此,在较大的页面上使用CSS3 PIE可能导致比下载图像资产节省的时间更长的渲染延迟.

1) They do incur a certain performance cost. CSS3 PIE in particular starts to create a noticeable rendering delay after use on about two dozen elements (in my experience, YMMV.) For that reason its use on large pages might cause a larger rendering delay than the time saved downloading image assets.

2)他们开始显示具有复杂DOM更改的错误.大量的动画,显示/隐藏等操作有时会导致PIE不同步.

2) They start to show bugs with complex DOM changes. Lots of animation, showing/hiding, etc. can sometimes cause PIE to get out of sync.

3)与#2相关,增加的抽象层(及其相关的错误)可能会对具有复杂代码库的大型开发团队造成不利影响.如果您开始花费更多的时间调试抽象,而不是简单地创建圆角图像,那么该工具将为您带来麻烦.

3) Related to #2, the added layer of abstraction (and its associated bugs) can become a detriment on large development teams with a complex codebase. If you start spending more time debugging the abstraction than it would take to simply create rounded corner images, then the tool is getting in the way.

我在这里专门讲CSS3 PIE,因为它对我很亲近(我是它的创建者),但是类似的警告适用于Selectivizr等其他polyfills.这适用于任何工具:您始终必须评估您的特定需求的利弊.例如,出于上述原因,我不建议将PIE用于像Twitter这样的高流量,性能至关重要,高度互动的网站,但它确实适用于更简单,更静态的设计.

I'm speaking specifically about CSS3 PIE here because it's near and dear to me (I'm its creator), but similar caveats apply to other polyfills like Selectivizr. This goes for any tool: you always have to evaluate the pros/cons for your specific needs. For example I wouldn't recommend PIE for a high-traffic, performance-critical, highly interactive site like Twitter for the reasons stated above, but it really shines on simpler more static designs.

...另一种想法是,在很多情况下,简单地让IE降级到直角等是完全有效的.如果您的特定情况允许,这始终是IMO的首选方法.因此,在这种情况下,并不是由于对该工具进行了任何评估,而是仅根本不需要首先确定该工具提供了什么. :)

...Another thought is that it's perfectly valid in many cases to simply let IE degrade to square corners etc. This is always the preferred approach IMO, if possible given your particular situation. So in that case it's not due to any evaluation of the tool, but just a decision that what the tool provides is simply not needed in the first place. :)

这篇关于为什么到处都没有使用CSS3 PIE和其他类似脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆