-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
renderTime should be CORS-protected, not TAO-protected #111
Comments
I think we need a more holistic approach here. HTMLImageElement.decode() is not protected by neither TAO nor CORS. Talking to @mmocny, there are potentially other ways to weed out the decode times of opaque images. We need to collectively decide if that information should be protected, and if so, by what means. We also need to ensure those means are ergonomic and easy to use, either through document-level CORS-fetch opt-ins for subresources, through public resource declaration, both, or something else entirely. |
I agree about finding a more holistic approach. The first rule of thumb that exists today though in the HTML/Fetch specs, is that TAO can only protect the timing of a fetch and not of something to do with the resource's content, which is generally protected by CORS. Using TAO to protect render time breaks this, and makes it so that we need to save TAO information in HTTP cache and other repercussions. |
For those not up on their acronyms, TAO = Timing-Allow-Origin |
At a high level we shouldn't add to the number of cross-origin channels without opt-in. That includes I also like the idea of not expanding the scope of the |
@mmocny isn't the
|
You ask if Measuring next rAF after image "load" event is not the same as Since you mention no-cors (rather, non-TAO today), I think you are asking if you can work around the limitations of LCP only reporting However, you can:
[1]: That's because On FF/Safari, there is no "LCP.renderTime", but we can use "FCP.startTime" as a comparison. While I think the timing is equivalent(ish?) to next-rAF-after-load, the frame it measures comes before image decode, AFAIK, and so does not represent the "LCP.renderTime" concept. See: web-platform-tests/interop#215 [2] One small caveat regarding your snippet is that image "load" event may not get scheduled until after the next animation frame:
At least that's what I've observed in Chromium. However, a more robust strategy you can use is rAF polling and checking the status of image.complete, since this appears to get marked in the right frame.
...again, all that just measures loading + scheduling paint stage, and not decoding + presentation. |
I understand those timings are slightly different, I wonder if the difference between the polyfill and renderTime is significant in terms of understanding hidden information about the image. Let's say it's an SVG, and a logged-in user would get a really complex SVG vs. a much simpler one for non logged-in users.
|
Created an issue for |
Note that |
The intention in
Timing-Allow-Origin
(TAO) is to protect the timing it took to fetch the image. Not the content of the image.The intention in protecting
renderTime
is to avoid exposing something about the content of the image.With CORS images, one can anyway know everything about the image and doesn't need to decipher the content from render time.
While with TAO, it's the only place where it's used outside of the context of protecting fetch information.
The text was updated successfully, but these errors were encountered: