Remove hack to avoid iOS Safari menu bar area tap stealing

Explanation of what this code was for: T227628#5339392

As noted on that task, our behavior is actually unintuitive and
distracting, and iOS Safari limitations prevent us from doing it
better.

This reverts commit 600e369347.

Bug: T227628
Change-Id: Id1a5eebd06e4218e3e102165c60791999293d273
This commit is contained in:
Bartosz Dziewoński 2019-07-29 21:48:33 +02:00
parent dfb7f7d4a3
commit f525f63b03
2 changed files with 0 additions and 40 deletions

View file

@ -94,11 +94,3 @@
max-width: 995px;
margin: 0 auto;
}
.ve-init-mw-mobileArticleTarget-iosScreenMeasure {
position: absolute;
top: 0;
left: 0;
height: 100vh;
width: 1px;
}

View file

@ -103,34 +103,6 @@ ve.init.mw.MobileArticleTarget.prototype.activateSurfaceForToolbar = function ()
}
};
ve.init.mw.MobileArticleTarget.prototype.updateIosContextPadding = function () {
var browserMenuCollapsedHeight, currentHeight;
if ( !this.$screenMeasure ) {
this.$screenMeasure = $( '<div>' ).addClass( 've-init-mw-mobileArticleTarget-iosScreenMeasure' );
}
this.$screenMeasure.appendTo( document.body );
// This element is sized using 'vh' units, which iOS does not actually update to match the
// viewport when viewport size changes due to browser menu bar collapsing/expanding.
browserMenuCollapsedHeight = this.$screenMeasure.height();
this.$screenMeasure.detach();
currentHeight = window.innerHeight;
if ( browserMenuCollapsedHeight === currentHeight ) {
// Looks like the browser menu bar is collapsed. Tapping near the bottom of the screen will not
// trigger any events on our widgets, but instead it will expand the browser menu bar. Reserve
// some space where the browser menu bar will appear.
this.surface.getContext().$element.css( 'padding-bottom', 44 );
} else {
// Looks like the browser menu is expanded, so we can remove the silly padding. Even if our
// check here breaks in future versions of iOS, that's okay, the user will just need to tap
// things in this area twice.
this.surface.getContext().$element.css( 'padding-bottom', 0 );
}
};
/**
* @inheritdoc
*/
@ -152,10 +124,6 @@ ve.init.mw.MobileArticleTarget.prototype.onContainerScroll = function () {
surfaceView = this.surface && this.surface.getView(),
isActiveWithKeyboard = surfaceView && surfaceView.isFocused() && !surfaceView.isDeactivated();
if ( ve.init.platform.constructor.static.isIos() ) {
this.updateIosContextPadding();
}
// On iOS Safari, when the keyboard is open, the layout viewport reported by the browser is not
// updated to match the real viewport reduced by the keyboard (diagram: T218414#5027607). On all
// modern non-iOS browsers the layout viewport is updated to match real viewport.