Skip to content

Missing SVGNameList dfns #2102

Description

@Elchi3

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions