Skip to content

Commit

Permalink
SwG Release 0.1.22.67 (#24440)
Browse files Browse the repository at this point in the history
* SwG Release 0.1.22.67

* SwG Release 0.1.22.67

* Merges John's changes from AMP#24385
  • Loading branch information
Elijah Soria authored and jpettitt committed Sep 11, 2019
1 parent 4c0c76c commit bd3d764
Show file tree
Hide file tree
Showing 6 changed files with 905 additions and 634 deletions.
4 changes: 1 addition & 3 deletions extensions/amp-subscriptions/0.1/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ export class Dialog {
},
mutate: () => {
this.viewport_.updatePaddingBottom(offsetHeight);
// TODO(dvoytenko, #20608): add to fixed layer, once the SwG/FL
// conflict is resolved.
// this.viewport_.addToFixedLayer(this.wrapper_, true);
this.viewport_.addToFixedLayer(this.wrapper_, true);
},
});
});
Expand Down
9 changes: 9 additions & 0 deletions extensions/amp-subscriptions/0.1/doc-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import {Doc} from '../../../third_party/subscriptions-project/config';
import {Services} from '../../../src/services';
import {dev} from '../../../src/log';

/**
Expand All @@ -28,6 +29,9 @@ export class DocImpl {
constructor(ampdoc) {
/** @private @const {!../../../src/service/ampdoc-impl.AmpDoc} */
this.ampdoc_ = ampdoc;

/** @private {!../../../src/service/viewport/viewport-interface.ViewportInterface} */
this.viewport_ = Services.viewportForDoc(this.ampdoc_);
}

/** @override */
Expand Down Expand Up @@ -65,6 +69,11 @@ export class DocImpl {
whenReady() {
return this.ampdoc_.whenReady();
}

/** @override */
addToFixedLayer(element) {
return this.viewport_.addToFixedLayer(element, /* Force Transfer */ true);
}
}

/**
Expand Down
8 changes: 3 additions & 5 deletions extensions/amp-subscriptions/0.1/test/test-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ describes.realWin('AmpSubscriptions Dialog', {amp: true}, env => {
expect(styles.transform).to.not.contain('17');
expect(dialog.closeButton_).to.have.display('none');
expect(updatePaddingSpy).to.be.calledOnce.calledWith(17);
// TODO(dvoytenko, #20608): add to fixed layer, once the SwG/FL
// conflict is resolved.
// expect(addToFixedLayerSpy).to.be.calledOnce
// .calledWith(dialog.getRoot());
expect(addToFixedLayerSpy).to.not.be.called;
expect(addToFixedLayerSpy).to.be.calledOnce.calledWith(
dialog.getRoot()
);
expect(dialog.isVisible()).to.be.true;
});
});
Expand Down
4 changes: 3 additions & 1 deletion src/service/fixed-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,9 @@ export class FixedLayer {
opt_lightboxMode
) {
// Warn that pub-authored inline styles may be overriden by FixedLayer.
this.warnAboutInlineStylesIfNecessary_(element);
if (!opt_forceTransfer) {
this.warnAboutInlineStylesIfNecessary_(element);
}

// Ignore lightboxes because FixedLayer can interfere with their
// opening/closing animations (#19149).
Expand Down
19 changes: 18 additions & 1 deletion third_party/subscriptions-project/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** Version: 0.1.22.64 */
/** Version: 0.1.22.67 */
/**
* Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.
*
Expand Down Expand Up @@ -154,6 +154,15 @@ class Doc {
* @return {!Promise}
*/
whenReady() {}

/**
* Adds the element to the fixed layer.
* @param {!Element} unusedElement
* @return {!Promise}
*
* This is a no-op for except in AMP on iOS < 13.0.
*/
addToFixedLayer(unusedElement) {}
}

/** @implements {Doc} */
Expand Down Expand Up @@ -208,6 +217,11 @@ class GlobalDoc {
whenReady() {
return whenDocumentReady(this.doc_);
}

/** @override */
addToFixedLayer(unusedElement) {
return Promise.resolve();
}
}

/**
Expand Down Expand Up @@ -326,6 +340,9 @@ class PageConfig {
* Debug logger, only log message if #swg.log=1
* @param {...*} var_args [decription]
*/

/* eslint-disable */

function debugLog(var_args) {
if (/swg.debug=1/.test(self.location.hash)) {
const logArgs = Array.prototype.slice.call(arguments, 0);
Expand Down
Loading

0 comments on commit bd3d764

Please sign in to comment.