简体   繁体   English

HTML5跨浏览器的故事与CSS / JS有什么不同?

[英]How is the HTML5 cross-browser story going to be any different than CSS/JS?

When CSS and JS got popular, the big frustration was that every browser implemented it differently and only a limited set of "cool stuff" worked across browsers, or worked differently. 当CSS和JS受欢迎时,最令人沮丧的是每个浏览器都以不同的方式实现它,并且只有一组有限的“酷东西”可以跨浏览器工作,或者以不同的方式工作。

Now we're making HTML5 popular, so it seems like we're about to embark on the CSS/JS incompatibility journey all over again, but now in a 3D, animated, and video-playing style. 现在我们正在使HTML5变得流行,所以看起来我们即将重新开始CSS / JS不兼容之旅,但现在是3D,动画和视频播放风格。

My question is this - are the big browsers varying HTML5 implementations in such a way that we're headed down the same path again? 我的问题是 - 大型浏览器是否会以这样的方式改变HTML5实现,以至于我们再次走向同一条道路? Is there another IE6 around the corner? 还有另一个IE6即将来临吗?

If not, what makes this story different? 如果没有,是什么让这个故事与众不同?

This story is different because browsers now agree that compatibility is important. 这个故事是不同的,因为浏览器现在同意兼容性很重要。

Consider, for instance, IE9's "same markup" marketing. 例如,考虑IE9的“相同标记”营销。 That's really an indication of the current mentality. 这真的表明了当前的心态。

In second place, HTML5 is incredibly backwards-compatible. 第二,HTML5非常向后兼容。 <input type="number"> will render like a plain text input field on IE6(and, as a result, graceful degradation is made easy) <input type="number">将在IE6上呈现为纯文本输入字段(因此,可以轻松实现优雅降级)

Of course, people are still using many old browsers, but none of them have IE6-like market shares, so they can't really be compared. 当然,人们仍在使用许多旧浏览器,但它们都没有类似IE6的市场份额,因此无法真正进行比较。 Also, the upgrade cycles for browsers seem to be shorter than they were in the early post-IE6 age. 此外,浏览器的升级周期似乎比IE6之后的早期更短。

I currently think that IEs < 9 are the most likely to become modern age IE6. 我目前认为IE <9最有可能成为现代IE6。 For Chrome, its upgrade cycle makes it very unlikely. 对于Chrome,其升级周期使其不太可能发生。 Not sure how Safari and Opera compare, but they definitively don't have massive market share, so they really have no chance of becoming IE6-like(I am not considering the mobile world). 不确定Safari和Opera如何比较,但他们肯定没有大量的市场份额,所以他们真的没有机会成为IE6(我不考虑移动世界)。 As for Firefox, it also includes free and simple upgrades, making me think that Firefox users will upgrade soon enough to the new version when it becomes available. 至于Firefox,它还包括免费和简单的升级,让我觉得Firefox用户很快就会升级到新版本。

That leaves us with IE9 with no XP support, meaning that most XP users will use IE <= 8 until they switch OS. 这使得IE9没有XP支持,这意味着大多数XP用户在切换操作系统之前都会使用IE <= 8。

