brentonashworth/one — Issue #108: Android browser requires xpath.js
Author: djpowell
Created: 2012-02-04 12:00:25+00:00
State: open

XPath fails on Android for a few XPath-related reasons:

1) The Android 2.x browser doesn't support XPath

2) The conditional comment only loads xpath.js for IE, but it is also needed on Android

3) Android 2.x wrongly returns true to the test:
doc.implementation.hasFeature("XPath", null)

So even if you include the script, xpath.js doesn't install itself by default because it assumes that there is a working implementation already available. Android doesn't actually have document.evaluate, or any other XPath APIs.

So, to get Android working, we need to:

a) detect it
b) load xpath.js
c) explicitly override the broken native implementation

Android 2.x is the version of Android currently used on nearly all
Android phones, according to:
http://developer.android.com/resources/dashboard/platform-versions.html

It would be nice to have android working to show clojurescript as a viable cross-platform mobile technology.