<picture> elements fire load event on removal
Reported by
dar...@verbalplusvisual.com,
Apr 18 2018
|
|
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 Steps to reproduce the problem: 1. Create a picture element with multiple working source child-elements. 2. Attach load event handler to img tag within picture element. 3. Remove picture element or any of its parent elements from DOM 4. Check console logs to see load event firing upon removal of the picture element from the DOM What is the expected behavior? Removing a picture element or any of its children should not fire any load events. What went wrong? Removing a picture element or any of its children causes firing of load events. Did this work before? N/A Does this work in other browsers? Yes Chrome version: 65.0.3325.181 Channel: n/a OS Version: OS X 10.13.4 Flash Version: Reproduction: https://jsfiddle.net/w0s4xmc0/5330/
,
Apr 18 2018
Thanks, that's helpful!
,
Apr 27 2018
It looks like we are treating this case as a "relevant mutation" [1], even though neither the <source> nor the <img> are actually removed from the <picture> (the <picture> is still their parent.) Hence we shouldn't run the steps to "update the image data". Looks like this case has been conflated with the case where the <source> is actually removed from the <picture>. [1] https://html.spec.whatwg.org/multipage/images.html#reacting-to-dom-mutations
,
Apr 27 2018
It looks like this may be covered by the following WPT: html/semantics/embedded-content/the-img-element/relevant-mutations.html |
|
►
Sign in to add a comment |
|
Comment 1 by schenney@chromium.org
, Apr 18 2018Status: Available (was: Unconfirmed)
1.2 KB
1.2 KB View Download