简体   繁体   English

naturalHeight 和 naturalWidth 属性是新增的还是已弃用?

[英]naturalHeight and naturalWidth property new or deprecated?

naturalHeight and naturalWidth property of HTMLImageElement object is not mentioned in mozilla website Link naturalHeight object 的HTMLImageElementnaturalWidth属性未在 mozilla 网站链接中提及

Although both properties works fine in Firefox but i don't see this in documentation.虽然这两个属性在 Firefox 中都可以正常工作,但我在文档中看不到这一点。

Is it a deprecated property or new in HTML5?它是 HTML5 中的弃用属性还是新属性?

Can someone give me a link where these properties are defined in standard?有人可以给我一个链接,这些属性是在标准中定义的吗?

Definitely not deprecated.绝对不会弃用。 Checking the HTML5 spec for the img element , we can see:检查img元素的 HTML5 规范,我们可以看到:

The IDL attributes naturalWidth and naturalHeight must return the intrinsic width and height of the image, in CSS pixels, if the image is available, or else 0. [CSS] IDL 属性 naturalWidth 和 naturalHeight 必须返回图像的固有宽度和高度,如果图像可用,则以 CSS 像素为单位,否则为 0。 [CSS]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 naturalHeight 和 naturalWidth Javascript 的问题 - problem with naturalHeight and naturalWidth Javascript naturalHeight与naturalWidth的比较 - naturalHeight comparison with naturalWidth naturalWidth 和 naturalHeight 使用 onload 事件返回 0 - naturalWidth and naturalHeight returns 0 using onload event Random 尝试获取图像的 naturalHeight 和 naturalWidth 失败 - Random fails trying to get the naturalHeight and naturalWidth of an image 为什么无法在javascript / JQuery中获取图像的naturalHeight / naturalWidth? - Why can't I get the naturalHeight/naturalWidth of an image in javascript/JQuery? Firefox .naturalHeight属性 - Firefox .naturalHeight property 从 onLoad() 返回的 React 合成事件<image>里面的元素<svg>没有 naturalWidth 或 naturalHeight 属性 - React synthetic event returned from onLoad() of <image> element inside <svg> does not have naturalWidth or naturalHeight properties javascript事件:当图像开始加载时挂钩(已经有自然宽度和自然高度道具但尚未加载自身) - javascript event: hook when image starts loading ( already has naturalWidth & naturalHeight props but haven't loaded itself yet) 未捕获的类型错误:无法读取 null 的属性“naturalWidth” - FabricJs - 通过 loadFromJSON 在 Fabric.js 中预览视频 - Uncaught TypeError: Cannot read property 'naturalWidth' of null - FabricJs - preview a video in Fabric.js via loadFromJSON 浏览器中已弃用的属性调用程序 - Deprecated property caller in browsers
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM