Page MenuHomePhabricator

[SPIKE: 2hrs] Should we remove supportsPositionFixed and Skin#setupPositionFixedEmulation?
Closed, ResolvedPublic

Description

What

browser#supportsPositionFixed and Skin#setupPositionFixedEmulation seem to be unused/useless in MobileFrontend since December 2014. Either the code is not needed or there are a bunch of features broken on a bunch of devices.

Info

@Jhernandez via email:

I've been doing some digging, it seems like more than 18months ago we moved the position fixed fallback around to the skin, and in the process migrated a window.on(scroll) to be on mw.mobileFrontend as an event (like resize), but the migrated code was listening to events on Skin (when it should've listened to the ones in mw.mobileFrontend).

I believe Skin and mw.mobileFrontend to be different event emitters, which means that since Dec 2014 the fallback code for position fixed hasn't been running.

So either it wasn't really needed, or there's a lot of broken clients out there we don't know about.

It may also be the case that usage of those old devices is so low that we haven't heard anything.

I'd appreciate some help figuring out what to do. My first instinct is to remove both the fallback and the supportsPositionFixed method of browser given they haven't been running for years.

@phuedx via email:

Analytic's UA breakdown report might help you here – with the old device usage part of the question at least.

Questions

  • What (if anything) is broken and where? In particular we should review real old iOS devices to check the experiences there.
  • Should we remove supportsPositionFixed and Skin#setupPositionFixedEmulation or fix them?

Outcomes

  • Questions answered and discussed
  • Subtasks created for fixing the code or removing it from the codebase with a good specification of which devices are affected and how to test.

Event Timeline

jhobs moved this task from Incoming to 2016-17 Q2 on the Web-Team-Backlog board.
MBinder_WMF renamed this task from Should we remove supportsPositionFixed and Skin#setupPositionFixedEmulation? to [SPIKE - 2 hrs] Should we remove supportsPositionFixed and Skin#setupPositionFixedEmulation?.Aug 24 2016, 4:18 PM
MBinder_WMF renamed this task from [SPIKE - 2 hrs] Should we remove supportsPositionFixed and Skin#setupPositionFixedEmulation? to [SPIKE: 2hrs] Should we remove supportsPositionFixed and Skin#setupPositionFixedEmulation?.
dr0ptp4kt set the point value for this task to 2.Aug 24 2016, 4:20 PM
Jhernandez renamed this task from [SPIKE: 2hrs] Should we remove supportsPositionFixed and Skin#setupPositionFixedEmulation? to [2hrs] Should we remove supportsPositionFixed and Skin#setupPositionFixedEmulation?.Aug 24 2016, 4:20 PM
Jhernandez removed the point value for this task.
MBinder_WMF renamed this task from [2hrs] Should we remove supportsPositionFixed and Skin#setupPositionFixedEmulation? to [SPIKE: 2hrs] Should we remove supportsPositionFixed and Skin#setupPositionFixedEmulation?.Aug 24 2016, 4:38 PM

What (if anything) is broken and where? In particular we should review real old iOS devices to check the experiences there.

Nothing seems broken. We can safely remove the code. Compare these screencasts:

  1. iOS 3 / iPhone 3GS

a) Listening to Skin's scroll event:

ios3 - listening to skin.gif (645×341 px, 1 MB)

b) Listening to MobileFrontend's scroll event (i.e. window.scroll):

ios3 - listening to M.gif (645×341 px, 2 MB)

  1. IE 9 / Windows 7

a) Listening to Skin's scroll event:

IE9 - skin.gif (627×785 px, 5 MB)

b) Listening to MobileFrontend's scroll event (i.e. window.scroll):

IE9 - M.gif (627×785 px, 5 MB)

Besides, changing of the window's height happens for all matching browsers but the value is only amended for old iOS device.

And lastly, these changes may have been developed with mobile editing in mind, but mobile editing is disabled on these browsers (A toast message shows up when the user clicks on the edit icon.)

Should we remove supportsPositionFixed and Skin#setupPositionFixedEmulation or fix them?

Remove. We can close T143337 and work on T144558.

Remove. We can close T143337 and work on T144558.

👍

Sounds good @bmansurov but I'd recommend someone with a real ios device (the older the better) gives this a quick sanity check given emulators and real devices can have a different behaviour. Who in the team has one?

Nice. My oldest ones are ipad 2 and iphone 4 with ios 9, so may not qualify...

Let's see if somebody else can confirm

Given the special casing of <textarea> and <input> elements in Skin#setupPositionFixedEmulation, I tested searching and editing on a physical iPod Touch running iOS 6.1.6 (10B500) on our staging server. Before I started the test I made sure that the server was up to date by running the following:

ssh reading-web-staging-3
cd /srv/mediawiki-vagrant
vagrant git-update

Both features worked as expected – I was able to edit a page without issue.

Jhernandez claimed this task.

T144558 is going to need triage.

Resolving this given the results of the spike.

Thanks all.

Sorry - while reviewing the patch to remove these I noticed this would impact drawers which made me realise we didn't test references in older browsers.

Would be great to get confirmation removing the emulation won't break anything with this key feature.

I just checked references on iOS 3 on IPhone 3GS with and without removing the code as suggested. In both cases references are broken and don't stick to the bottom of the page.

Thanks @bmansurov for your diligence!