My patch in bug 569342 performs the checks in a different order, so Gavin must have commented on it IRL, but I forget what the reasoning behind the change was.
Why does this matter? I wouldn't expect there to be a significant difference between docElt.getAttribute vs. the two schemeIs calls.
Created attachment 585284 [details] [diff] [review] patch The discussion in bug 384412 reminded me of this again. Even if it may end up not mattering, we should, on principle, access content as late as possible.