|
|
Created:
Dec. 29, 2015, 3:38 p.m. by Sebastian Noack Modified:
Jan. 6, 2016, 4:51 p.m. Visibility:
Public. |
DescriptionIssue 3459 - Added content policy tests for <img srcset> and fetch()
Patch Set 1 #
Total comments: 2
MessagesTotal messages: 7
Besides the <picture> tag is supposed to be supported since Firefox 38, I simply couldn't make it work. No matter what I do, it never uses any image given by a <source> element. Not only, with my attempts, but also with all demos I could find on the web.
LGTM
Message was sent while issue was closed.
On 2015/12/29 15:44:49, Sebastian Noack wrote: > Besides the <picture> tag is supposed to be supported since Firefox 38, I simply > couldn't make it work. No matter what I do, it never uses any image given by a > <source> element. Not only, with my attempts, but also with all demos I could > find on the web. Please verify that dom.image.picture.enabled preference is enabled (by default it is but maybe you changed it in the past). https://codereview.adblockplus.org/29333104/diff/29333105/chrome/content/test... File chrome/content/tests/policy.js (right): https://codereview.adblockplus.org/29333104/diff/29333105/chrome/content/test... chrome/content/tests/policy.js:297: '<script>fetch("test.xml").catch(function() {});</script>', That's an async call, I don't think it is guaranteed to be done by the time the document's load event is fired. This should dispatch the abp:frameready event explicitly.
Message was sent while issue was closed.
On 2015/12/29 23:25:40, Wladimir Palant wrote: > On 2015/12/29 15:44:49, Sebastian Noack wrote: > > Besides the <picture> tag is supposed to be supported since Firefox 38, I > simply > > couldn't make it work. No matter what I do, it never uses any image given by a > > <source> element. Not only, with my attempts, but also with all demos I could > > find on the web. > > Please verify that dom.image.picture.enabled preference is enabled (by default > it is but maybe you changed it in the past). No, it is enabled. Did you ever managed to make the <picture> tag work? https://codereview.adblockplus.org/29333104/diff/29333105/chrome/content/test... File chrome/content/tests/policy.js (right): https://codereview.adblockplus.org/29333104/diff/29333105/chrome/content/test... chrome/content/tests/policy.js:297: '<script>fetch("test.xml").catch(function() {});</script>', On 2015/12/29 23:25:40, Wladimir Palant wrote: > That's an async call, I don't think it is guaranteed to be done by the time the > document's load event is fired. This should dispatch the abp:frameready event > explicitly. Acknowledged. There you go: https://codereview.adblockplus.org/29333123
Message was sent while issue was closed.
On 2015/12/30 15:46:20, Sebastian Noack wrote: > No, it is enabled. Did you ever managed to make the <picture> tag work? Yes, I did. On http://googlechrome.github.io/samples/picture-element/ I can see the right kitten image (Diagnostics shows http://googlechrome.github.io/samples/picture-element/images/kitten-large.png being loaded as IMAGESET, fallback is http://googlechrome.github.io/samples/picture-element/images/kitten-small.png). The butterfly image falls back to <img> however, no WebP support I guess.
Message was sent while issue was closed.
On 2016/01/06 13:05:02, Wladimir Palant wrote: > On 2015/12/30 15:46:20, Sebastian Noack wrote: > > No, it is enabled. Did you ever managed to make the <picture> tag work? > > Yes, I did. On http://googlechrome.github.io/samples/picture-element/ I can see > the right kitten image (Diagnostics shows > http://googlechrome.github.io/samples/picture-element/images/kitten-large.png > being loaded as IMAGESET, fallback is > http://googlechrome.github.io/samples/picture-element/images/kitten-small.png). Hmm, that example doesn't work either on Firefox/Iceweasel 42 on Debian Linux. However, window.HTMLPictureElement exists.
Message was sent while issue was closed.
On 2016/01/06 13:40:03, Sebastian Noack wrote: > On 2016/01/06 13:05:02, Wladimir Palant wrote: > > On 2015/12/30 15:46:20, Sebastian Noack wrote: > > > No, it is enabled. Did you ever managed to make the <picture> tag work? > > > > Yes, I did. On http://googlechrome.github.io/samples/picture-element/ I can > see > > the right kitten image (Diagnostics shows > > http://googlechrome.github.io/samples/picture-element/images/kitten-large.png > > being loaded as IMAGESET, fallback is > > > http://googlechrome.github.io/samples/picture-element/images/kitten-small.png). > > Hmm, that example doesn't work either on Firefox/Iceweasel 42 on Debian Linux. > However, window.HTMLPictureElement exists. I figured it out. The issue was that the <picture> is never rendered or loaded when there is no <img> tag inside, even though the <img> tag is only used as fallback. However, as the inspector always highlights the inner <img> tag when selecting the picture and removing it is causing the picture to be hidden, I assumed that only the <img> tag is used. I'm not sure if this is a bug. But simply adding an empty <img> tag does the trick. Here is a new patch: https://codereview.adblockplus.org/29333270 |