root-relative 和 protocol-relative url 路径有什么区别?

What's the difference between root-relative and protocol-relative url paths?

在实践中,我已经看到像 /some-resource 这样的根相关 URL 会自动解析为与其父页面相同的协议和域。也就是说,谷歌搜索 "protocol-relative url" returns 示例,例如 //some-resource,也警告说现在它是 "anti-pattern"。那么,why/when 我会使用协议相关 url 还是根相关?好像 root-relative 工作正常?

@user2864740

//resources.mysite.bar/foo.gif” would be “correct” from both HTTP and HTTPS pages hosted on “www.mysite.bar”. Under an HTTPS page there would not be security warning for mixed-HTTP/HTTPS content. Root-relative would restrict to “www.mysite.bar” content alone.

谢谢@user2864740