不同的操作系统对显示网页的影响有多大? [英] How much of an effect can different operating systems have on displaying web pages?

查看:40
本文介绍了不同的操作系统对显示网页的影响有多大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到该站点上的很多用户在描述 Web 开发错误时提供了操作系统规范,并且我看到了一些在一个操作系统上运行但在另一个操作系统上运行的实例.

I've seen a lot of users on this site provide operating system specs when describing web development bugs and I've seen a few instances of things working on one OS but not another.

比方说 IE6 在不同版本的 Windows 上处理的内容是否存在实际差异?或者 ubuntu 上的 firefox 版本与 mac 完全相同?

Is there an actual difference in what gets processed by let's say IE6 on different versions of windows? Or the exact same version of firefox on ubuntu as opposed to mac?

这可能是一个菜鸟问题,但我真的很好奇.

This may be a noob question, but I'm really curious.

推荐答案

网站中可能发生的跨操作系统错误基本上有 4 类(无意中;忽略诸如 Web 开发人员嗅探用户代理和搞砸无法识别的结果之类的事情),或使用只能在一个平台上运行的插件,例如 Silverlight).根据我的个人经验,按最常见到最不常见的顺序排列

There are essentially 4 categories of cross-OS bugs that can occur in website (unintentionally; ignoring things like the web developer sniffing the user agent and screwing with unrecognized results, or using a plugin that can only work on one platform, such as Silverlight). Ordered in the most-common to least-common, from my personal experience

  1. 关于字体和字距调整的假设 -- 如果用户的操作系统与您自己的操作系统不匹配,并且您指定了您的系统具有而他们没有的字体,那么文本将不会具有完全相同的字体长度和可能的高度,即使指定了特定的磅值(小写的m"应该匹配,但所有其他字符可以不同,例如大写字母的高度).这可能会对固定大小的布局造成严重破坏,尤其是对于预计只有一行长的标题.最近,可以通过购买webfont"(通常包括旧的 IE 和新的现代标准 web 字体)并在 CSS 中使用它,托管字体供用户下载来缓解这种情况.但是,这会产生flash",因为一旦下载,渲染就会切换到它,因此您肯定需要指定较长的缓存时间.
  2. 关于表单元素的假设 -- 由于这些 HTML 元素是由操作系统直接创建的,而不是由浏览器创建的,即使对于同一个浏览器,它们也可能看起来不同,具有不同的大小和行为,操作系统之间.对这些元素进行样式设置会减少可变性,但某些表单元素(如 <input type="file">)无法设置样式.只需在您的布局中给它们一个大缓冲区即可.
  3. 有缺陷的插件 -- 即使插件存在于所有操作系统(如 Flash)中,通常它们在 Windows 上运行得最好,然后 Linux 和 Mac 争夺第二名(通常会付出更多努力)进入 Mac 端口,但在 Linux 上可能有 Wiki 指南以使其更好地工作,并且发行版打包程序可能会在为您自动安装插件时使用这些技巧).我知道的唯一解决方案是,如果你是 Windows 开发人员,拥有一个 Linux 发行版(如 Ubuntu 或 Fedora)的 VirtualBox 映像,你可以在上面测试你的网站,然后看看当你添加所有的铃铛和插件时插件的性能有多差吹口哨,然后假设 Mac 的性能大致相同.
  4. HTML 渲染器中的实际错误 -- 这些可能会发生,并且随着浏览器开发步伐的加快,平台之间的功能/错误奇偶性差距正在扩大.通常,浏览器的本机"操作系统表现最好,其次是使用它最多的平台.我很少看到回归,所以一旦某个东西在浏览器的所有操作系统上运行,它基本上就会保持这种状态.你必须做一些真正特别的事情才能遇到这种情况.
  1. Assumptions about fonts and kerning -- If the user's operating system does not match your own, and you specify a font that your system has that theirs does not, the text will not have exactly the same length and possibly height, even when specifying a specific point size (the lowercase 'm' should match, but all other characters can differ, like the height of the capitals). This can wreak havoc on fixed-sized layouts, especially with headings that are expected to be only one line long. Lately, this can be mitigated by buying a "webfont" (usually both old IE and the new modern standard web font are included) and using that in your CSS, hosting the font for the user to download. This can produce a "flash" as the rendering is switched to it once downloaded, though, so you definitely need to specify a long caching time.
  2. Assumptions about form elements -- Since these HTML elements are created by the operating system directly, rather than by the browser, even for the same browser they can look different, have different sizes and behaviors, between operating systems. Styling these elements reduces the variability, but some of the form elements (like the <input type="file">) cannot be styled. Just give them a large buffer in your layout.
  3. Buggy plugins -- Even if the plugin exists across all operating systems, like Flash, generally they work best on Windows, and then Linux and Mac fight it out for second place (usually more effort put into the Mac port, but on Linux there may be Wiki guides to get it working better, and the distro packagers may use these tricks when auto-installing the plugin for you). The only solution I know is, if you're a Windows dev, to have a VirtualBox image of a Linux distro like Ubuntu or Fedora that you test your site on, and see how poor the plugin performs when you add all of your bells and whistles, then assume that Macs are roughly the same performance.
  4. Actual bugs in the HTML renderer -- These can happen, and as the pace of browser development is increasing, the feature/bug parity gap is widening between platforms. Generally, the "native" OS of the browser does the best, followed by whichever platform uses it the most after that. I rarely see regressions, so once something is working across all OSes for a browser, it basically stays that way. You have to be doing something real special to run into this.

这篇关于不同的操作系统对显示网页的影响有多大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