[Webkit-unassigned] [Bug 222801] Wrong image displayed for <picture> elements created through JavaScript

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 6 23:57:22 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=222801

Cameron McCormack (:heycam) <heycam at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |heycam at apple.com,
                   |                            |rbuis at igalia.com
           Assignee|webkit-unassigned at lists.web |heycam at apple.com
                   |kit.org                     |

--- Comment #3 from Cameron McCormack (:heycam) <heycam at apple.com> ---
Thanks for the reduced test case, Marvin.

Rob, this issue looks to be a regression from https://trac.webkit.org/changeset/263345/webkit.  This is because when doing things in this order:

  * create source element
  * set source element's media attribute
  * create picture element
  * append source element to picture element
  * insert picture element into document

we never end up registering the <img> as a dynamic media query dependent image with the document.  This is because we only get into selectImageSource() in response to the attribute changes, which happen before the <img> has a <picture> parent, and so we don't get to the addDynamicMediaQueryDependentImage() call.

What's the purpose of checking whether a newly inserted <picture> element is in the document here:

https://webkit-search.igalia.com/webkit/rev/2ba963a3b7c21a24310b76fbdfa2d72b0eefbb81/Source/WebCore/html/HTMLImageElement.cpp#387-390

If we always called selectImageSource() here regardless of whether the <picture> is already in the document, that should cause us to correctly track MQ result changes.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210407/58073272/attachment.htm>


More information about the webkit-unassigned mailing list