Skip to content
This repository was archived by the owner on Dec 28, 2024. It is now read-only.
This repository was archived by the owner on Dec 28, 2024. It is now read-only.

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

@ArthurJahn

Description

@ArthurJahn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions