Skip to content

Commit

Permalink
Revert "Disable x-scrolling on iOS when iframed (#27319)" (#27422)
Browse files Browse the repository at this point in the history
This reverts commit 17636f5.
  • Loading branch information
Dima Voytenko committed Mar 26, 2020
1 parent 6eb5881 commit d328abc
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 37 deletions.
11 changes: 0 additions & 11 deletions css/ampdoc.css
Expand Up @@ -76,17 +76,6 @@ html.i-amphtml-fie > body {
overflow: visible !important;
}

/**
* iOS jitters when body overflows. See b/149328043. Notice that the min-height
* essentially cancels `height: auto` from above.
*/
html.i-amphtml-singledoc.i-amphtml-iframed:not(.i-amphtml-ios-embed):not([amp4ads]) > body {
overflow-x: hidden !important;
overflow-y: visible !important;
min-height: calc(100vh - var(--i-amphtml-padding-top, 0px));
}


/**
* The `position: relative` is necessary to ensure that `paddingTop` can be
* applied to a document to offset the header height, and it doesn't missplace
Expand Down
5 changes: 0 additions & 5 deletions extensions/amp-iframe/0.1/test/test-amp-iframe.js
Expand Up @@ -77,11 +77,6 @@ describes.realWin(
content = message.data.replace('content-iframe:', '');
}
});
// TODO(dvoytenko): checked manually and it works, but for some
// reason the scrolling does not trigger on the scrollElement in
// the integration test. Thus disabling `i-amphtml-iframed` here
// for now.
doc.documentElement.classList.remove('i-amphtml-iframed');
setTrackingIframeTimeoutForTesting(20);
});

Expand Down
Expand Up @@ -91,11 +91,6 @@ describe
const openerButton = win.document.getElementById('sidebarOpener');
const sidebar = win.document.getElementById('sidebar1');
const viewport = sidebar.implementation_.getViewport();
// TODO(dvoytenko): checked manually and it works, but for some
// reason the scrolling does not trigger on the scrollElement in
// the integration test. Thus disabling `i-amphtml-iframed` here
// for now.
win.document.documentElement.classList.remove('i-amphtml-iframed');
const openedPromise = waitForSidebarOpen(win.document);
openerButton.click();
expect(viewport.getScrollTop()).to.equal(0);
Expand Down
Expand Up @@ -91,11 +91,6 @@ describe
const openerButton = win.document.getElementById('sidebarOpener');
const sidebar = win.document.getElementById('sidebar1');
const viewport = sidebar.implementation_.getViewport();
// TODO(dvoytenko): checked manually and it works, but for some
// reason the scrolling does not trigger on the scrollElement in
// the integration test. Thus disabling `i-amphtml-iframed` here
// for now.
win.document.documentElement.classList.remove('i-amphtml-iframed');
const openedPromise = waitForSidebarOpen(win.document);
openerButton.click();
expect(viewport.getScrollTop()).to.equal(0);
Expand Down
1 change: 0 additions & 1 deletion src/service/viewport/viewport-binding-natural.js
Expand Up @@ -138,7 +138,6 @@ export class ViewportBindingNatural_ {
updatePaddingTop(paddingTop) {
setImportantStyles(this.win.document.documentElement, {
'padding-top': px(paddingTop),
'--i-amphtml-padding-top': px(paddingTop),
});
}

Expand Down
10 changes: 0 additions & 10 deletions test/unit/test-viewport-binding.js
Expand Up @@ -73,16 +73,6 @@ describes.realWin('ViewportBindingNatural', {ampCss: true}, env => {
expect(bodyStyles.overflowY).to.not.equal('hidden');
});

it('should override body overflow for iframes', () => {
win.document.documentElement.classList.add('i-amphtml-iframed');
win.document.documentElement.classList.add('i-amphtml-singledoc');
binding = new ViewportBindingNatural_(ampdoc);
const bodyStyles = win.getComputedStyle(win.document.body);
expect(bodyStyles.position).to.equal('relative');
expect(bodyStyles.overflowX).to.equal('hidden');
expect(bodyStyles.overflowY).to.not.equal('hidden');
});

it('should NOT require fixed layer transferring', () => {
expect(binding.requiresFixedLayerTransfer()).to.be.false;
});
Expand Down

0 comments on commit d328abc

Please sign in to comment.