Skip to content

Commit

Permalink
Disable layers prioritization code in extensions (ampproject#21445)
Browse files Browse the repository at this point in the history
These extensions added layers support with the understanding that layers
redoes the prioritization of elements. Now that we've experiment guarded
the prioritization code, we need to guard here too.
  • Loading branch information
jridgewell authored Mar 15, 2019
1 parent 77d51d1 commit 3016c62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion extensions/amp-carousel/0.1/scrollable-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export class AmpScrollableCarousel extends BaseCarousel {
this.container_.classList.add('i-amphtml-scrollable-carousel-container');
this.element.appendChild(this.container_);

this.useLayers_ = isExperimentOn(this.win, 'layers');
this.useLayers_ = isExperimentOn(this.win, 'layers') && isExperimentOn(
this.win, 'layers-prioritization');

this.cells_.forEach(cell => {
if (!this.useLayers_) {
Expand Down
3 changes: 2 additions & 1 deletion extensions/amp-image-slider/0.1/amp-image-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ export class AmpImageSlider extends AMP.BaseElement {
'2 <amp-img>s must be provided for comparison');

// TODO(kqian): remove this after layer launch
if (!isExperimentOn(this.win, 'layers')) {
if (!isExperimentOn(this.win, 'layers') ||
!isExperimentOn(this.win, 'layers-prioritization')) {
// see comment in layoutCallback
// When layers not enabled
this.setAsOwner(dev().assertElement(this.leftAmpImage_));
Expand Down

0 comments on commit 3016c62

Please sign in to comment.