(adElement)
| 856 | * @return {!Array<string>} |
| 857 | */ |
| 858 | export 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 |
no outgoing calls
no test coverage detected