Skip to content

Commit

Permalink
ShadyDOM optimizations + new api (Polymer.dom)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Mar 5, 2015
1 parent bb6b1fa commit 7c7e426
Show file tree
Hide file tree
Showing 13 changed files with 899 additions and 911 deletions.
2 changes: 1 addition & 1 deletion polymer-mini.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<link rel="import" href="src/lib/dom-module.html">
<link rel="import" href="src/features/mini/template.html">
<link rel="import" href="src/features/mini/ready.html">
<link rel="import" href="src/features/mini/content.html">
<link rel="import" href="src/features/mini/shady.html">
<link rel="import" href="src/features/mini/shadow.html">

<script>
Expand Down
9 changes: 4 additions & 5 deletions src/expr/sinspect.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,20 +210,19 @@
var ROOT_NAME = 'local-root';

function hasRoot(node) {
return (node.localDom && !node.localDom.emptyRoot);
return (node.shadyRoot || node.shadowRoot);
}

function getLocalNodes(n) {
return hasRoot(n) ? n.localDom.children() : n.childNodes;
return Polymer.dom.children(n.root);
}

function getLightNodes(n) {
return hasRoot(n) ? n.lightDom.children() : n.childNodes;
return Polymer.dom.children(n);
}

function getDistributedNodes(node) {
return node._distributedNodes ||
Array.prototype.slice.call(node.getDistributedNodes(), 0);
Polymer.dom.distributedNodes(node);
}


Expand Down
2 changes: 1 addition & 1 deletion src/expr/x-styling.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
this._customStyle.textContent = cssText;
} else if (cssText) {
this._customStyle = styleUtil.applyCss(cssText, this._scopeSelector,
settings.useNativeShadow ? this.localDom : null);
settings.useNativeShadow ? this.root : null);
}
return this._customStyle;
},
Expand Down
Loading

0 comments on commit 7c7e426

Please sign in to comment.