jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/374404 )
Change subject: Hygiene: Remove checks for Android2
......................................................................
Hygiene: Remove checks for Android2
Android2 is now a grade C browser, so we don't run JS there,
thus this code is dead.
Change-Id: I2086f7083e94e4ea5a79436317ac43fc31a622fa
---
M resources/mobile.editor.common/EditorOverlayBase.js
M resources/mobile.editor.common/editor.less
M resources/mobile.startup/browser.js
M tests/qunit/mobile.startup/test_browser.js
4 files changed, 1 insertion(+), 44 deletions(-)
Approvals:
jenkins-bot: Verified
Jdlrobson: Looks good to me, approved
diff --git a/resources/mobile.editor.common/EditorOverlayBase.js
b/resources/mobile.editor.common/EditorOverlayBase.js
index ebb2f9f..6a64da2 100644
--- a/resources/mobile.editor.common/EditorOverlayBase.js
+++ b/resources/mobile.editor.common/EditorOverlayBase.js
@@ -1,7 +1,6 @@
( function ( M, $ ) {
var Overlay = M.require( 'mobile.startup/Overlay' ),
PageGateway = M.require( 'mobile.startup/PageGateway' ),
- browser = M.require( 'mobile.startup/Browser' ).getSingleton(),
Icon = M.require( 'mobile.startup/Icon' ),
toast = M.require( 'mobile.startup/toast' ),
user = M.require( 'mobile.startup/user' );
@@ -258,10 +257,6 @@
},
/** @inheritdoc **/
postRender: function () {
- // Add a class so editor can make some Android 2
specific customisations.
- if ( browser.isAndroid2() ) {
- this.$el.addClass( 'android-2' );
- }
// log edit attempt
this.log( {
action: 'ready'
diff --git a/resources/mobile.editor.common/editor.less
b/resources/mobile.editor.common/editor.less
index 264ac8d..57df50a 100644
--- a/resources/mobile.editor.common/editor.less
+++ b/resources/mobile.editor.common/editor.less
@@ -58,9 +58,3 @@
min-width: 30px;
}
}
-
-// FIXME: high line-height (1.5) causes weird behavior in textareas on
-// Android 2.x, remove this if we don't want to support editor there
-.android2.editor-overlay textarea {
- line-height: 1.2;
-}
diff --git a/resources/mobile.startup/browser.js
b/resources/mobile.startup/browser.js
index faa2c23..1675301 100644
--- a/resources/mobile.startup/browser.js
+++ b/resources/mobile.startup/browser.js
@@ -36,9 +36,6 @@
function Browser( ua, $container ) {
this.userAgent = ua;
this.$el = $container;
- if ( this.isAndroid2() ) {
- this.lockViewport();
- }
this._fixIosLandscapeBug();
}
@@ -97,14 +94,6 @@
}
},
/**
- * Determine if a device is Android 2.
- * @method
- * @return {boolean}
- */
- isAndroid2: memoize( function () {
- return /Android 2/.test( this.userAgent );
- } ),
- /**
* Determine if a device has a widescreen.
* @method
* @return {boolean}
@@ -138,13 +127,6 @@
* @return {boolean}
*/
supportsAnimations: memoize( function () {
- // don't trust Android 2.x, really
- // animations cause textareas to misbehave on it
- // (http://stackoverflow.com/a/5734984/365238)
- if ( this.isAndroid2() ) {
- return false;
- }
-
return this.supportsCSSProperty( 'animationName' ) &&
this.supportsCSSProperty( 'transform' ) &&
this.supportsCSSProperty( 'transition' );
diff --git a/tests/qunit/mobile.startup/test_browser.js
b/tests/qunit/mobile.startup/test_browser.js
index 319a731..bc86891 100644
--- a/tests/qunit/mobile.startup/test_browser.js
+++ b/tests/qunit/mobile.startup/test_browser.js
@@ -21,7 +21,7 @@
assert.strictEqual( browser5.isIos( 5 ), true );
} );
- QUnit.test( 'Methods are cached', 15, function ( assert ) {
+ QUnit.test( 'Methods are cached', 8, function ( assert ) {
var ipad = new Browser( 'Mozilla/5.0 (iPad; CPU OS 7_0 like Mac
OS X) AppleWebKit/537.51.1 (KHTML, like Gecko)', $html ),
iphone = new Browser( 'Mozilla/5.0 (iPhone; CPU iPhone
OS 8_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/8.0
Mobile/11A465 Safari/9537.53', $html ),
android2 = new Browser( 'Android 2', $html );
@@ -34,28 +34,14 @@
// cache and don't interfere with one another
assert.strictEqual( ipad.isIos(), true );
assert.strictEqual( ipad.isIos( 8 ), false );
- assert.strictEqual( ipad.isAndroid2(), false );
- assert.strictEqual( android2.isAndroid2(), true );
assert.strictEqual( android2.isIos( 8 ), false );
assert.strictEqual( iphone.isIos(), true );
assert.strictEqual( iphone.isIos( 8 ), true );
- assert.strictEqual( iphone.isAndroid2(), false );
// Check that the caches have been filled
- // NOTE: In the constructor isAndroid2 is called with empty
- // so account for that on the assertions:
assert.strictEqual( Object.keys( cache( ipad, 'isIos' )
).length, 2, 'isIos on ipad cached as expected' );
- assert.strictEqual( Object.keys( cache( ipad, 'isAndroid2' )
).length, 1, 'isAndroid2 on ipad cached as expected' );
assert.strictEqual( Object.keys( cache( android2, 'isIos' )
).length, 1, 'isIos on android cached as expected' );
- assert.strictEqual( Object.keys( cache( android2, 'isAndroid2'
) ).length, 1, 'isAndroid2 on android2 cached as expected' );
- assert.strictEqual( Object.keys( cache( iphone, 'isAndroid2' )
).length, 1, 'isAndroid2 on iphone cached as expected' );
assert.strictEqual( Object.keys( cache( iphone, 'isIos' )
).length, 2, 'isIos on iphone cached as expected' );
-
- // Mess up the cache and see if the objects return the correct
value when
- // called again with the same arguments
- cache( ipad, 'isAndroid2' )[ '' ] = 'for sure';
- assert.strictEqual( ipad.isAndroid2(), 'for sure' );
-
} );
}( jQuery, mw.mobileFrontend ) );
--
To view, visit https://gerrit.wikimedia.org/r/374404
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2086f7083e94e4ea5a79436317ac43fc31a622fa
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Jhernandez <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Pmiazga <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits