Make WordPress Core


Ignore:
Timestamp:
04/07/2021 12:59:18 AM (4 years ago)
Author:
peterwilsoncc
Message:

Media: Do not lazy load hidden images or embeds.

Improve the check for sourceless or dimensionless media when determining if the lazy loading attribute should be added to iframes and images. Never include the lazy loading attribute on embeds of WordPress posts as the iframe is initially hidden.

Including loading="lazy" on initially hidden iframes and images can prevent the media from loading in some browsers.

Props adamsilverstein, fabianpimminger, flixos90, johnbillion, jonkastonka, joyously, peterwilsoncc, SergeyBiryukov, SirStuey, swissspidy.
Fixes #52768.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package-lock.json

    r50668 r50682  
    40844084                    "dev": true
    40854085                },
     4086                "puppeteer": {
     4087                    "version": "npm:puppeteer-core@5.5.0",
     4088                    "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-5.5.0.tgz",
     4089                    "integrity": "sha512-tlA+1n+ziW/Db03hVV+bAecDKse8ihFRXYiEypBe9IlLRvOCzYFG6qrCMBYK34HO/Q/Ecjc+tvkHRAfLVH+NgQ==",
     4090                    "dev": true,
     4091                    "requires": {
     4092                        "debug": "^4.1.0",
     4093                        "devtools-protocol": "0.0.818844",
     4094                        "extract-zip": "^2.0.0",
     4095                        "https-proxy-agent": "^4.0.0",
     4096                        "node-fetch": "^2.6.1",
     4097                        "pkg-dir": "^4.2.0",
     4098                        "progress": "^2.0.1",
     4099                        "proxy-from-env": "^1.0.0",
     4100                        "rimraf": "^3.0.2",
     4101                        "tar-fs": "^2.0.0",
     4102                        "unbzip2-stream": "^1.3.3",
     4103                        "ws": "^7.2.3"
     4104                    }
     4105                },
    40864106                "rimraf": {
    40874107                    "version": "3.0.2",
     
    58915911        "browserify-aes": {
    58925912            "version": "1.2.0",
    5893             "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
     5913            "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
    58945914            "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
    58955915            "dev": true,
     
    1880418824            "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
    1880518825            "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
    18806         },
    18807         "puppeteer": {
    18808             "version": "npm:puppeteer-core@5.5.0",
    18809             "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-5.5.0.tgz",
    18810             "integrity": "sha512-tlA+1n+ziW/Db03hVV+bAecDKse8ihFRXYiEypBe9IlLRvOCzYFG6qrCMBYK34HO/Q/Ecjc+tvkHRAfLVH+NgQ==",
    18811             "dev": true,
    18812             "requires": {
    18813                 "debug": "^4.1.0",
    18814                 "devtools-protocol": "0.0.818844",
    18815                 "extract-zip": "^2.0.0",
    18816                 "https-proxy-agent": "^4.0.0",
    18817                 "node-fetch": "^2.6.1",
    18818                 "pkg-dir": "^4.2.0",
    18819                 "progress": "^2.0.1",
    18820                 "proxy-from-env": "^1.0.0",
    18821                 "rimraf": "^3.0.2",
    18822                 "tar-fs": "^2.0.0",
    18823                 "unbzip2-stream": "^1.3.3",
    18824                 "ws": "^7.2.3"
    18825             },
    18826             "dependencies": {
    18827                 "find-up": {
    18828                     "version": "4.1.0",
    18829                     "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
    18830                     "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
    18831                     "dev": true,
    18832                     "requires": {
    18833                         "locate-path": "^5.0.0",
    18834                         "path-exists": "^4.0.0"
    18835                     }
    18836                 },
    18837                 "locate-path": {
    18838                     "version": "5.0.0",
    18839                     "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
    18840                     "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
    18841                     "dev": true,
    18842                     "requires": {
    18843                         "p-locate": "^4.1.0"
    18844                     }
    18845                 },
    18846                 "p-locate": {
    18847                     "version": "4.1.0",
    18848                     "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
    18849                     "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
    18850                     "dev": true,
    18851                     "requires": {
    18852                         "p-limit": "^2.2.0"
    18853                     }
    18854                 },
    18855                 "path-exists": {
    18856                     "version": "4.0.0",
    18857                     "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
    18858                     "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
    18859                     "dev": true
    18860                 },
    18861                 "pkg-dir": {
    18862                     "version": "4.2.0",
    18863                     "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
    18864                     "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
    18865                     "dev": true,
    18866                     "requires": {
    18867                         "find-up": "^4.0.0"
    18868                     }
    18869                 },
    18870                 "rimraf": {
    18871                     "version": "3.0.2",
    18872                     "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
    18873                     "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
    18874                     "dev": true,
    18875                     "requires": {
    18876                         "glob": "^7.1.3"
    18877                     }
    18878                 }
    18879             }
    1888018826        },
    1888118827        "q": {
Note: See TracChangeset for help on using the changeset viewer.