For SVG2, the following preprocessing creates dfns from <b id="__svg__$interface_$member "> if the SVG IDL tree contains $interface with $member:
|
document.querySelectorAll('b[id^="__svg__"]').forEach(el => { |
|
const [,, containername, membername] = el.id.split('__'); |
|
if (containername && membername) { |
|
let container = idlTree.find(i => i.name === containername); |
|
if (container) { |
|
let member = container.members.find(m => m.name === membername); |
|
if (member) { |
|
const dfn = document.createElement("dfn"); |
|
dfn.id = el.id; |
|
dfn.textContent = el.textContent; |
|
dfn.dataset.dfnFor = containername; |
|
dfn.dataset.dfnType = member.type === "operation" ? "method" : member.type; |
|
el.replaceWith(dfn); |
|
} |
|
} |
|
} |
|
}); |
This works great, but SVG list interfaces are defined as <b id="__svg__SVGNameList_$member "> which can't be found in the SVG IDL tree as it doesn't map to the specific interfaces like that. Basically, there is a mismatch:
SVGLengthList.appendItem: __svg__SVGNameList__appendItem
SVGLengthList.clear: __svg__SVGNameList__clear
SVGLengthList.getItem: __svg__SVGNameList__getItem
SVGLengthList.initialize: __svg__SVGNameList__initialize
SVGLengthList.insertItemBefore: __svg__SVGNameList__insertItemBefore
SVGLengthList.length: __svg__SVGNameList__length
SVGLengthList.numberOfItems: __svg__SVGNameList__numberOfItems
SVGLengthList.removeItem: __svg__SVGNameList__removeItem
SVGLengthList.replaceItem: __svg__SVGNameList__replaceItem
Same happens for SVGNumberList, SVGPointList, SVGStringList, SVGTransformList.
Should <b id="__svg__SVGNameList_$member "> also be part of SVG dfns?
For SVG2, the following preprocessing creates dfns from
<b id="__svg__$interface_$member ">if the SVG IDL tree contains $interface with $member:reffy/src/browserlib/extract-dfns.mjs
Lines 928 to 944 in 04a7895
This works great, but SVG list interfaces are defined as
<b id="__svg__SVGNameList_$member ">which can't be found in the SVG IDL tree as it doesn't map to the specific interfaces like that. Basically, there is a mismatch:SVGLengthList.appendItem: __svg__SVGNameList__appendItem
SVGLengthList.clear: __svg__SVGNameList__clear
SVGLengthList.getItem: __svg__SVGNameList__getItem
SVGLengthList.initialize: __svg__SVGNameList__initialize
SVGLengthList.insertItemBefore: __svg__SVGNameList__insertItemBefore
SVGLengthList.length: __svg__SVGNameList__length
SVGLengthList.numberOfItems: __svg__SVGNameList__numberOfItems
SVGLengthList.removeItem: __svg__SVGNameList__removeItem
SVGLengthList.replaceItem: __svg__SVGNameList__replaceItem
Same happens for SVGNumberList, SVGPointList, SVGStringList, SVGTransformList.
Should
<b id="__svg__SVGNameList_$member ">also be part of SVG dfns?