为什么浏览器厂商要制作自己的 CSS 属性?

发布于 2024-08-24 14:31:13 字数 428 浏览 4 评论 0原文

  • 为什么浏览器厂商要开发自己的浏览器 css 属性,即使他们知道这些属性 在w3c批准并添加之前不会通过w3c验证吗?
  • 目的是什么?是为了自己 测试,或用于网络开发人员,或 展示浏览器功能 致全世界和 W3C 组织 以及 W3C 的 CSS 开发团队?
  • 它像测试版吗 示范?
  • 如果我现在使用任何特定的浏览器 他们可以删除该财产吗 未来版本的支持。将来我是否必须编辑我的 css

例如:

https://developer .mozilla.org/en/CSS_Reference/Mozilla_Extensions

  • Why do browser vendors make their own
    css properties, even they know these properties
    will not pass the w3c validation before approved and added by w3c?
  • What is the purpose? Is for their own
    testing, or for web developers, or to
    demonstrate browser capabilities
    to the world and to the W3C organizations
    and to CSS development team of W3C?
  • is it like a beta version of
    demonstration?
  • if i use any browser specific for now
    can they remove that property's
    support from future versions.will i have to edit my css in future

For example:

https://developer.mozilla.org/en/CSS_Reference/Mozilla_Extensions

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

尾戒 2024-08-31 14:31:13
  • 负责任的浏览器供应商(大型浏览器供应商,不包括 IE)知道几年后网络会是什么样子。我不知道你从哪里得到“未通过”部分。他们只实现浏览器在几年内将支持的东西。
  • 这是为了提供为现代和未来的浏览器设计网络的工具。
  • 是的,我们可以说这是一个测试版。
  • 是的,也不是,他们不太可能取消对扩展部分的支持。

W3C 正在考虑的是语法。让我们以梯度为例:

-webkit-gradient(
    linear,
    left bottom,
    left top,
    color-stop(0.2, rgb(86,45,199)),
    color-stop(0.6, rgb(112,72,239))
)
-moz-linear-gradient(
    center bottom,
    rgb(86,45,199) 20%,
    rgb(112,72,239) 60%
)

这两个代码生成相同的梯度。正如您所看到的,没有标准的过程,对于基于 webkit 和 mozilla 的浏览器来说,语法既令人困惑又不同。

但让我们想象一下,两三年后,实施就完成了。现在您只需为标准添加另一行代码即可。

gradient: center bottom #colorFrom opacityFrom #colorTo opacityTo;

现在两个引擎都会理解梯度语句,如果它是在扩展语句之后指定的,那么最后一个将是要解释的。

  • Responsible browser vendors (the big ones, excluding IE), know what the web will look a few years later. I don't know where you get the "not pass" part. They only implement things the browsers will support in a few years
  • It's about giving the tools to design the web for modern and future browsers.
  • Yeah, we can say it's a beta.
  • Yes and no, it's unlikely they will remove support for the extensions part.

What the W3C is thinking about is the syntaxis. Let's take gradient for an example:

-webkit-gradient(
    linear,
    left bottom,
    left top,
    color-stop(0.2, rgb(86,45,199)),
    color-stop(0.6, rgb(112,72,239))
)
-moz-linear-gradient(
    center bottom,
    rgb(86,45,199) 20%,
    rgb(112,72,239) 60%
)

Both these codes generate the same gradient. As you can see, there's no standard procedure, the syntaxis is both confusing and different for webkit and mozilla based browsers.

But let's imagine in two or three years, the implementation is done. Now you just have to add another line of code for the standard.

gradient: center bottom #colorFrom opacityFrom #colorTo opacityTo;

Now both engines will understand the gradient statment and if it's specified after the extension ones, this last one will be the one to interpret.

残月升风 2024-08-31 14:31:13

标准流程不会这样运行:

  1. 规范已编写
  2. 浏览器实现规范
  3. 一切都是小马和彩虹

就像任何 IT 项目一样,规范已编写,然后实现了其中的一些部分,然后更改了规范基于实施过程中吸取的经验教训。正如罗伯特·奥卡拉汉所说,这是一种微妙的舞蹈。

使用供应商前缀进行初始实现意味着,如果稍后更改规范,针对现有实现编写的现有代码不会中断。

供应商前缀还允许浏览器制造商进行尝试,这可能会产生非常好的结果,例如 Safari 的渐变。

