fix: can't record SVG element inside iframe properly (#843)

el instanceof SVGElement is false if the svg element is inside iframe so that the isSVG property is missing in the recorded data
This commit is contained in:
Yun Feng
2022-02-24 12:02:55 +11:00
committed by GitHub
parent 5ae208b174
commit e9531d420a
4 changed files with 113 additions and 56 deletions

View File

@@ -219,7 +219,7 @@ export function absoluteToDoc(doc: Document, attributeValue: string): string {
}
function isSVGElement(el: Element): boolean {
return el.tagName === 'svg' || el instanceof SVGElement;
return Boolean(el.tagName === 'svg' || (el as SVGElement).ownerSVGElement);
}
function getHref() {