Summary: | Add a helper class to coordinate batch analysis of images | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Wenson Hsieh <wenson_hsieh> | ||||||||||
Component: | Platform | Assignee: | Wenson Hsieh <wenson_hsieh> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | akeerthi, annulen, bdakin, dino, ews-watchlist, gyuyoung.kim, hi, megan_gardner, ryuan.choi, sergio, thorton, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Bug Depends on: | |||||||||||||
Bug Blocks: | 233210 | ||||||||||||
Attachments: |
|
Description
Wenson Hsieh
2021-11-12 15:36:44 PST
Created attachment 444116 [details]
Patch
Created attachment 444396 [details]
Rebase + implement more logic
Created attachment 444527 [details]
Remove unnecessary SPI
Comment on attachment 444527 [details] Remove unnecessary SPI View in context: https://bugs.webkit.org/attachment.cgi?id=444527&action=review > Source/WebCore/page/ImageAnalysisQueue.cpp:59 > + auto imageIterator = document.images()->createIterator(); What order does document.images() use? I wonder if we can have an iterator that is in document order (more likely to have the images on screen up front). Also, what happens with lazy loaded images? Comment on attachment 444527 [details] Remove unnecessary SPI View in context: https://bugs.webkit.org/attachment.cgi?id=444527&action=review Thanks for the review! >> Source/WebCore/page/ImageAnalysisQueue.cpp:59 >> + auto imageIterator = document.images()->createIterator(); > > What order does document.images() use? I wonder if we can have an iterator that is in document order (more likely to have the images on screen up front). > > Also, what happens with lazy loaded images? Good question! So `document.images()` is already in DOM order, but this is actually not ideal because (as you hinted) it would be better to prioritize images that are on-screen vs. images that are offscreen. For lazily loaded images, I *think* we'll also exclude them from the queue here because the cached image would be 0x0. I have a followup task to add a way to queue images that are dynamically inserted into the document, so I'll use that to make sure lazy loaded images are also handled by these changes. For the time being, I'll file a new bugzilla bug and add a FIXME here. Created attachment 444542 [details]
Patch for landing
Committed r285949 (244351@main): <https://commits.webkit.org/244351@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 444542 [details]. |