(node, opt_topWin)
| 285 | * @return {?HTMLIFrameElement} |
| 286 | */ |
| 287 | export function getParentWindowFrameElement(node, opt_topWin) { |
| 288 | const childWin = (node.ownerDocument || node).defaultView; |
| 289 | const topWin = opt_topWin || getTopWindow(childWin); |
| 290 | if (childWin && childWin != topWin && getTopWindow(childWin) == topWin) { |
| 291 | try { |
| 292 | return /** @type {?HTMLIFrameElement} */ (childWin.frameElement); |
| 293 | } catch (e) { |
| 294 | // Ignore the error. |
| 295 | } |
| 296 | } |
| 297 | return null; |
| 298 | } |
| 299 | |
| 300 | /** |
| 301 | * @param {!Node|!./service/ampdoc-impl.AmpDoc} nodeOrDoc |
no test coverage detected