Agreed, the deviceorientation does work fine for relative orientation. I've been able to hack it for absolute orientation. What I am doing is: 1) taking the relative orientation euler angles from the event and converting them to a quaternion for easier manipulation. 2) taking the webkitCompassHeading from same deviceorientation event. 3) Calculating the "relative heading", eg how far the relative orientation is from its fake north. 4) calculating the difference between the relative and actual heading. 5) building a quaternion to describe the bearing difference, eg how far the relative orientation need to be corrected by spinning around the z-axis. 6) Multiply the two quaternions to get the final absolute orientation quaternion.
This does work, though has the issues I mentioned previously, and relies on the undocumented fact the the relative orientation is actually absolute with respect to the down/gravity vector.