Skip to content

Commit

Permalink
Experiment guard dirtyElement call in collapseElement (ampproject#21383)
Browse files Browse the repository at this point in the history
This is a partial revert of ampproject#21128, since it may have caused a ads
metrics regression. I'm still confident that calling `dirtyElement` is
the correct behavior, but let's see...
  • Loading branch information
jridgewell authored Mar 12, 2019
1 parent 586824d commit be1bc4b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/service/resources-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,12 @@ export class Resources {
const box = this.viewport_.getLayoutRect(element);
const resource = Resource.forElement(element);
if (box.width != 0 && box.height != 0) {
this.dirtyElement(element);
if (isExperimentOn(this.win, 'dirty-collapse-element') ||
this.useLayers_) {
this.dirtyElement(element);
} else {
this.setRelayoutTop_(box.top);
}
}
resource.completeCollapse();
this.schedulePass(FOUR_FRAME_DELAY_);
Expand Down

0 comments on commit be1bc4b

Please sign in to comment.