html.elements.iframe.loading - add subfeatures for lazy loading srcdoc, data: and blob: iframes
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- html, json
- Domain
- data, documentation
Research direction
Start by reading the existing html.elements.iframe.loading entry and nearby browser compatibility data conventions in the repository. Add three subfeatures for srcdoc, data: and blob: iframe loading using the browser results in the issue; verify the entries match the stated support matrix. The issue notes that Firefox and Safari version numbers are unverified, so resolve those from repository or browser data before recording them.
Written by the indexing model from the issue text.
Description
What type of issue is this?
Missing compatibility data
What information was incorrect, unhelpful, or incomplete?
html.elements.iframe.loading lists Chrome 77 as fully supporting loading="lazy", with no notes. However, Chromium does not lazy-load iframes whose URL is local (about:srcdoc, data:, blob:). A below-viewport <iframe loading="lazy"> with srcdoc, a data: URL, or a blob: URL loads immediately, delays the parent's load event, and ignores the attribute entirely.
This is because Chromium only considers http(s) URLs eligible for lazy loading (IsFrameLazyLoadable() in html_frame_owner_element.cc):
// Only http:// or https:// URLs are eligible for lazy loading, excluding
// URLs like invalid or empty URLs, "about:blank", local file URLs, etc.
// that it doesn't make sense to lazily load.
if (!url.ProtocolIsInHttpFamily()) {
return false;
}
The spec has no such restriction. Process the iframe attributes runs the will lazy load element steps for both the srcdoc branch and the URL branch, regardless of scheme. Including srcdoc was deliberate, since a local document's subresources would otherwise block the parent's load event (whatwg/html#5579).
What browsers does this problem apply to, if applicable?
Chromium (Chrome, Edge 79+, Opera, Samsung Browser), Safari
What did you expect to see?
Three subfeatures of html.elements.iframe.loading, one per kind of local URL, since support differs between them:
| Subfeature | Description | Chromium | Firefox | Safari |
|---|---|---|---|---|
loading.srcdoc |
Lazy loading of srcdoc iframes |
No | Yes | Yes |
loading.data |
Lazy loading of data: URL iframes |
No | Yes | Yes |
loading.blob |
Lazy loading of blob: URL iframes |
No | Yes | No |
I haven't verified Firefox and Safari's version_added. Since the spec covered these cases before either shipped iframe lazy loading, it is likely the same as the parent feature (Firefox 121, Safari 16.4).
Did you test this? If so, how?
Yes, in two ways.
- Manually in Chrome stable: a page with two below-viewport
loading="lazy"iframes, one withsrcdocand one with a same-originsrc. Thesrcdociframe firedloadat page load withscrollY0. Thesrciframe made no request and did not fireloaduntil scrolled into view. - WPT results from the latest stable runs on wpt.fyi:
| Subtest | Chrome 156 | Firefox 158 | Safari 27 |
|---|---|---|---|
| iframe-loading-lazy.html: Below-viewport srcdoc iframes load lazily | FAIL | PASS | PASS |
| iframe-loading-lazy.html: Below-viewport data: url iframes load lazily | FAIL | PASS | PASS |
| iframe-loading-lazy.html: Below-viewport blob url iframes load lazily | FAIL | PASS | FAIL |
| iframe-loading-lazy-to-eager-srcdoc.html | FAIL | PASS | PASS |
Chromium's checked-in baselines for these tests also record them as failing.
Can you link to any release notes, bugs, pull requests, or MDN pages related to this?
- Chromium bug: 40703417 – Support loading=lazy for srcdoc iframes (open since 2020, P3). It only mentions
srcdoc, but the root cause above also coversdata:andblob:. - Spec PR: whatwg/html#5579
- Fetch's definition of local scheme:
about,blob, ordata. - MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe#loading
- Dominant language
- JSON
- Stars
- 5.8k
- Forks
- 2.7k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 160
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mdn/browser-compat-data
-
Web extensions - Safari Technology Preview 257 data and the message_serialization manifest keyPossibly taken @xeenon claimed this today. Openneeds triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mdn/browser-compat-data#31192 ·
Maintainers usually reply within 1 day
-
api.WGSLLanguageFeatures - Firefox supports three featuresPossibly taken @Manishram-ai claimed this 1 day ago. Opendata:api needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
mdn/browser-compat-data#31175 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
mdn/browser-compat-data#31069 · 1 comment ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mdn/browser-compat-data#31057 · 2 comments ·
Maintainers usually reply within 1 day
-
api.Window.devicePixelRatio - Does change with page zoom in Safari (webkit)Possibly taken @Manishram-ai claimed this 1 day ago. Opendata:api needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
mdn/browser-compat-data#31039 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
All issues in mdn/browser-compat-data
Similar issues
-
author-page correction move-papers
Difficulty 1/5 Under an hour Newbie friendliness 78/100
acl-org/acl-anthology#10978 · 1 comment ·
Maintainers usually reply within 1 day
-
Missing ToCsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
davwheat/rail-announcements#395 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
soroswap/token-list#125 ·
Maintainers usually reply within 1 day
-
module/data.csv Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ballerina-platform/ballerina-library#9792 ·
Maintainers usually reply within 1 day
-
automation missing-model model-sync provider:github-copilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anomalyco/models.dev#14022 ·
Maintainers usually reply within 1 day