SVGFEDropShadowElement: result 屬性

Baseline 已廣泛支援

此特性已相當成熟,可在許多裝置和瀏覽器版本上使用。自 ⁨2020 年 1 月⁩ 起,所有主流瀏覽器均已支援。

SVGFEDropShadowElement 介面的只讀屬性 result,描述了一個 SVG 濾鏡原語被賦的名稱,型別為 SVGAnimatedString

它反映了 result 屬性。屬性值是一個 <custom-ident>。如果提供了該屬性,則在同一 <filter> 元素內的後續濾鏡原語上,可以使用 in 屬性來引用由該濾鏡原語處理產生的圖形。

如果沒有定義 result 屬性,則濾鏡的 result.baseValresult.animVal 為空字串。並且 <feDropShadow> 濾鏡的輸出僅在後續濾鏡原語沒有為其 in 屬性提供值時,才可作為隱式輸入供重用。

一個 SVGAnimatedString

示例

js
const feDropShadowElement = document.querySelector("feDropShadow");
const filterName = feDropShadowElement.result;
console.log(filterName.baseVal); // the filter's assigned name

規範

規範
濾鏡效果模組第 1 級
# dom-svgfilterprimitivestandardattributes-result

瀏覽器相容性

另見