`
hax
  • 浏览: 952238 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

版本、兼容性以及标准(翻译)

    博客分类:
  • CSS
阅读更多
本文译自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.
IEBlogA List Apart上声明了新的IE8的版本目标切换特性(version targeting switch),这成为了最近谈论的焦点。一些web标准专家,如Eric MeyerJeffrey Zeldman对这种切换特性给予了正面评价,而其他人,包括Dean EdwardsRobert O'CallahanAnne 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浏览器、苹果的iPhoneiPod 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)的目标不相一致。

待续……
1
0
分享到:
评论

相关推荐

    电磁兼容国家标准与国际标准

    电磁兼容国家标准(电磁兼容国标)与电磁兼容国际标准对照一览表;电磁兼容国家标准(电磁兼容国标)与电磁兼容国际标准对照一览表

    Android2.3 系统的兼容性标准规范

    Android2.3 系统的兼容性标准规范,我在博客上贴出来的翻译当中有的部分细节没有翻译可以参考一下这篇源文档。

    EN IEC 61000-6-1-2019中文 电磁兼容性(EMC) --: 通用标准--住宅、 商业和轻工业环境的抗扰度标准

    EN IEC 61000-6-1-2019中文 电磁兼容性(EMC) --第6-1部分: 通用标准--住宅、 商业和轻工业环境的抗扰度标准.pdf

    BS EN 50121-3-2 (2006)铁路设施 电磁兼容性 机车车辆 仪表

    EN50121,轨道交通铁路设备电磁兼容标准,机车车辆电子产品使用标准。

    VW 80000 中文版(网上流传最高清版本)

    说明2:在BT-LAH Modul EMV(电磁兼容性)文件中专门规定了针对部件的EMV(电磁兼容性)试验和要求。 本标准现在的版本是以LV(供货规范)124原版为基础的,这份供货规范是由汽车制造商奥迪公司、BMW公司、戴姆勒...

    PHPMailer-6.2.0.zip

    在此版本中,PHPMailer获得了官方的PHP 8兼容性;早期版本可在PHP 8预发行版中使用,但测试套件却不能。@jrfnl完成了所需的大量工作(它还恢复了在较旧的PHP版本上运行的测试)–非常感谢! PHP 8.0兼容性 从...

    电源设计相关通用规范标准CEC标准国标资料合集.zip

    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...

    eMMC-5.1-中文.pdf

    兼容性: 保持了与既有标准的兼容性,以确保设备可以与其他设备和存储卡互操作。 可选的安全性功能: 标准可能还包括可选的数据加密和数据保护功能,以确保存储设备中的数据安全。 总之,e•MMC 5.1 主要关注提高...

    rfc中文文档目录,包含部分翻译

    RFC2208 资源预留协议(RSVP)——版本1 适用性声明 关于配置的一些指导 RFC2212 有保证的质量服务说明书 RFC2213 综合服务管理信息基础使用SMI版本2 RFC2217 TelnetCom端口控制选项 RFC2221 IMAP4 登陆参考 RFC2228 ...

    外文翻译 stus MVC

    1:外文原文 Struts——an open-source MVC implementation This article introduces Struts, a Model-View-Controller implementation that uses servlets and JavaServer Pages (JSP) technology....

    VideoEnc V2.0 with source

    的版本,后来上大学后申报百项工程项目,又加入了 MMX/SSE/SSE-2 处理器的支持以及改进的双线性滤波缩放算法,做了更好的MPEG2兼容性,改进了运动搜索算法, 使图象品质有了极大提高,其压缩效果不亚于最好的压缩...

    C++代码设计与重用

    7.4 实际源代码兼容性 7.5 链接兼容牲 7.6 运行兼容牲 7.7 进程兼容性 7.8 文档化不兼容性 7.9 非文档化特性 7.10 总结 7.11 练习 7.12 参考文献和相关资料 第8章 继承体系 8.1 根数目、深度和扇出数 ...

    canopen协议中文翻译版

    3. 灵活,兼容性高;4. 可互操作性高;5. 价格低 (对于设备生产商来说);6. CAN产品尺寸小,节省空间;7.支持冗余备用 CANopen 设备都需要具备对象字典,用来设定设备组态及进行非即时的通讯。对象字典的entry ...

    MolyX BOARD 2.5.0 RC 简体中文标准版

    加强后台MySQL数据库管理 - 调整ARCHIVE CSS代码 - 修正所有已知BUG,包括BUG所反映的所有问题 - 修正邮件系统发送UTF-8文字兼容性问题 - 更多的代码优化 <br>中国论坛网推荐" src=...

    Opera中国版(朱雀版) v12.02

    Opera 是来自挪威的一个极为出色的网络浏览套件,具有速度快...* 改善界面字体,在某些美化版 Windows 中字体不再显示丑陋* 优化翻译,数万字串逐句校对* 修复国内数十家网站的浏览器兼容性问题* 优化快进字串,让浏览

    论文研究 - Cloudysme:帮助中小企业在云环境中采用SaaS的本体框架

    在这样的背景下,一个容易理解的问题是从提供相似程序包的大量服务中找到合适的服务,以满足诸如安全性,成本,信任和操作系统兼容性等用户需求,这已成为一个巨大的挑战。 但是,现有技术(例如框架,Web搜索,...

    es2015-i18n-tag:用于i18n和l10n的ES2015模板文字标签(翻译和国际化)

    i18n标记模板文字 目录 总览 此模板文字标记为您JavaScript项目添加了对i18n和...兼容性 该库正在使用ECMAScript国际化API。 ES国际化API已在所有现代浏览器中实现。 对于node.js项目,您可以使用Andy Earnshaw出色的In

    外文翻译-AT89C52单片机的介绍

    AT89C52是一个低电压,高性能CMOS 8位单片机,片内含8k bytes的可反复擦写的Flash只读程序存储器和256 bytes的随机存取数据存储器(RAM),器件采用ATMEL公司的高密度、非易失性存储技术生产,兼容标准MCS-51指令...

    Thymeleaf3.0中文翻译文档.pdf

    自然模板: Thymeleaf模板是“自然”的,因为它们与标准的HTML兼容,不需要专门的编辑器或IDE即可编辑。这使得开发人员可以使用常见的Web开发工具来创建和维护模板。 表达式语言: Thymeleaf 3.0引入了更新的表达式...

    GNU-Makefile中文手册-Ver3.8.pdf

    不兼容性 第十四章 的约定 书写约定 基本的约定 规则命令行的约定 代表命令变量 安装目录变量 的标准目标名 安装命令分类 第十五章的常见错误信息 产生的错误信息 附录:关键字索引 可识别的指示符 函数 的自动化变量...

Global site tag (gtag.js) - Google Analytics