MCPcopy
hub / github.com/ampproject/amphtml / getEnclosingContainerTypes

Function getEnclosingContainerTypes

ads/google/a4a/utils.js:858–871  ·  view source on GitHub ↗
(adElement)

Source from the content-addressed store, hash-verified

856 * @return {!Array<string>}
857 */
858export function getEnclosingContainerTypes(adElement) {
859 const containerTypeSet = {};
860 for (
861 let el = adElement.parentElement, counter = 0;
862 el && counter < 20;
863 el = el.parentElement, counter++
864 ) {
865 const tagName = el.tagName.toUpperCase();
866 if (ValidAdContainerTypes[tagName]) {
867 containerTypeSet[ValidAdContainerTypes[tagName]] = true;
868 }
869 }
870 return Object.keys(containerTypeSet);
871}
872
873/**
874 * Appends parameter to ad request indicating error state so long as error

Callers 5

test-utils.jsFile · 0.90
onCreativeRenderMethod · 0.90
getContainersFunction · 0.90
getAdUrlMethod · 0.90
googleBlockParametersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected