Mobile support in MediaWiki core

Rationale
By default, MediaWiki does not offer mobile device-specific support, making MediaWiki sites very difficult to use on mobile devices. This has been mitigated in many ways by Extension:MobileFrontend, however there is much to be gained by building native mobile support into MediaWiki core. Such as:


 * Increased performance
 * A better framework for other extensions to make mobile-specific features
 * Out-of-the-box mobile support for MediaWiki sites
 * A present and future-ready device-agnostic core that can display data in a multitude of different ways, increasing MediaWiki's flexibility
 * Greater developer and end-user support by increasing exposure to mobile-specific issues

High Priority

 * Move DOM Parsing mechanism into MediaWiki core [Patrick]
 * Have current DOM parsing mechanism of MobileFrontend make greater use of memcached
 * Investigate caching possibilities and performance impact (Patrick going to talk to Tim/Domas)
 * Max has performance concerns moving parsing/extracts api into core; requires more investigation
 * Make MediaWiki handled mobile-specific user options native parser cache [Patrick]
 * View toggling and device detection [Arthur]
 * Make MediaWiki core context/device aware [Arthur]
 * straight override mode?
 * is there a mobile version of this skin?
 * Arthur's going to come up with suggestions about how to handle this and float to the tech lists
 * Migrate SpecialMobileOptions into core [Max]
 * wrap logic with checks for existence of $wgExtMobileFrontend
 * move view cookie handling into this class

Delayed

 * Migrate from using DOM parsing for mobile contexts to the native MediaWiki parser - The future (pending collaboration with VisualEditor team). [later]
 * Move OpenSearchXml extending code back into OpenSearchXml extension
 * Offer device-specific skins

Brainstorming notes
Brion's dream: One codebase to do everything except WAP
 * WAP support is just a couple kb of code, we already have a WML skin. 46.44.51.115

Parser conversion
DOM parser currently just strips out things that sould not be present in a mobile view
 * THIS SOULD BE REEVALUATED - are we stripping out the right elements? too many elements?

VisualEditor is going to result in core parser changes (Gabriel working on that?)
 * No idea about timeline (October-ish range?)
 * Can we work with them to make sure they're doing it right and/or get stuff migrated in as they go?

Parser changes are less cut-and-dry than DOM parser, so it's a little scarrier and will probably have a lot of edgey cases

Skinning

 * Can we extend existing skin?
 * Does it make more sense to have one mobile skin? Or let skins support mobile-stuff?
 * Mobile 'fallback' skin?

Special pages

 * Moving actions etc over to special pages will alleviate a lot of current pain points

Etc

 * Make Mediawiki aware of context (mobile or not)
 * for delivering proper URLs
 * Would enable more flexible mobile-specific URL construction
 * eg perhaps with a post-processing hook
 * for resource loading
 * view-related stuff like skin, blah
 * perhaps start by moving dom-parser into core and rely on memcache, rely on key from parser cache