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)
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
Updated•9 years ago
|
Whiteboard: [tw-dom]
Updated•9 years ago
|
Assignee: john → nobody
Status: ASSIGNED → NEW
Updated•9 years ago
|
Mentor: josh
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → echen
| Assignee | ||
Comment 1•9 years ago
|
||
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)
Comment 2•9 years ago
|
||
You're right. Thank you for verifying it!
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(josh)
Resolution: --- → WORKSFORME
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•