Summary: | Lazy load images using base URL at parse time | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Rob Buis <rbuis> | ||||||||
Component: | New Bugs | Assignee: | Rob Buis <rbuis> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | achristensen, beidson, cdumez, commit-queue, darin, dbates, ews-watchlist, japhet, simon.fraser, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | Safari Technology Preview | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=237703 | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 196698 | ||||||||||
Attachments: |
|
Description
Rob Buis
2020-02-18 12:32:36 PST
Created attachment 391150 [details]
Patch
Created attachment 391184 [details]
Patch
Comment on attachment 391184 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=391184&action=review > Source/WebCore/loader/ImageLoader.cpp:189 > + auto uri = document.completeURL(sourceURI(attr)); > + if (m_lazyImageLoadState == LazyImageLoadState::LoadImmediately) > + uri = m_image->url(); Seems a little strange to call this URI. Seems wasteful to compute the URL, then check m_lazyImageLoadState, then overwrite it. I’d write this: URL imageURL = m_lazyImageLoadState == LazyImageLoadState::LoadImmediately ? m_image->url() : document.completeURL(sourceURI(attr)); But also, i think this needs "why" comment. The concept here of "LoadImmediately" and special URL rules seems subtle and a bit tricky. Created attachment 391278 [details]
Patch
Comment on attachment 391278 [details] Patch Clearing flags on attachment: 391278 Committed r257054: <https://trac.webkit.org/changeset/257054> All reviewed patches have been landed. Closing bug. The relevant tests were renamed to: html/semantics/embedded-content/the-img-element/image-loading-lazy-base-url-2.html html/semantics/embedded-content/the-img-element/image-loading-lazy-base-url.html |