[英]Does changing the src of an image with a width and height cause DOM thrashing?
如果我有一个宽度/高度设置为<img width=x height=x src=blank_pixel />
的图像标签,并且我将 src 更改为某个图像 url,这会导致 dom 布局无效吗?
Using chrome dev tools I see next sequence:使用 chrome 开发工具,我看到了下一个序列:
My answer is yes.我的回答是肯定的。 Browser donwload new image, scale it (if it's necessary) and then calculate layout, do the paint and composite the image.
浏览器下载新图像,缩放它(如果有必要),然后计算布局,绘制并合成图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.