Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 0db910a

Browse files
committed
fix(shadow_dom_emulation): fix content reprojection bug.
On non-shadow DOM enabled browsers content tag cannot be checked by using the type of the element. Instead the tagName should be used.
1 parent 1078ca5 commit 0db910a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/core_dom/light_dom.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class LightDom implements SourceLightDom, DestinationLightDom {
8787
for(final root in _lightDomRootNodes) {
8888
if (_ports.containsKey(root)) {
8989
list.addAll(_ports[root].nodes);
90-
} else if (root is dom.ContentElement) {
90+
} else if (isContentElement(root)) {
9191
if (!_contentTags.containsKey(root))
9292
throw new Exception('Unmatched content tag encountered during redistibution.');
9393
list.addAll(_contentTags[root].nodes);
@@ -97,6 +97,8 @@ class LightDom implements SourceLightDom, DestinationLightDom {
9797
}
9898
return list;
9999
}
100+
101+
static isContentElement(dom.Node node) => node is dom.Element && node.tagName == 'CONTENT';
100102
}
101103

102104
void redistributeNodes(Iterable<Content> contents, List<dom.Node> nodes) {

0 commit comments

Comments
 (0)