w3c标准html5手册_HTML5和W3C推荐标准

w3c标准html5手册

The HTML5 specification has finally become a W3C Recommendation. It’s done … a mere fifteen years after HTML4.01. However, the W3C beat the estimated 2022 schedule by eight years.

HTML5规范最终成为W3C建议。 它完成了…… 距HTML4.01仅15年。 但是,W3C比预计的2022年时间表提前了八年。

If you believe the reports, web users are shouting from their virtual rooftops and holding impromptu parties. There are also bizarre stories detracting from the announcement and making ludicrous claims such as:

如果您相信这些报告,则网络用户会从其虚拟屋顶大喊并举行即兴聚会。 还有一些怪异的故事,有损于公告并做出了荒唐的声明,例如:

  • The status has changed despite bitter specification squabbles between the W3C and WHATWG.

    尽管W3C和WHATWG之间存在激烈的规范争执,但状态已经改变。
  • HTML5 is Steve Jobs’ legacy and would never have happened if it weren’t for his foresight (in banning Flash).

    HTML5是史蒂夫·乔布斯(Steve Jobs)的遗产,如果不是出于他的远见(禁止使用Flash),那将永远不会发生。
  • The web is far from complete and HTML5 won’t be usable for another decade.

    网络远未完成,HTML5将在未来十年内不再可用。

The question for developers: how does this affect our daily website building chores?

开发人员的问题:这如何影响我们日常的网站建设工作?

The answer: it has absolutely no impact whatsoever.

答案: 它绝对没有任何影响

The reason is simple. W3C specifications do not tell browser vendors what to do; they record what has been done. This point continues to cause widespread confusion but the general process is straightforward:

原因很简单。 W3C规范没有告诉浏览器供应商该怎么做。 他们记录已完成的工作 。 这一点继续引起广泛的混乱,但是总体过程很简单:

  1. Vendor A implements feature X in their browser.

    供应商A在其浏览器中实现功能X。
  2. Vendor B (and possibly C, D, etc.) applaud loudly and consider implementation in their browsers.

    供应商B(可能还有C,D等)大声鼓掌,并考虑在其浏览器中实施。
  3. Feature X is documented in a W3C specification.

    功能X记录在W3C规范中。
  4. The implementation is discussed and refined. The specification status moves from Editors’ Draft to Candidate Recommendation and, finally, to Recommendation.

    对实现进行了讨论和完善。 规范状态从“ 编辑草稿”变为“ 候选推荐书” ,最后是“ 推荐书”

Vendors always have ultimate control. Features are not guaranteed to be implemented, usable or consistent just because they appear in a W3C document. Fortunately, while Google, Apple, Microsoft, Mozilla, and Opera are competitors, the process encourages interoperability because it’s impractical for developers to adopt an unstable HTML5 technology. If we don’t use it, there was little point in the vendor creating the feature in the first place.

供应商始终拥有最终控制权。 不能仅仅因为功能出现在W3C文档中就保证这些功能可以实现,可用或一致。 幸运的是,尽管Google,Apple,Microsoft,Mozilla和Opera是竞争对手,但该过程鼓励了互操作性,因为对于开发人员而言,采用不稳定HTML5技术是不切实际的。 如果我们不使用它,那么厂商首先就没有必要创建该功能。

Of course, some vendors have a bigger clout than others or can influence HTML5 in different ways. Google controls Chrome/Chromium — the market leader — so a feature is less likely to be usable until it reaches the browser. Apple is free to implement an iPhone-specific feature and do not necessarily care whether it becomes an official HTML5 technology because they control that device.

当然,某些供应商比其他供应商更具影响力,或者可以以不同方式影响HTML5。 Google控制着市场领导者Chrome / Chromium,因此在到达浏览器之前,不太可能使用该功能。 苹果可以自由地实现iPhone特有的功能,并且不必担心它是否成为正式HTML5技术,因为他们可以控制该设备。

From a development perspective, none of this matters. The web is device agnostic. Building sites and applications is — or should be — a exercise in robust progressive enhancement. For example:

从发展的角度来看,这都不重要。 网络与设备无关。 建设站点和应用程序是( 或应该)进行稳健的渐进增强。 例如:

  • You can use the new HTML5 <input type="date"> control. Some browsers have full support and display a calendar. Some have mid-level support and provide basic date validation. Some have no support and fall back to a standard text box.

    您可以使用新HTML5 <input type="date">控件。 一些浏览器具有完全支持并显示日历。 有些提供中级支持并提供基本的日期验证。 一些不支持,并退回到标准文本框。

  • You can adopt CSS3 techniques such as animation. Some browsers have full support. Some require a vendor prefix, which you can choose to omit, add manually, or automatically. Some older browsers have no support for animations, but you can ensure your application remains usable without them.

    您可以采用CSS3技术,例如动画。 某些浏览器具有完全支持。 有些需要供应商前缀,您可以选择省略,手动或自动添加。 某些较旧的浏览器不支持动画,但是如果没有动画,则可以确保应用程序仍然可用。

  • You can store data on the client using IndexDB. You can detect whether it’s supported by checking window.indexedDB exists and fall back to another solution such as server-side storage when necessary. The application may not be as polished on older browsers, but it’ll continue to work.

    您可以使用IndexDB在客户端上存储数据。 您可以通过检查window.indexedDB是否存在来检测它是否受支持,并在必要时使用其他解决方案,例如服务器端存储。 该应用程序在较旧的浏览器上可能不够完善,但仍将继续运行。

Admittedly, many developers now depend on frameworks such as AngularJS and their applications would fail without a modern browser and JavaScript. That choice is fine when fall-backs would have limited viability. Consider an HTML5 fast-action deathmatch game; it could never work offline or with server-side-only processing. In those situations, you’re targeting the browser as a platform — not the web. It’s a subtle distinction but an important one.

诚然,现在许多开发人员都依赖于AngularJS之类的框架,如果没有现代的浏览器和JavaScript,他们的应用程序将失败。 当后备的生存能力有限时,这种选择是很好的。 考虑一个HTML5快速动作死亡竞赛游戏; 它永远无法离线工作或仅用于服务器端处理。 在这种情况下,您会将浏览器定位为平台, 而不是Web 。 这是一个微妙的区别,但很重要。

HTML5 becoming a W3C Recommendation is great news but developers have been using it for almost five years. Sometimes a technology has good browser support. Sometimes we decide to use a shim. Sometimes we fall back to lesser functionality or slower server-side processing. Sometimes we simply abandon an old, infrequently-used browser. The decision is a compromise based on technical, logistical and economic constraints. The W3C specification status, vendor competition and standards body politics will always have a negligible impact.

HTML5成为W3C推荐标准是一个好消息,但是开发人员已经使用它近五年了。 有时,一项技术具有良好的浏览器支持。 有时我们决定使用垫片。 有时,我们退回到功能较少或服务器端处理速度较慢的状态。 有时,我们只是放弃了旧的,不常用的浏览器。 该决定是基于技术,后勤和经济限制的折衷方案。 W3C规范的状态,供应商的竞争和标准机构的政治影响始终微不足道。

That said, those who’ve been irrationally avoiding HTML5 because “the specification is still a draft” now have fewer excuses. HTML5 is complete; let’s focus our attention on HTML5.1!

就是说,那些因为“规范仍然是草案”而非理性地避免使用HTML5的人现在有了更少的借口。 HTML5已完成; 让我们将注意力集中在HTML5.1上

翻译自: https://www.sitepoint.com/html5-w3c-recommendation-ruckus/

w3c标准html5手册

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值