- From: Sérgio Faria <notifications@github.com>
- Date: Fri, 12 Oct 2018 04:17:53 -0700
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 12 October 2018 11:18:15 UTC
@yGuy Here's an implementation, it's not that hard to workaround this issue...
```js
if (isNativeShadow && isWebKit) {
svg.querySelectorAll('[*|href^="#"]').forEach(node => {
const xlinkNS = 'http://www.w3.org/1999/xlink';
let href;
if (node.hasAttributeNS(null, 'href')) {
href = node.getAttributeNS(null, 'href');
} else {
href = node.getAttributeNS(xlinkNS, 'href');
}
if (href === null || !href.startsWith('#')) {
return;
}
const refNode = svg.getElementById(href.slice(1));
if (!refNode) {
return;
}
const refClone = refNode.cloneNode(true);
refClone.removeAttribute('id');
Array.from(node.attributes).forEach(attr => {
if (attr.localName === 'href') {
if (attr.namespaceURI === null || attr.namespaceURI === xlinkNS) {
return;
}
}
refClone.setAttributeNodeNS(attr.cloneNode(true));
});
node.parentNode.replaceChild(refClone, node);
});
}
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/179#issuecomment-429292229
Received on Friday, 12 October 2018 11:18:15 UTC