mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-30 14:17:36 -10:00
Per mixed-content-blocked spec, [1], <img srcset> and <picture> should be blocked. However we still fetch <img srcset> and <picture> in image preload, because they are fetched with contentPolicyType TYPE_INTERNAL_IMAGE_PRELOAD and won't be rejected by nsMixedContentBlocker.cpp. So I updated the image preloading code, and use the type TYPE_IMAGESET if the image request is for <picture> or <img srcset>, otherwise for normal image load we still use TYPE_INTERNAL_IMAGE_PRELOAD. [1]: https://w3c.github.io/webappsec-mixed-content/#should-block-fetch 4. Return allowed if one or more of the following conditions are met: request’s type is "image", and initiator is not "imageset". 5. Return blocked.