(video, src, opt_name, opt_sandbox)
| 65 | * @return {!Element} |
| 66 | */ |
| 67 | export function createFrameFor(video, src, opt_name, opt_sandbox) { |
| 68 | const {element} = video; |
| 69 | const frame = htmlFor( |
| 70 | element |
| 71 | )`<iframe frameborder=0 allowfullscreen></iframe>`; |
| 72 | |
| 73 | if (opt_name) { |
| 74 | frame.setAttribute('name', opt_name); |
| 75 | } |
| 76 | |
| 77 | if (opt_sandbox) { |
| 78 | frame.setAttribute('sandbox', opt_sandbox.join(' ')); |
| 79 | } |
| 80 | |
| 81 | // Will propagate for every component, but only validation rules will actually |
| 82 | // allow the attribute to be set. |
| 83 | propagateAttributes(['referrerpolicy'], video.element, frame); |
| 84 | |
| 85 | frame.src = Services.urlForDoc(element).assertHttpsUrl(src, element); |
| 86 | |
| 87 | applyFillContent(frame); |
| 88 | element.appendChild(frame); |
| 89 | |
| 90 | return frame; |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * @param {?} anything |
no test coverage detected