PolymerElements/iron-image

Loaded never changes when url encoded img.src differs from provided src

Opened this issue · 0 comments

Description

When the src provided contains white spaces or special chars, the image.$.img.src and src differs. This causes the _imgOnLoad and _imgOnError validation to return and not propagate the loaded, loading and error properties.

Just changed this:

if (this.$.img.src !== this._resolveSrc(this.src)) {
          return;
}
//[...]

To this:

if (decodeURI(this.$.img.src) !== this._resolveSrc(this.src)) {
          return;
}
//[...]

And fixed it. Let me know if this should be the solution to this issue.

Expected outcome

Placeholder to be presented and then the image when loaded.

Actual outcome

Placeholder is presented but the image never loads.

Steps to reproduce

Provide an image src with white spaces and a placeholder.

Browsers Affected

  • Chrome
  • Firefox
  • Safari 10
  • Safari 9
  • Edge
  • IE 11