EDIT: One more thing I really should mention: The spec of HTML5 takes compatibility across web browsers VERY seriously. 编辑:我还应该提到的另一件事:HTML5的规范非常重视Web浏览器的兼容性。 I believe that will help reduce the incompatibility risks(although that certainly won't make Internet Explorer support WebGL, nor make Firefox support Web SQL). 我相信这将有助于降低不兼容风险(虽然这肯定不会使Internet Explorer支持WebGL,也不会使Firefox支持Web SQL)。

My question is this - are the big browsers varying HTML5 implementations in such a way that we're headed down the same path again? 我的问题是 - 大型浏览器是否会以这样的方式改变HTML5实现,以至于我们再次走向同一条道路?

Yes, of course. 当然是。 This will inevitably happen any time you add new features to a platform with multiple implementations. 每当您向具有多个实现的平台添加新功能时,这将不可避免地发生。

It's not going to be as bad this time around because browser manufacturers are working together and trying to meet compatible standards. 这次不会那么糟糕 ,因为浏览器制造商正在共同努力,并努力达到兼容的标准。 That wasn't always the case: back in the Browser War 1.0 days, Netscape and Microsoft did as much as they could to cripple each other and other browsers by introducing ill-thought-out, gratuitously incompatible extensions for web authors to rely on. 情况并非总是如此:在浏览器大战1.0天之后,Netscape和微软通过引入经过深思熟虑,无偿的不兼容扩展来为网络作者提供依赖,从而尽可能地削弱彼此和其他浏览器。

Is there another IE6 around the corner? 还有另一个IE6即将来临吗?

IE6 wasn't that bad, in its day. IE6在当时并没有那么糟糕。 It's the first version where Microsoft really put some effort into complying with CSS standards (that they'd been instrumental in drafting!) and behaving compatibly. 这是微软真正努力遵守CSS标准的第一个版本(他们在起草过程中发挥了重要作用!)并兼容行为。 It was streets ahead of IE5 (with its horrible Box Model bug), not to mention the vile horror of Netscape 4. 它是IE5之前的街道(其可怕的Box Model bug),更不用说Netscape 4的恶劣恐怖了。

The only problem with IE6 was that Microsoft considered it an end to the Browser War and so stopped developing it. IE6的唯一问题是微软认为它是浏览器大战的终结,所以停止开发它。 Then when they did develop IE7, backwards-compatibility was poor, and because of the daft OS-integration you can't run both, which has left many enterprises with badly-written IE6-only webapps that mean they can't upgrade at all. 然后,当他们确实开发IE7时,向后兼容性很差,并且由于操作系统整合无法同时运行,这使得许多企业的IE6编写错误,这意味着他们根本无法升级。

If there is a 'next roadblock browser' it'll probably be IE8, since that's the last IE that'll run on XP. 如果有一个“下一个包版浏览器”它可能是IE8,因为这是最后一个在XP上运行的IE浏览器。

What's different now is that every "modern" browser maker (*) is participating in a concerted effort to have compatible and complete implementation of the standards, and also participate in the standards definition. 现在的不同之处在于,每个“现代”浏览器制造商(*)都参与协同努力,以实现标准的兼容和完整实施,并参与标准定义。

By the way, CSS and JS are very important pieces of HTML5. 顺便说一下,CSS和JS是HTML5的重要组成部分。

(*) Everyone but Microsoft, but given HTML5 momentum, Microsoft has decided to implement (part of) HTML in IE9. (*)除微软之外的所有人,但鉴于HTML5的势头,微软决定在IE9中实现(部分)HTML。 I expect that they'll work it out right this time, everyone else being on the same track. 我希望他们这次能够正常运作,其他人都在同一条轨道上。

When people talk of "cross browser" problems, they invariably mean "it doesn't work in IE". 当人们谈论“跨浏览器”问题时,他们总是意味着“它在IE中不起作用”。 What you will discover now is that browsers add functionality as time goes on and then the versions get upgraded except in IE where that will take years. 您现在将发现的是,随着时间的推移,浏览器会添加功能,然后版本会升级,除非在IE中需要花费数年时间。 This neck/neck pacing means that a new implementation will be found in all the advanced browsers within months of each other. 这种颈部/颈部调步意味着可以在几个月内在所有高级浏览器中找到新的实现。

The new specs also give the error condition, meaning, a browser vendor should return the same error as all the others. 新规范也给出了错误条件,这意味着浏览器供应商应该返回与其他所有错误相同的错误。 A vendor is more likely to use the 'vendor extensions' to first introduce a new feature, such as -moz or -o. 供应商更有可能使用“供应商扩​​展”来首先引入新功能,例如-moz或-o。 Hopefully, this will all mean far less problems than in the past. 希望这一切都意味着比过去更少的问题。

The story will be similar in that the pieces of functionality will probably be implemented slightly differently be each vendor. 故事的类似之处在于每个供应商的功能可能会略有不同。 But, for now, the big difference is in that major sub-components of the spec may be omitted from browsers until the HTML5 spec is completed and all browsers catch up. 但是,目前,最大的区别在于,在HTML5规范完成并且所有浏览器都赶上之前,浏览器可能会省略规范的主要子组件。 There is a helpful too called modernizr ( http://www.modernizr.com/ ) that helps your JS code figure out what's available and not available. 有一个有用的,名为modernizr( http://www.modernizr.com/ ),可以帮助您的JS代码找出可用和不可用的内容。 I recommend using that, or something like it, to detect browser features at runtime so your app degrades gracefully. 我建议使用它或类似的东西在运行时检测浏览器功能,以便您的应用程序优雅地降级。

Assuming an innocent quetion: look at the other ansewers, basically it's going to be different this time. 假设一个无辜的排队:看看其他的ansewers,基本上这次会有所不同。

Assuming a not so innocent Q: It's not going to be different, YOU can safely use Silverlight (and stop the evangelizing) :-) 假设一个不那么无辜的问:它不会有所不同,你可以安全地使用Silverlight(并停止传福音):-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM