Closed Bug 1065119 Opened 11 years ago Closed 9 years ago

Setting img src when <picture> source is in use incorrectly adds fallback source

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: johns, Assigned: edgar, Mentored)

References

()

Details

(Whiteboard: [tw-dom])

HTMLImageElement::AfterSetAttr doesn't check that the responsive source == self before updating the default source, so in the situation where you have a <picture> using a <source> that only provides > 1x density, we incorrectly pick up the img.src as a 1x density fallback if it is set afterwards. This is caught by the tests for bug 1023519 but is also unfortunately being hit by this blog post about <picture>: https://longhandpixels.net/blog/2014/02/complete-guide-picture-element
Whiteboard: [tw-dom]
Assignee: john → nobody
Status: ASSIGNED → NEW
Mentor: josh
Assignee: nobody → echen
HTMLImageElement already checks |responsive source == self| before updating the default source, - https://dxr.mozilla.org/mozilla-central/source/dom/html/HTMLImageElement.cpp#429-432 - https://dxr.mozilla.org/mozilla-central/source/dom/html/HTMLImageElement.cpp#539-542 I also write a simple test to verify it, http://codepen.io/edgarchen/pen/ZWKMmm. And current code seems work good. Hi Josh, does this bug still exist? Or I'm missing something? Thank you.
Flags: needinfo?(josh)
You're right. Thank you for verifying it!
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(josh)
Resolution: --- → WORKSFORME
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.