MCPcopy Index your code
hub / github.com/ampproject/amphtml / createFrameFor

Function createFrameFor

src/iframe-video.js:67–91  ·  view source on GitHub ↗
(video, src, opt_name, opt_sandbox)

Source from the content-addressed store, hash-verified

65 * @return {!Element}
66 */
67export 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

Callers 15

layoutCallbackMethod · 0.90
layoutCallbackMethod · 0.90
buildIframe_Method · 0.90
layoutCallbackMethod · 0.90
layoutCallbackMethod · 0.90
layoutCallbackMethod · 0.90
layoutCallbackMethod · 0.90
layoutCallbackMethod · 0.90
layoutCallbackMethod · 0.90
layoutCallbackMethod · 0.90
layoutCallbackMethod · 0.90
layoutCallbackMethod · 0.90

Calls 5

htmlForFunction · 0.90
propagateAttributesFunction · 0.90
applyFillContentFunction · 0.90
assertHttpsUrlMethod · 0.80
setAttributeMethod · 0.45

Tested by

no test coverage detected