TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The specification for native image lazy-loading is merged into HTML standard

282 点作者 saranshk超过 5 年前

15 条评论

buro9超过 5 年前
If you are going to use this, keep in mind the advice given... set the height and width attributes of the image to prevent the page jumping around for lazily loaded images.<p>Which means, if you accept user generated content or images from any CMS or other source you really should be obtaining the image dimensions and using them in the HTML.
评论 #22316898 未加载
评论 #22316999 未加载
评论 #22318003 未加载
评论 #22316907 未加载
评论 #22317618 未加载
评论 #22316922 未加载
amanzi超过 5 年前
Lazy loading can be frustrating when the connection between the website and your browser is slow. I come across this from time to time and the result is that every time you scroll down, you have to wait ages for the next set of images to load.
评论 #22315296 未加载
评论 #22316284 未加载
评论 #22315229 未加载
评论 #22315167 未加载
评论 #22315268 未加载
评论 #22315274 未加载
评论 #22316601 未加载
评论 #22315217 未加载
评论 #22316567 未加载
Waterluvian超过 5 年前
Now that this is in the spec we just need browsers to implement it and then I can make a &quot;shaking your phone loads things faster&quot; plugin. People will notice a slight difference just often enough where eager loading worked out better. They&#x27;ll waggle their phones all the time. It&#x27;s going to look hilarious.
评论 #22315414 未加载
Wowfunhappy超过 5 年前
This is exciting, because the sooner developers standardize on single method of lazy-loading, the sooner I&#x27;ll be able to disable it with a userscript.
评论 #22315751 未加载
评论 #22316031 未加载
goblin89超过 5 年前
I wish browser vendors, instead of native lazy loading for images, focused on a universal mechanism to lazily render arbitrary elements, including custom ones.<p>Browsers could profile how long rendering a particular type of element takes on a given website, and optimize render triggers to provide seamless experience while conserving bandwidth.<p>Currently lazily rendering custom elements requires a fair chunk of IntersectionObserver boilerplate code, and beyond that any adaptability to user connection seems too complex to even consider.
评论 #22317506 未加载
toastal超过 5 年前
<a href="https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;show_bug.cgi?id=1542784" rel="nofollow">https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;show_bug.cgi?id=1542784</a><p>The bug is already closed in Firefox. Hopefully it&#x27;ll be here soon.
评论 #22317960 未加载
martin_a超过 5 年前
While I think lazy loading is great in itself, I wonder why we haven&#x27;t come up with something better before.<p>There is progressive loading embedded directly into JPEG and if browsers would prioritize loading of assets through the DOM (order), we wouldn&#x27;t need any other solutions.<p>Or am I wrong here?
Kaiyou超过 5 年前
I hate lazy-loading so much, since it never keeps up with my scrolling speed. So I first have to scroll down slowly and wait for everything to load, then go back to the beginning and start for real. Tried some methods to stop lazy-loading but none worked reliably.
评论 #22317481 未加载
评论 #22320325 未加载
chiefalchemist超过 5 年前
Lazy loading is helpful but if the img tags&#x27; sizes attribute is mucked up then less is gained. That is for example, due to the sizes the browser is led to believe it needs an image that&#x27;s 100vw when the actual width is 25vw. This happen quite a bit with WordPress.<p>Here&#x27;s a great article on sizes and srcset.<p><a href="https:&#x2F;&#x2F;ericportis.com&#x2F;posts&#x2F;2014&#x2F;srcset-sizes&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ericportis.com&#x2F;posts&#x2F;2014&#x2F;srcset-sizes&#x2F;</a><p>Editorial: Personally, my fear (based on history) is this will ultimately lead to more bloat, not less. The belief in &quot;oh not to worry, we&#x27;ve got lazy load&quot; is not a positive overall.<p>LL is a good thing. But it will likely increase abuse, not mitigate it.
stevenwliao超过 5 年前
The first mainstream browsers with support: Chrome and <i>Edge</i>!<p><a href="https:&#x2F;&#x2F;caniuse.com&#x2F;#feat=loading-lazy-attr" rel="nofollow">https:&#x2F;&#x2F;caniuse.com&#x2F;#feat=loading-lazy-attr</a>
评论 #22315100 未加载
评论 #22315373 未加载
baybal2超过 5 年前
I remember there was a huge protest from the ad industry over that.<p>This is the time we live in now, web standards are set by the ad industry
评论 #22316680 未加载
ksec超过 5 年前
Status on Safari [1];<p>&gt;<i>Rob Buis 2020-02-13 00:04:07 PST<p>I was waiting for the spec to land before working again on this. First step is to fix the tests: <a href="https:&#x2F;&#x2F;github.com&#x2F;web-platform-tests&#x2F;wpt&#x2F;pull&#x2F;21773" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;web-platform-tests&#x2F;wpt&#x2F;pull&#x2F;21773</a><p>I&#x27;ll incorporate them into <a href="https:&#x2F;&#x2F;bugs.webkit.org&#x2F;show_bug.cgi?id=200764" rel="nofollow">https:&#x2F;&#x2F;bugs.webkit.org&#x2F;show_bug.cgi?id=200764</a>, test a bit and hopefully put it up for review soon.</i><p>This is exciting. We should have all major browser supporting it within this year. Fewer Javascript required.<p>[1] <a href="https:&#x2F;&#x2F;bugs.webkit.org&#x2F;show_bug.cgi?id=196698" rel="nofollow">https:&#x2F;&#x2F;bugs.webkit.org&#x2F;show_bug.cgi?id=196698</a>
brianzelip超过 5 年前
I detest hard coding image sizes. I only want to add `img { width: 100% }` and that&#x27;s it.
评论 #22319123 未加载
est超过 5 年前
So this means better user tracking capabilities are now native, even with Javascript disabled.<p>You can learn what the user have read on the page before, and deliver more relevant ads next.
评论 #22315225 未加载
评论 #22315241 未加载
评论 #22315150 未加载
评论 #22315179 未加载
评论 #22315246 未加载
评论 #22315227 未加载
coderheed超过 5 年前
It seems like this is bound to have security holes at least for a while, right?
评论 #22315553 未加载
评论 #22318451 未加载