(element)
| 522 | * @visibleForTesting |
| 523 | */ |
| 524 | export function isAdLike(element) { |
| 525 | const {height, width} = element.getLayoutSize(); |
| 526 | for (let i = 0; i < adSizes.length; i++) { |
| 527 | const refWidth = adSizes[i][0]; |
| 528 | const refHeight = adSizes[i][1]; |
| 529 | if (refHeight > height) { |
| 530 | continue; |
| 531 | } |
| 532 | if (refWidth > width) { |
| 533 | continue; |
| 534 | } |
| 535 | // Fuzzy matching to account for padding. |
| 536 | if (height - refHeight <= 20 && width - refWidth <= 20) { |
| 537 | return true; |
| 538 | } |
| 539 | } |
| 540 | return false; |
| 541 | } |
| 542 | |
| 543 | /** |
| 544 | * @param {!Element} iframe |
no test coverage detected