* Returns a bitmap representing what features are supported by this browser. * @param {!Window} win * @return {number}
(win)
| 961 | * @return {number} |
| 962 | */ |
| 963 | function getBrowserCapabilitiesBitmap(win) { |
| 964 | let browserCapabilities = 0; |
| 965 | const doc = win.document; |
| 966 | if (win.SVGElement && doc.createElementNS) { |
| 967 | browserCapabilities |= Capability_Enum.SVG_SUPPORTED; |
| 968 | } |
| 969 | const iframeEl = doc.createElement('iframe'); |
| 970 | if (iframeEl.sandbox && iframeEl.sandbox.supports) { |
| 971 | if (iframeEl.sandbox.supports('allow-top-navigation-by-user-activation')) { |
| 972 | browserCapabilities |= |
| 973 | Capability_Enum.SANDBOXING_ALLOW_TOP_NAVIGATION_BY_USER_ACTIVATION_SUPPORTED; |
| 974 | } |
| 975 | if (iframeEl.sandbox.supports('allow-popups-to-escape-sandbox')) { |
| 976 | browserCapabilities |= |
| 977 | Capability_Enum.SANDBOXING_ALLOW_POPUPS_TO_ESCAPE_SANDBOX_SUPPORTED; |
| 978 | } |
| 979 | } |
| 980 | return browserCapabilities; |
| 981 | } |
| 982 | |
| 983 | /** |
| 984 | * Returns an enum value representing the AMP binary type, or null if this is a |
no test coverage detected