URL comparison fails in IE8

The W3C standard says that setAttribute/getAttribute on any DOM element is
a simple setter/getter thing. IE8 tries to be smarter and returns the full
URL when calling getAttribute('src') on an image instead of the one that
was set with setAttribute('src').

This change makes sure that urls are compared properly, also in IE8.
Merge pull request #954 from ahocevar/url-compare

URL comparison fails in IE8. r=@bartvde