The standards process doesn’t run like this:

  1. Spec is written
  2. Browsers implement spec
  3. Everything is ponies and rainbows

Like any IT project, the spec is written, then bits of it are implemented, then the spec is changed based on lessons learned during implementation. It’s a delicate dance, as Robert O’Callahan said.

Doing initial implementations with vendor prefixes means that if the spec is changed later, existing code written against the existing implementations won’t break.

Vendor prefixes also allow browser-makers to experiment just for the heck of it, which can result is quite nice things like Safari’s gradients.

白馒头 2024-08-31 14:31:13

它们大多是正在进行中的,例如 css2->css3,但由于浏览器尚不支持它(如 css3),因此它以不同的名称公开。

they are mostly work-in-progress from for example css2->css3, but since a browser doesn't yet support it (like css3), it is exposed with different names.

对风讲故事 2024-08-31 14:31:13

他们这样做有几个原因:

  1. 正如您所说,展示独特的浏览器功能
  2. 公开某些浏览器行为 - 将这些属性视为 API
  3. 创建粘性 - 一旦您有大量依赖专有属性的代码,您就会被“束缚”到浏览器。

是的,遗憾的是这些属性可能会在未来的版本中发生变化甚至消失,从而需要更改代码。底线:坚持标准,或者至少要意识到当前任何闪亮的功能都有未来的价格。

They do it for several reasons:

  1. As you've said, demonstrate unique browser capabilities
  2. Expose certain browser behaviors - think of those properties as an API
  3. Create stickiness - once you have a lot of code relying on proprietary properties, you're "bound" to the browser.

And yes, sadly those properties may change or even disappear in future versions, necessitating code changes. Bottom line: stick to standards, or at least be aware that any current shiny feature has a future price.

丢了幸福的猪 2024-08-31 14:31:13

mozilla 的扩展很可能会出现在下一个 css 标准中,只是为了领先一步。当这些属性成为标准时,使用它们时不带 moz 前缀,以便支持多个浏览器。

mozilla has extensions which are likely to be in the next css standard just to be one step ahead. when these properties will be standard, use them without the moz prefix, in order to support more than just one browser.

智商已欠费 2024-08-31 14:31:13

我不了解CSS标准演变的具体情况,可以猜测以下是制造商“跳出标准”的主要原因。

  • 标准起草是一个漫长而缓慢的过程(通常有充分的理由),在快速变化、激烈的竞争环境中,这种速度并不令人满意。
  • 有时,这是展示潜在新功能的一种方式,目的是确认其有效性或迫使标准化机构追溯性地纳入它们。

虽然有效地规避了既定的标准化流程,但上述驱动因素可能是善意的并且考虑到更大的利益。不幸的是,还有一些不那么高尚的原因:

  • 对于拥有大量市场的制造商来说,这提供了使产品在一定程度上兼容但具有额外功能的机会,然后这些功能可以用来为用户带来困难和/或开发人员进行切换(因此既确保了用户的忠诚度,又可能为其他用户尝试他们的产品提供激励,从而进一步增加他们的市场份额。)
  • 对于市场地位较弱的制造商来说,这可以是做同样事情的一种方式。由于这些制造商认为严格遵守标准几乎无法赢得(或节省),因此他们试图发明一项新功能并以此为主导。

I'm not privy to the specifics of the CSS standards evolution, one can guess that following are the main reasons for manufacturers to "draw outside of the lines" of the standards.

  • Standard drafting is a long, slow process (often for good reasons), and this pace is not satisfactory in a fast changing, heated competitive environment.
  • Sometimes this is a way to showcase potential new features, for the purpose of either confirming their validity or of pressuring the standardization body to include them retro-actively.

While effectively circumventing the established standardization process, the above drivers are probably well meaning and mindful of the greater good. There are unfortunately less noble reasons:

  • For the manufacturers who have a critical mass of the market, this provides the opportunity of making the product somewhat compliant but with extra features, and such features can then be used as a way to make it difficult for users and/or developpers to switch (hence both ensure user fidelity and possibly providing incentives for other users to try their product, hence further increasing their market share.)
  • For manufacturers with a weak market position, this can be a way of doing the same. As such manufactuers feel they have but little to win (or to save) by sticking strictly with the standard, they attempt to invent a new feature and lead with it.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文