With the new DOM bindings and overload resolution, we actually know coming in what sort of element we have, so there's no need to redetect it.
Created attachment 628601 [details] [diff] [review]
Break out the three branches of SurfaceFromElement into separate functions so that we can call the one that matches the kind of element we have directly.
Backed out because I had to back out bug 748266.
And relanded: https://hg.mozilla.org/integration/mozilla-inbound/rev/aeca3790f053