- 浏览: 952238 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
sscsacdsadcsd:
mike8625 写道react还要自己的一些标签 还得编译 ...
对于React体系的一点想法 -
mike8625:
说的都是给大公司听的,国内很多还是小公司,做个小项目, 说实话 ...
关于国内前端和JS技术发展的乱想 -
mike8625:
react还要自己的一些标签 还得编译 编译吧浏览器端说还慢 ...
对于React体系的一点想法 -
u012814086:
下意识想到了Golang
JavaScript语句后应该加分号么? -
xueduanyang:
我是水羊,年轻的时候觉得只要有好斧子就能做成好产品,各种产品都 ...
关于国内前端和JS技术发展的乱想
本文译自Maciej Stachowiak在webkit团队blog上的文章Versioning, Compatibility and Standards。本文可作为分歧巨大的“HTML的版本问题”的背景材料,对此问题的探讨也请移驾此处讨论。注意,【】中的内容为我所加的注。
Versioning, Compatibility and Standards
版本、兼容性以及标准
Posted by Maciej Stachowiak on Tuesday, January 22nd, 2008 at 11:51 pm
Maciej Stachowiak发表于2008年1月22日星期二
The new IE8 version targeting switch, announced on IEBlog and A List Apart, has been the talk of the web. Some web standards experts, like Eric Meyer and Jeffrey Zeldman see the switch in a positive light. Others, including Dean Edwards, Robert O’Callahan and Anne van Kesteren think the proposal is a bad idea.
IEBlog和A List Apart上声明了新的IE8的版本目标切换特性(version targeting switch),这成为了最近谈论的焦点。一些web标准专家,如Eric Meyer和Jeffrey Zeldman对这种切换特性给予了正面评价,而其他人,包括Dean Edwards、Robert O'Callahan和Anne van Kesteren,则认为这一提案是个糟糕的主意。
We don’t talk much about what other browsers are doing on this blog. While we’re happy to collaborate on web standards and testing, and sometimes share a little friendly rivalry, we try to keep our focus on making the best Web browser engine we can, not on the competition. So we’re not going to give in-depth commentary on the IE team’s decision. Straddling compatibility and Web standards is a tough job requiring tough choices.
在本blog【webkit的官方blog】上我们不会去讨论其他浏览器的所作所为。尽管我们很高兴在Web标准和测试方面进行合作,有时还参与一点友好的竞争,但我们希望把关注点集中于如何尽我所能创造最好的Web浏览器引擎,而不是竞赛上。所以我们不会对IE团队的决定多嘴多舌。平衡兼容性和Web标准总是一项艰难的工作,需要做出艰难的选择。
However, some have asked if other browser engines, including WebKit, would adopt a similar version switch. For example, the original announcement asks, “I, for one, hope other browser vendors join Microsoft in implementing this functionality.” I can’t make any definitive statement for all time, but such an approach does not seem like a good idea to us currently. Why, you may ask? There are a few reasons.
然而,有人问其他浏览器引擎,包括WebKit,是否能引入类似的版本切换机制。比如,最初声明中提到,“我本人,希望其它浏览器厂商也能和微软一起,实现该特性。”我并不能做出权威声明,但是可以说,这一想法对我们目前来说并不是一个好主意。
Mode Switches in WebKit
WebKit中的模式切换
WebKit, like most browser engines, has a quirks mode that is triggered by certain old HTML doctypes, or lack of a doctype declaration in text/html. Documents with newer or unknown doctypes, or sent as XML, are processed in standards mode. Like Mozilla and Opera, we apply only a limited set of nonstandard behaviors in quirks mode, and otherwise fix bugs across both modes, if they do not have a specific significant impact on Web compatibility. This is in contrast to the IE approach of completely freezing old behavior in quirks mode.
WebKit,正如大多数浏览器引擎一样,具有怪癖模式,可由特定的老的HTML doctype或者在text/html下不写doctype声明来触发。文档如果使用新的或者未知的doctype,或者作为XML传送,则会按标准模式处理。像Mozilla和Opera一样,我们在怪癖模式下引入的非标准的行为是相当有限的;其他那些bug,如果对于Web兼容性没有特别重大的影响,则在所有模式下都会被修复。这与IE的方式截然相反,IE的方式是在怪癖模式中完全沿袭旧的行为。
We actually have a few modes besides that. A handful of doctypes trigger what is called “almost standards mode”, which is standards mode with one minor deviation, mainly affecting how images lay out in table cells; this is copied from Mozilla. In addition, we have a few rendering and DOM differences between documents served with an XML MIME type and those served with an HTML MIME type, but we are trying to reduce these over time. And finally, we have a Dashboard compatibility mode that has a few extra quirks beyond quirks mode, to handle Dashboard widgets that were coded to depend on old WebKit bugs.
我们其实还有一些其他的模式。有一些doctype会触发所谓“几乎标准模式”,也就是标准模式附带一个小例外,主要是影响图像在表格单元中的布局方式【即在单元格中的图像会紧贴边界,而不会因默认的baseline对齐方式留下空白】;这一方式是从Mozilla照搬来的。此外,文档按照XML MIME类型传输或HTML MIME类型传输,在呈现效果和DOM模型上还有少许不同之处,但是我们试图逐渐消除这些不同。最后,我们还有一个Dashboard兼容模式,它在怪癖模式之外还有一些额外的怪癖,以满足一些Dashboard微件(widget)的需求,它们的代码依赖某些旧的WebKit的bug。
Maintainability
可维护性
As you can see, this is quite a few modes already. Having lots of modes raises a number of challenges for maintaining the engine.
如你所见,我们已经有好些不同的模式了。这对于引擎的维护来说是很大的挑战。
First, the more different modes there are, the harder it is to fully test the engine. We have an aggressive approach to automated testing, and our layout tests often find critical problems before they are shipped or even checked in. Having more modes means many things need to be tested in multiple modes. So that’s more tests, more time for developers to run the test suite, and more chances of missing code coverage, especially when different modes interact.
首先,模式越多,越难以对引擎进行全面测试。我们采用积极的自动测试方式,通过我们的布局测试,那些严重的问题一般总能在正式发布甚至签入代码库之前就被发现。更多的模式意味着有许多事情需要在多个模式中进行测试。也就是要写更多的测试,开发者要花更多的时间来运行测试套件,并且更有可能达不到代码的测试覆盖度,特别是当不同模式相互作用时。
Second, implementing mode switches hurts hackability of the code. Hackability is one of our core project goals. It’s part of the reason new contributors can dive in quickly, and enables us to rapidly develop new features, while improving performance, stability, and security.
其次,实现模式切换会损害代码的hackability。hackability是我们这个项目的核心目标之一。新的贡献者之所以能快速切入,hackability是很重要的一点,它让我们在改进性能、稳定性和安全的同时,也能快速开发新的特性。
There’s two plausible ways to add more modes. One is to make all engine changes conditional on a version flag. Another is to have a whole second copy of the layout code. Either would be a huge additional barrier to entry for developers, and would make it harder to maintain the code.
要增加新的模式,有两种看似可行的方式。一种是引擎所有的改动都加上对版本号的条件判断。另一种则是完整拷贝一份布局代码。无论哪种方式,对于开发者的参与来说都是一个巨大的额外障碍,也使得代码更难维护。
So, bottom line, we’d like to see fewer modes, not more.
所以基本上,我们希望模式更少,而不是更多。
Mobile-Readiness
移动适用性
In addition to maintainability, an important feature of the WebKit engine is the ease with which it is deployed on limited-capability devices such as mobile phones. Some of the more prominent examples include Nokia’s S60 Browser, Apple’s iPhone and iPod touch, and Google’s Android platform. These and other products all include a full-powered version of WebKit, no compromises.
除了可维护性之外,WebKit引擎的一个重要特色是易于部署到功能有限的设备,如移动电话上。大家熟知的例子包括诺基亚的S60浏览器、苹果的iPhone和iPod touch,以及谷歌的Android平台。这些产品都包含了一个WebKit的全功能版本,没有损失任何功能。
However, having more mode switches cuts against this. The extra code (possibly whole extra copies of the engine, at the very least a whole lot of extra if statements) would be a significant burden on mobile devices. It’s not very well aligned with our mission of staying lean and mean.
然而,如果有更多的模式切换,则会损害这一点。额外的代码(可能是所有额外的引擎拷贝,或者至少是大量额外的if语句)对于移动设备来说会是严重的负担。这与我们至精至简(lean and mean)的目标不相一致。
待续……
Versioning, Compatibility and Standards
版本、兼容性以及标准
Posted by Maciej Stachowiak on Tuesday, January 22nd, 2008 at 11:51 pm
Maciej Stachowiak发表于2008年1月22日星期二
The new IE8 version targeting switch, announced on IEBlog and A List Apart, has been the talk of the web. Some web standards experts, like Eric Meyer and Jeffrey Zeldman see the switch in a positive light. Others, including Dean Edwards, Robert O’Callahan and Anne van Kesteren think the proposal is a bad idea.
IEBlog和A List Apart上声明了新的IE8的版本目标切换特性(version targeting switch),这成为了最近谈论的焦点。一些web标准专家,如Eric Meyer和Jeffrey Zeldman对这种切换特性给予了正面评价,而其他人,包括Dean Edwards、Robert O'Callahan和Anne van Kesteren,则认为这一提案是个糟糕的主意。
We don’t talk much about what other browsers are doing on this blog. While we’re happy to collaborate on web standards and testing, and sometimes share a little friendly rivalry, we try to keep our focus on making the best Web browser engine we can, not on the competition. So we’re not going to give in-depth commentary on the IE team’s decision. Straddling compatibility and Web standards is a tough job requiring tough choices.
在本blog【webkit的官方blog】上我们不会去讨论其他浏览器的所作所为。尽管我们很高兴在Web标准和测试方面进行合作,有时还参与一点友好的竞争,但我们希望把关注点集中于如何尽我所能创造最好的Web浏览器引擎,而不是竞赛上。所以我们不会对IE团队的决定多嘴多舌。平衡兼容性和Web标准总是一项艰难的工作,需要做出艰难的选择。
However, some have asked if other browser engines, including WebKit, would adopt a similar version switch. For example, the original announcement asks, “I, for one, hope other browser vendors join Microsoft in implementing this functionality.” I can’t make any definitive statement for all time, but such an approach does not seem like a good idea to us currently. Why, you may ask? There are a few reasons.
然而,有人问其他浏览器引擎,包括WebKit,是否能引入类似的版本切换机制。比如,最初声明中提到,“我本人,希望其它浏览器厂商也能和微软一起,实现该特性。”我并不能做出权威声明,但是可以说,这一想法对我们目前来说并不是一个好主意。
Mode Switches in WebKit
WebKit中的模式切换
WebKit, like most browser engines, has a quirks mode that is triggered by certain old HTML doctypes, or lack of a doctype declaration in text/html. Documents with newer or unknown doctypes, or sent as XML, are processed in standards mode. Like Mozilla and Opera, we apply only a limited set of nonstandard behaviors in quirks mode, and otherwise fix bugs across both modes, if they do not have a specific significant impact on Web compatibility. This is in contrast to the IE approach of completely freezing old behavior in quirks mode.
WebKit,正如大多数浏览器引擎一样,具有怪癖模式,可由特定的老的HTML doctype或者在text/html下不写doctype声明来触发。文档如果使用新的或者未知的doctype,或者作为XML传送,则会按标准模式处理。像Mozilla和Opera一样,我们在怪癖模式下引入的非标准的行为是相当有限的;其他那些bug,如果对于Web兼容性没有特别重大的影响,则在所有模式下都会被修复。这与IE的方式截然相反,IE的方式是在怪癖模式中完全沿袭旧的行为。
We actually have a few modes besides that. A handful of doctypes trigger what is called “almost standards mode”, which is standards mode with one minor deviation, mainly affecting how images lay out in table cells; this is copied from Mozilla. In addition, we have a few rendering and DOM differences between documents served with an XML MIME type and those served with an HTML MIME type, but we are trying to reduce these over time. And finally, we have a Dashboard compatibility mode that has a few extra quirks beyond quirks mode, to handle Dashboard widgets that were coded to depend on old WebKit bugs.
我们其实还有一些其他的模式。有一些doctype会触发所谓“几乎标准模式”,也就是标准模式附带一个小例外,主要是影响图像在表格单元中的布局方式【即在单元格中的图像会紧贴边界,而不会因默认的baseline对齐方式留下空白】;这一方式是从Mozilla照搬来的。此外,文档按照XML MIME类型传输或HTML MIME类型传输,在呈现效果和DOM模型上还有少许不同之处,但是我们试图逐渐消除这些不同。最后,我们还有一个Dashboard兼容模式,它在怪癖模式之外还有一些额外的怪癖,以满足一些Dashboard微件(widget)的需求,它们的代码依赖某些旧的WebKit的bug。
Maintainability
可维护性
As you can see, this is quite a few modes already. Having lots of modes raises a number of challenges for maintaining the engine.
如你所见,我们已经有好些不同的模式了。这对于引擎的维护来说是很大的挑战。
First, the more different modes there are, the harder it is to fully test the engine. We have an aggressive approach to automated testing, and our layout tests often find critical problems before they are shipped or even checked in. Having more modes means many things need to be tested in multiple modes. So that’s more tests, more time for developers to run the test suite, and more chances of missing code coverage, especially when different modes interact.
首先,模式越多,越难以对引擎进行全面测试。我们采用积极的自动测试方式,通过我们的布局测试,那些严重的问题一般总能在正式发布甚至签入代码库之前就被发现。更多的模式意味着有许多事情需要在多个模式中进行测试。也就是要写更多的测试,开发者要花更多的时间来运行测试套件,并且更有可能达不到代码的测试覆盖度,特别是当不同模式相互作用时。
Second, implementing mode switches hurts hackability of the code. Hackability is one of our core project goals. It’s part of the reason new contributors can dive in quickly, and enables us to rapidly develop new features, while improving performance, stability, and security.
其次,实现模式切换会损害代码的hackability。hackability是我们这个项目的核心目标之一。新的贡献者之所以能快速切入,hackability是很重要的一点,它让我们在改进性能、稳定性和安全的同时,也能快速开发新的特性。
There’s two plausible ways to add more modes. One is to make all engine changes conditional on a version flag. Another is to have a whole second copy of the layout code. Either would be a huge additional barrier to entry for developers, and would make it harder to maintain the code.
要增加新的模式,有两种看似可行的方式。一种是引擎所有的改动都加上对版本号的条件判断。另一种则是完整拷贝一份布局代码。无论哪种方式,对于开发者的参与来说都是一个巨大的额外障碍,也使得代码更难维护。
So, bottom line, we’d like to see fewer modes, not more.
所以基本上,我们希望模式更少,而不是更多。
Mobile-Readiness
移动适用性
In addition to maintainability, an important feature of the WebKit engine is the ease with which it is deployed on limited-capability devices such as mobile phones. Some of the more prominent examples include Nokia’s S60 Browser, Apple’s iPhone and iPod touch, and Google’s Android platform. These and other products all include a full-powered version of WebKit, no compromises.
除了可维护性之外,WebKit引擎的一个重要特色是易于部署到功能有限的设备,如移动电话上。大家熟知的例子包括诺基亚的S60浏览器、苹果的iPhone和iPod touch,以及谷歌的Android平台。这些产品都包含了一个WebKit的全功能版本,没有损失任何功能。
However, having more mode switches cuts against this. The extra code (possibly whole extra copies of the engine, at the very least a whole lot of extra if statements) would be a significant burden on mobile devices. It’s not very well aligned with our mission of staying lean and mean.
然而,如果有更多的模式切换,则会损害这一点。额外的代码(可能是所有额外的引擎拷贝,或者至少是大量额外的if语句)对于移动设备来说会是严重的负担。这与我们至精至简(lean and mean)的目标不相一致。
待续……
发表评论
-
ms is wrong AGAIN
2013-12-06 21:08 2845微软的Web工程师写了这篇文章Vendor Prefixes ... -
为后代选择器和ID选择器而辩护
2013-04-20 06:57 6910【本文译自 Zeldman (作为前端工程师,不要告诉我你不知 ... -
My Opinion about so-called "CSS Framework"
2012-10-27 12:54 2370There are many so-called " ... -
document.enableStyleSheetsForSet() 的兼容
2011-06-17 16:27 3458可能有不少同学已经了 ... -
再论“像素(px)”
2011-03-13 14:37 0两年之前我写了一篇文 ... -
再谈某些所谓CSS最佳实践
2010-12-23 01:59 10027最近看了国内某位前端工程师今年出版的新书,其中讨论CSS的部分 ... -
webkit上multicolumn的bug和解决技巧一则
2010-12-04 12:03 3999webkit开始支持多栏属性 ... -
关于lang()语言伪类选择器的提案
2010-10-26 00:36 0本文发端“中文HTML5同 ... -
关于样式类(Style Class)
2009-10-22 11:37 9883我们知道HTML和CSS是正交 ... -
Meta CSS —— 一个Anti Pattern的典型
2009-10-21 02:15 11627关于Meta CSS框架,可以 ... -
像素(px)到底是个什么单位
2009-04-25 01:46 40277px,对于许多网页设计 ... -
有关IE的CSS的几个偶得
2008-08-25 19:13 2162除了个别几个CSS属性,IE(包括IE7)并不支持一般性的in ... -
版本、兼容性以及标准 续(翻译)
2008-02-10 19:40 4676续前半部分。 Commitment ... -
Web未来的分歧
2008-02-09 05:41 2251Dean Edwards的新的一篇blog是几段引用,抄录并勉 ... -
IE神经刀
2008-02-01 15:13 4861我想,你可能已经知道长期以来使用自定义标签的困难是什么。 对, ... -
《精通CSS》读书笔记(七)
2007-09-05 02:37 5552续上篇 在第5章的最后,作者对dl做了简短的说明,作者不是很 ... -
IE中IMG元素上应用padding的奇特bug
2007-09-02 23:43 5981最近又(又说了“又”)发现了一个IE的奇特bug。 我们知道 ... -
关于list(ol和ul)的padding和margin
2007-09-02 19:08 9404在《CSS Mastery》一书的第5章中,作者说IE和Ope ... -
《精通CSS》读书笔记(六)
2007-08-29 20:22 6277续上篇。 第5章 关于列表,首先,由于list-style ... -
《精通CSS》读书笔记(五)
2007-08-28 16:06 5618续上篇。 第4章 本章 ...
相关推荐
电磁兼容国家标准(电磁兼容国标)与电磁兼容国际标准对照一览表;电磁兼容国家标准(电磁兼容国标)与电磁兼容国际标准对照一览表
Android2.3 系统的兼容性标准规范,我在博客上贴出来的翻译当中有的部分细节没有翻译可以参考一下这篇源文档。
EN IEC 61000-6-1-2019中文 电磁兼容性(EMC) --第6-1部分: 通用标准--住宅、 商业和轻工业环境的抗扰度标准.pdf
EN50121,轨道交通铁路设备电磁兼容标准,机车车辆电子产品使用标准。
说明2:在BT-LAH Modul EMV(电磁兼容性)文件中专门规定了针对部件的EMV(电磁兼容性)试验和要求。 本标准现在的版本是以LV(供货规范)124原版为基础的,这份供货规范是由汽车制造商奥迪公司、BMW公司、戴姆勒...
在此版本中,PHPMailer获得了官方的PHP 8兼容性;早期版本可在PHP 8预发行版中使用,但测试套件却不能。@jrfnl完成了所需的大量工作(它还恢复了在较旧的PHP版本上运行的测试)–非常感谢! PHP 8.0兼容性 从...
GB19574-2004本标准42条是强制性的.doc GB2423.08.pdf gb4943-1.pdf GB4943-2001.pdf GB4943-2001等同UL61950超清晰版下载.pdf gb4943.pdf GB9254-1998.pdf GBT 2829-2002.pdf GBT17263-2002 neq IEC 60969 2000.doc...
兼容性: 保持了与既有标准的兼容性,以确保设备可以与其他设备和存储卡互操作。 可选的安全性功能: 标准可能还包括可选的数据加密和数据保护功能,以确保存储设备中的数据安全。 总之,e•MMC 5.1 主要关注提高...
RFC2208 资源预留协议(RSVP)——版本1 适用性声明 关于配置的一些指导 RFC2212 有保证的质量服务说明书 RFC2213 综合服务管理信息基础使用SMI版本2 RFC2217 TelnetCom端口控制选项 RFC2221 IMAP4 登陆参考 RFC2228 ...
1:外文原文 Struts——an open-source MVC implementation This article introduces Struts, a Model-View-Controller implementation that uses servlets and JavaServer Pages (JSP) technology....
的版本,后来上大学后申报百项工程项目,又加入了 MMX/SSE/SSE-2 处理器的支持以及改进的双线性滤波缩放算法,做了更好的MPEG2兼容性,改进了运动搜索算法, 使图象品质有了极大提高,其压缩效果不亚于最好的压缩...
7.4 实际源代码兼容性 7.5 链接兼容牲 7.6 运行兼容牲 7.7 进程兼容性 7.8 文档化不兼容性 7.9 非文档化特性 7.10 总结 7.11 练习 7.12 参考文献和相关资料 第8章 继承体系 8.1 根数目、深度和扇出数 ...
3. 灵活,兼容性高;4. 可互操作性高;5. 价格低 (对于设备生产商来说);6. CAN产品尺寸小,节省空间;7.支持冗余备用 CANopen 设备都需要具备对象字典,用来设定设备组态及进行非即时的通讯。对象字典的entry ...
加强后台MySQL数据库管理 - 调整ARCHIVE CSS代码 - 修正所有已知BUG,包括BUG所反映的所有问题 - 修正邮件系统发送UTF-8文字兼容性问题 - 更多的代码优化 <br>中国论坛网推荐" src=...
Opera 是来自挪威的一个极为出色的网络浏览套件,具有速度快...* 改善界面字体,在某些美化版 Windows 中字体不再显示丑陋* 优化翻译,数万字串逐句校对* 修复国内数十家网站的浏览器兼容性问题* 优化快进字串,让浏览
在这样的背景下,一个容易理解的问题是从提供相似程序包的大量服务中找到合适的服务,以满足诸如安全性,成本,信任和操作系统兼容性等用户需求,这已成为一个巨大的挑战。 但是,现有技术(例如框架,Web搜索,...
i18n标记模板文字 目录 总览 此模板文字标记为您JavaScript项目添加了对i18n和...兼容性 该库正在使用ECMAScript国际化API。 ES国际化API已在所有现代浏览器中实现。 对于node.js项目,您可以使用Andy Earnshaw出色的In
AT89C52是一个低电压,高性能CMOS 8位单片机,片内含8k bytes的可反复擦写的Flash只读程序存储器和256 bytes的随机存取数据存储器(RAM),器件采用ATMEL公司的高密度、非易失性存储技术生产,兼容标准MCS-51指令...
自然模板: Thymeleaf模板是“自然”的,因为它们与标准的HTML兼容,不需要专门的编辑器或IDE即可编辑。这使得开发人员可以使用常见的Web开发工具来创建和维护模板。 表达式语言: Thymeleaf 3.0引入了更新的表达式...
不兼容性 第十四章 的约定 书写约定 基本的约定 规则命令行的约定 代表命令变量 安装目录变量 的标准目标名 安装命令分类 第十五章的常见错误信息 产生的错误信息 附录:关键字索引 可识别的指示符 函数 的自动化变量...