Bug 198530

Summary: Improve performance of the lazy image loader
Product: WebKit Reporter: Jon Davis <jond>
Component: WebKit WebsiteAssignee: Jon Davis <jond>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ews-feeder, hi, jond, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Jon Davis 2019-06-04 08:26:26 PDT
Improve CPU performance on webkit.org pages by using an IntersectionObserver implementation.
Comment 1 Jon Davis 2019-06-04 08:41:17 PDT
Created attachment 371285 [details]
Patch
Comment 2 Devin Rousso 2019-06-04 08:55:55 PDT
Comment on attachment 371285 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=371285&action=review

r=me, neat!  It may be worth a simple `if (window.IntersectionObserver)` check around (or as an early return in) `lazyLoadImages` so we don't throw an error if it's not supported.

> Websites/webkit.org/ChangeLog:-101
> -        

I don't think we normally go back and edit ChangeLog entries, no matter how "bad" they may be.

> Websites/webkit.org/wp-content/themes/webkit/scripts/global.js:-2
> -    var openClass = ' open-menu',

A comment explaining why this isn't needed would be nice :)

> Websites/webkit.org/wp-content/themes/webkit/scripts/global.js:6
> +        for (let table of tables) {

Are we using `let` now??!? =D

> Websites/webkit.org/wp-content/themes/webkit/scripts/global.js:22
> +        if (backgroundImages.length == 0)

NIT: you could use `!backgroundImages.length` instead
Comment 3 Jon Davis 2019-06-04 10:53:23 PDT
Created attachment 371301 [details]
Patch
Comment 4 EWS 2019-06-04 18:43:35 PDT Comment hidden (obsolete)
Comment 5 WebKit Commit Bot 2019-06-04 19:21:32 PDT
Comment on attachment 371301 [details]
Patch

Clearing flags on attachment: 371301

Committed r246094: <https://trac.webkit.org/changeset/246094>
Comment 6 WebKit Commit Bot 2019-06-04 19:21:34 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2019-06-04 19:25:08 PDT
<rdar://problem/51425204>