|
11 | 11 | min-width: 10px; |
12 | 12 | min-height: 10px; |
13 | 13 | } |
14 | | - iframe { |
| 14 | + iframe, object { |
15 | 15 | border: 0; |
16 | 16 | width: 20px; |
17 | 17 | height: 20px; |
|
25 | 25 | <!-- This SVG iframe is treated as cross-origin content. --> |
26 | 26 | <iframe id="iframe" src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><rect height="20" width="20" fill="red" fill-opacity="0.3"/></svg>'> |
27 | 27 | </iframe> |
| 28 | + <!-- This SVG object is treated as cross-origin content. --> |
| 29 | + <object id="object" data='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><rect height="20" width="20" fill="blue" fill-opacity="0.3"/></svg>' type="image/svg+xml"> |
| 30 | + </object> |
28 | 31 | <canvas> |
29 | 32 | </canvas> |
30 | 33 | </div> |
|
175 | 178 | return eventPromise; |
176 | 179 | }; |
177 | 180 |
|
178 | | -let testCrossOriginContent = function(overlayElement, session, fakeDeviceController, t) { |
| 181 | +let testCrossOriginContent = function(elementId, overlayElement, session, fakeDeviceController, t) { |
179 | 182 | let debug = xr_debug.bind(this, 'testCrossOriginContent'); |
180 | 183 |
|
181 | | - let iframe = document.getElementById('iframe'); |
182 | | - assert_true(iframe != null); |
| 184 | + let element = document.getElementById(elementId); |
| 185 | + assert_true(element != null); |
183 | 186 | let inner_b = document.getElementById('inner_b'); |
184 | 187 | assert_true(inner_b != null); |
185 | 188 |
|
|
198 | 201 | // Press the primary input button and then release it a short time later. |
199 | 202 | requestSkipAnimationFrame(session, (time, xrFrame) => { |
200 | 203 | debug('got rAF 1'); |
201 | | - input_source.setOverlayPointerPosition(iframe.offsetLeft + 1, |
202 | | - iframe.offsetTop + 1); |
| 204 | + input_source.setOverlayPointerPosition(element.offsetLeft + 1, |
| 205 | + element.offsetTop + 1); |
203 | 206 | input_source.startSelection(); |
204 | 207 |
|
205 | 208 | session.requestAnimationFrame((time, xrFrame) => { |
|
289 | 292 |
|
290 | 293 | xr_session_promise_test( |
291 | 294 | "Ensures DOM Overlay interactions on cross origin iframe are ignored", |
292 | | - testCrossOriginContent.bind(this, document.getElementById('div_overlay')), |
| 295 | + testCrossOriginContent.bind(this, 'iframe', document.getElementById('div_overlay')), |
| 296 | + fakeDeviceInitParams, 'immersive-ar', { |
| 297 | + requiredFeatures: ['dom-overlay'], |
| 298 | + domOverlay: { root: document.getElementById('div_overlay') } |
| 299 | + }); |
| 300 | + |
| 301 | +xr_session_promise_test( |
| 302 | + "Ensures DOM Overlay interactions on cross origin object are ignored", |
| 303 | + testCrossOriginContent.bind(this, 'object', document.getElementById('div_overlay')), |
293 | 304 | fakeDeviceInitParams, 'immersive-ar', { |
294 | 305 | requiredFeatures: ['dom-overlay'], |
295 | 306 | domOverlay: { root: document.getElementById('div_overlay') } |
|
0 commit comments