Windows 版 Safari 和 Mac 版 Safari 的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/308305/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Differences between Safari for Windows and Safari for Mac
提问by JB Hurteaux
What are the differences from a developer point of view between Safari for Mac and Safari for Windows?
从开发人员的角度来看,Mac 版 Safari 和 Windows 版 Safari 有什么区别?
I think it boils down to evaluate differences between (if I missed something, please correct):
- Layout rendering
- Javascript behavior
我认为归结为评估之间的差异(如果我错过了什么,请更正):
- 布局渲染
- Javascript 行为
The final decision to be made being:
Can developers test only on Safari Windows (knowing that we can't afford to miss important bugs)?
要做出的最终决定是:
开发人员能否仅在 Safari Windows 上进行测试(知道我们不能错过重要的错误)?
Thanks, JB
谢谢,JB
采纳答案by Marko
As far as rendering and JavaScript are concerned, there is no difference. What is different is underlaying UI library used for browser itself, but page render is the same.
就渲染和 JavaScript 而言,没有区别。不同的是用于浏览器本身的底层 UI 库,但页面渲染是相同的。
回答by Nathaniel Reinhart
Font rendering can be different between Mac and Windows Safari as the systems typically have different fonts. As long as your page can gracefully handle missing fonts or different font sizes it should be fine.
Mac 和 Windows Safari 的字体渲染可能不同,因为系统通常具有不同的字体。只要您的页面可以优雅地处理丢失的字体或不同的字体大小,就应该没问题。
回答by Rich Smith
Style sheet rendering is significantly different between Safari and Windows. To see this, try creating a page that has an element with a z-index of -1. The windows version will function without issue, the Mac version will not allow you to select the elements. Trust me, I wasted about three hours trying to figure out by trial and error why a page would work in one system but not the other. The worst bit is that when Safari doesn't render something properly, it does so without any indication. You have to debug line for line, a dreadful experience.
Safari 和 Windows 之间的样式表呈现明显不同。要查看这一点,请尝试创建一个包含 z-index 为 -1 的元素的页面。Windows 版本可以正常运行,Mac 版本不允许您选择元素。相信我,我浪费了大约三个小时试图通过反复试验找出为什么一个页面可以在一个系统中工作而不是另一个系统。最糟糕的是,当 Safari 无法正确渲染某些内容时,它会在没有任何指示的情况下进行渲染。您必须逐行调试,这是一种可怕的体验。
回答by jedierikb
Here is a link to different javascript behavior.
这是指向不同 javascript 行为的链接。
回答by ruipacheco
I have also seen problems in Safari for Windows that don't exist in Safari for Mac on CSS heavy websites. Can't remember the specifics, but they were there.
我还在 Safari for Windows 中看到了在 CSS 繁重的网站上的 Safari for Mac 中不存在的问题。不记得具体细节,但他们在那里。
回答by SomeCallHimTim
I am currently experiencing an issue where floating images in a blog with text wrapping around the image do not properly pad themselves in OS X; works fine in windows. Basically I've added padding to make the image align flush left or right such that the edge of the image is at the same offset as the edge of the text of the post; on OS X the image sticks out past the edge of the text.
我目前遇到一个问题,即博客中带有文本环绕图像的浮动图像无法在 OS X 中正确填充;在 Windows 中工作正常。基本上我已经添加了填充来使图像左对齐或右对齐,这样图像的边缘与帖子文本的边缘的偏移量相同;在 OS X 上,图像超出文本边缘。
回答by Dawit
A call to java from javascript throws:
从 javascript 调用 java 抛出:
java.net.MalformedURLException: no protocol: at java.net.URL.(Unknown Source) at java.net.URL.(Unknown Source) at java.net.URL.(Unknown Source) at sun.plugin.liveconnect.SecureInvocation.checkLiveConnectCaller(Unknown Source) at sun.plugin.liveconnect.SecureInvocation.access##代码##0(Unknown Source) at sun.plugin.liveconnect.SecureInvocation.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)
on Safari windows but not safari mac.
在 Safari windows 上,但不是在 safari mac 上。
回答by Dawit
A site I am working on now has a problem in safari for mac that isn't in safari 3 or 4 for windows. I cant figure it out for the life of me.
我现在正在处理的一个网站在 safari for mac 中存在问题,而在 windows 的 safari 3 或 4 中没有。我一辈子都搞不清楚。
回答by David
Just wanted to add this experience I came across for Safari. Our devs are still going to look into this but not high priority for us since Windows Safari isn't much of our user base unlike Mac. But I think it relates to either (or both) - actual browser low level implementation of Safari by Apple, and/or javascript differences.
只是想添加我在 Safari 中遇到的这种体验。我们的开发人员仍然会研究这个问题,但对我们来说不是高优先级,因为与 Mac 不同,Windows Safari 在我们的用户群中并不多。但我认为它与任一(或两者)有关 - Apple 对 Safari 的实际浏览器低级实现,和/或 javascript 差异。
Our website recently implemented an HTML5 multiple file uploader. Single file uploads work fine on both versions of Safari. But when uploading multiple files, it fails on Windows. We had two different upload clients & endpoints for the uploader (think A/B testing flow), and one of them provided more details that may or may not point at the cause of the problem. On one of the client & endpoints, the client would send details of the filenames & filesizes of files to upload (as JSON array object) to the server endpoint (as seen via web inspector). On Mac where it worked, filesizes were valid, on Windows, they were 0 bytes.
我们的网站最近实现了一个 HTML5 多文件上传器。单个文件上传在两个版本的 Safari 上都可以正常工作。但是当上传多个文件时,它在 Windows 上失败。我们为上传者提供了两个不同的上传客户端和端点(想想 A/B 测试流程),其中一个提供了更多细节,可能会也可能不会指出问题的原因。在客户端和端点之一上,客户端会将要上传的文件的文件名和文件大小的详细信息(作为 JSON 数组对象)发送到服务器端点(如通过 Web 检查器看到的)。在它工作的 Mac 上,文件大小是有效的,在 Windows 上,它们是 0 字节。
I think the uploader is JQuery based or some other JS library. But I'm not the dev, so can't be sure. But I have a hunch this issue goes beyond JS libraries...
我认为上传器是基于 JQuery 的或其他一些 JS 库。但我不是开发人员,所以不能确定。但我有预感这个问题超出了 JS 库......
回答by Alex Grande
In Mac Safari I'm able to do cross script ajax with file:/// protocol, but in Windows Mac I'm unable to do this.
在 Mac Safari 中,我可以使用 file:/// 协议执行跨脚本 ajax,但在 Windows Mac 中我无法执行此操作。