Open Bug 1415116 Opened 3 years ago Updated 3 years ago
When an <img> referencing a missing/corrupt image is reinserted into the document it should look the same
When: https://dxr.mozilla.org/mozilla-central/source/image/test/reftest/pngsuite-corrupted/wrapper.html?x00n0g01.png is opened via a file:// URL (as it is when run as a reftest) and the following script is run: let img = document.images; let parent = img.parentNode; let nextSibling = img.nextSibling; img.parentNode.removeChild(img); parent.insertBefore(img, nextSibling); the effect is to remove the <img> element, then reinsert it back where it was. This should not change the rendering of the document. It should continue to display a blank page, but instead the blue background of the image now shows.
Note that the behavior is different again when loaded via https:// - now a stock "broken image" icon appears.
Summary: When an <img> referencing a corrupt image is reinserted into the document it should look the same → When an <img> referencing a missing/corrupt image is reinserted into the document it should look the same
With the initial loading, gCS returns "auto" for width and height of the <img>. Since image frame is eReplace, according to code in nsComputedDOMStyle  I think the only possible reason that it returns a non-numeric value would be that it has no frame at all. So I guess the problem here is that in this case we don't create the frame at the initial loading, and we create one when we reinsert it.  https://searchfox.org/mozilla-central/rev/fb5422ff98ba43f3732debd9d1f4dcd3b3a920f6/layout/style/nsComputedDOMStyle.cpp#5277-5290
You need to log in before you can comment on or make changes to this bug.