Page MenuHomePhabricator

Ensure lazy-created image retains all attributes
Closed, ResolvedPublic

Description

Filing as reminder from https://gerrit.wikimedia.org/r/#/c/275670/2/resources/mobile.startup/Skin.js. Right now the srcset width and height class attributes are missing from the javascript-created image. Which causes it to render at the wrong dimensions if the image dimensions vary from the original.

This is the case in at least two scenarios:

  • HiDPI srcset.
  • Images smaller than the desired thumbnail size (blown up intentionally by the author).

Event Timeline

Change 275670 had a related patch set uploaded (by Jdlrobson):
Use the src attribute Luke

https://gerrit.wikimedia.org/r/275670

Change 275670 merged by jenkins-bot:
Use the src attribute Luke

https://gerrit.wikimedia.org/r/275670

It's also missing a class attribute (set to thumbimage) which may result in a style regression.

It also seems like a spurious border-radius rule remains active even after the image has finished loading which results in a rendering difference between lazyload vs non-lazyload.

Change 277570 had a related patch set uploaded (by Jdlrobson):
Pass class to the lazy loaded image

https://gerrit.wikimedia.org/r/277570

phuedx triaged this task as High priority.Mar 17 2016, 5:09 PM
Jdlrobson lowered the priority of this task from High to Low.Mar 17 2016, 5:11 PM
Jdlrobson renamed this task from Ensure lazy-created image has all relevant attributes to Ensure lazy-created image retains all attributes.Mar 22 2016, 4:17 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)

As mentioned above, the border-radius rule needs some work.

Change 277570 merged by jenkins-bot:
Pass class to the lazy loaded image

https://gerrit.wikimedia.org/r/277570

Opened T130652 for that issue which is tangential from the task.