Skip to content

Commit

Permalink
Investigate viewport signal failures for elements in dead FIE (#9179)
Browse files Browse the repository at this point in the history
* Investigate viewport signal failures for elements in dead FIE

* also, elements in dead iframes are not displayed
  • Loading branch information
Dima Voytenko committed May 5, 2017
1 parent 8108fb4 commit 904764c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/service/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ export class Resource {
* @return {boolean}
*/
isDisplayed() {
return this.layoutBox_.height > 0 && this.layoutBox_.width > 0;
return (this.layoutBox_.height > 0 && this.layoutBox_.width > 0 &&
!!this.element.ownerDocument.defaultView);
}

/**
Expand Down Expand Up @@ -741,7 +742,10 @@ export class Resource {
* @param {boolean} inViewport
*/
setInViewport(inViewport) {
if (inViewport == this.isInViewport_) {
// TODO(dvoytenko, #9177): investigate/cleanup viewport signals for
// elements in dead iframes.
if (inViewport == this.isInViewport_ ||
!this.element.ownerDocument.defaultView) {
return;
}
dev().fine(TAG, 'inViewport:', this.debugid, inViewport);
Expand Down

0 comments on commit 904764c

Please sign in to comment.