SVGFEDiffuseLightingElement: result 属性

Baseline 已广泛支持

此特性已相当成熟,可在许多设备和浏览器版本上使用。自 ⁨2015 年 7 月⁩以来,各浏览器均已提供此特性。

SVGFEDiffuseLightingElement 接口的只读属性 result,以 SVGAnimatedString 的形式描述 SVG 滤镜原语的指定名称。

它反映了 <feDiffuseLighting> 元素的 result 属性。该滤镜使用 alpha 通道作为凹凸贴图来照亮图像。属性值是 <custom-ident>。如果提供了该属性,那么处理此滤镜原语产生的图形可以通过同一 <filter> 元素内后续滤镜原语的 in 属性进行引用。

如果没有定义 result 属性,滤镜的 result.baseValresult.animVal 将为空字符串,并且 <feDiffuseLighting> 滤镜的输出仅在将该滤镜原语作为下一个滤镜原语的隐式输入进行重用时可用,前提是该下一个滤镜原语没有为其 in 属性提供值。

一个 SVGAnimatedString

示例

js
const feDiffuseLightingElement = document.querySelector("feDiffuseLighting");
const filterName = feDiffuseLightingElement.result;
console.log(filterName.baseVa); // the filter's assigned name

规范

规范
滤镜效果模块第 1 级
# dom-svgfilterprimitivestandardattributes-result

浏览器兼容性

另见