Bug 204521

Summary: Media queries in img sizes attribute don't evaluate dynamically
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, dbates, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jer.noble, kangil.han, kondapallykalyan, macpherson, menard, pdr, philipj, sergio, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
patch
simon.fraser: review+
patch none

Description Antti Koivisto 2019-11-22 09:13:37 PST
There is no code for evaluating on viewport etc changes.
Comment 1 Antti Koivisto 2019-11-22 09:34:42 PST
Created attachment 384160 [details]
patch
Comment 2 Antti Koivisto 2019-11-22 09:41:08 PST
Created attachment 384161 [details]
patch
Comment 3 Simon Fraser (smfr) 2019-11-22 12:47:28 PST
Comment on attachment 384161 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=384161&action=review

> LayoutTests/fast/images/sizes-dynamic-001.html:5
> +<link rel="match" href="sizes-dynamic-001-ref.html">

Please fix this to point to the real ref file.

> LayoutTests/fast/images/sizes-dynamic-002.html:5
> +<link rel="match" href="sizes-dynamic-001-ref.html">

Ditto.

> Source/WebCore/dom/Document.h:1829
> +    HashSet<HTMLImageElement*> m_dynamicMediaQueryDependentImages;

Are we still using raw pointers for stuff like this?
Comment 4 Antti Koivisto 2019-11-22 12:58:03 PST
> Are we still using raw pointers for stuff like this?

We don't have WeakPtrs for Elements yet. But maybe I could add it for HTMLImageElement.
Comment 5 Antti Koivisto 2019-11-23 00:57:08 PST
> We don't have WeakPtrs for Elements yet. But maybe I could add it for
> HTMLImageElement.

I'm wrong, ContainerNodes are already CanMakeWeakPtr.
Comment 6 Antti Koivisto 2019-11-23 01:36:42 PST
Created attachment 384233 [details]
patch
Comment 7 WebKit Commit Bot 2019-11-23 02:19:50 PST
Comment on attachment 384233 [details]
patch

Clearing flags on attachment: 384233

Committed r252828: <https://trac.webkit.org/changeset/252828>
Comment 8 WebKit Commit Bot 2019-11-23 02:19:52 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2019-11-23 02:20:20 PST
<rdar://problem/57451085>