Bringing back https://codereview.chromium.org/1256233002/ to life. This CL makes
sure that data URIs are loaded async according to spec.
That would avoid situations where users see "flash of broken image" and would
align our implementation with everyone else's.
pdr.
On 2015/12/03 at 13:15:07, yoav wrote: > Bringing back https://codereview.chromium.org/1256233002/ to life. This CL makes ...
On 2015/12/03 at 13:15:07, yoav wrote:
> Bringing back https://codereview.chromium.org/1256233002/ to life. This CL
makes sure that data URIs are loaded async according to spec.
>
> That would avoid situations where users see "flash of broken image" and would
align our implementation with everyone else's.
I still think we're conflating two issues here:
1) data urls loading synchronously. For the reasons in
https://github.com/ResponsiveImagesCG/picture-element/issues/223#issuecomment...
I'm still skeptical that this is a spec violation or even a bug, particularly
from the user's perspective.
2) async timing issues with picture source selection in the presence of broken
images.
I'm really not dead-set on my position on #1, I just think we should be looking
at that issue by itself.
For #2, we still return cached images synchronously so I think the bug will
still exist. For example, couldn't we cache a broken image, or synchronously
fail for cross-origin reasons, or even just lose the data race with a
filesystem-loaded broken image?
What about just delaying showing a broken image until all pending source
requests have finished at which point we know the image is truly broken?
Yoav Weiss
On 2015/12/03 20:12:37, pdr wrote: > On 2015/12/03 at 13:15:07, yoav wrote: > > Bringing ...
On 2015/12/03 20:12:37, pdr wrote:
> On 2015/12/03 at 13:15:07, yoav wrote:
> > Bringing back https://codereview.chromium.org/1256233002/ to life. This CL
> makes sure that data URIs are loaded async according to spec.
> >
> > That would avoid situations where users see "flash of broken image" and
would
> align our implementation with everyone else's.
>
> I still think we're conflating two issues here:
> 1) data urls loading synchronously. For the reasons in
>
https://github.com/ResponsiveImagesCG/picture-element/issues/223#issuecomment...
> I'm still skeptical that this is a spec violation or even a bug, particularly
> from the user's perspective.
I hoped I addressed your skepticism at
https://github.com/ResponsiveImagesCG/picture-element/issues/223#issuecomment...
Yes, in Safari images are loaded synchronously, but I'm hoping that won't be the
case for much longer. Now that proper microtasks have landed, async image
loading support is probably next: https://bugs.webkit.org/show_bug.cgi?id=134488
All other browsers now load images (including data URIs) async, and it would be
better for compat to align with that behavior.
> 2) async timing issues with picture source selection in the presence of broken
> images.
>
> I'm really not dead-set on my position on #1, I just think we should be
looking
> at that issue by itself.
>
> For #2, we still return cached images synchronously so I think the bug will
> still exist.
There could still be a "flash of cached image", yes. We would need to figure out
a mechanism that prevents that.
> For example, couldn't we cache a broken image, or synchronously
> fail for cross-origin reasons, or even just lose the data race with a
> filesystem-loaded broken image?
>
> What about just delaying showing a broken image until all pending source
> requests have finished at which point we know the image is truly broken?
From my perspective, this CL addresses #1 and we would still need to address #2
as a separate issue, even if the CL mitigates #2 to some extent.
I see, this is the proposal to switch to synchronous datauri images. I
misunderstood and thought it was for #2.
Can you think of a case where we would be one frame "behind" because of async
image loading, or cases where this would cause 2 update styles where only one
was present before? I tried some simple testcases and didn't observe an effect
with or without this patch due to the loads being kicked off before updatestyle.
AFAIK, layout cannot depend on a css image property either.
If this patch has no effect on performance and aligns our behavior with other
browsers, I support this after all.
Yoav Weiss
On 2015/12/04 01:17:47, pdr wrote: > I see, this is the proposal to switch to ...
On 2015/12/04 01:17:47, pdr wrote:
> I see, this is the proposal to switch to synchronous datauri images. I
> misunderstood and thought it was for #2.
>
> Can you think of a case where we would be one frame "behind" because of async
> image loading, or cases where this would cause 2 update styles where only one
> was present before? I tried some simple testcases and didn't observe an effect
> with or without this patch due to the loads being kicked off before
updatestyle.
> AFAIK, layout cannot depend on a css image property either.
The data URL is loaded at the next microtask, so I don't think that there are
scenarios where this will result in a double updatestyle.
>
> If this patch has no effect on performance and aligns our behavior with other
> browsers, I support this after all.
pdr.
On 2015/12/07 at 07:14:54, yoav wrote: > On 2015/12/04 01:17:47, pdr wrote: > > I ...
On 2015/12/07 at 07:14:54, yoav wrote:
> On 2015/12/04 01:17:47, pdr wrote:
> > I see, this is the proposal to switch to synchronous datauri images. I
> > misunderstood and thought it was for #2.
> >
> > Can you think of a case where we would be one frame "behind" because of
async
> > image loading, or cases where this would cause 2 update styles where only
one
> > was present before? I tried some simple testcases and didn't observe an
effect
> > with or without this patch due to the loads being kicked off before
updatestyle.
> > AFAIK, layout cannot depend on a css image property either.
>
> The data URL is loaded at the next microtask, so I don't think that there are
scenarios where this will result in a double updatestyle.
>
> >
> > If this patch has no effect on performance and aligns our behavior with
other
> > browsers, I support this after all.
LGTM
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1492303003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1492303003/20001
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/145214)
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1492303003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1492303003/20001
Issue 1492303003: Load data URI images in an async way according to spec
(Closed)
Created 5 years ago by Yoav Weiss
Modified 5 years ago
Reviewers: pdr., Mike West, esprehn
Base URL: https://chromium.googlesource.com/chromium/src.git@master
Comments: 0