Skip to content

Commit

Permalink
Fix line lengths.
Browse files Browse the repository at this point in the history
  • Loading branch information
bicknellr committed Dec 15, 2015
1 parent 3518621 commit 31f55f6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/lib/dom-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -613,29 +613,33 @@
if (!active) {
return null;
}
var isShadyRoot = !!this.node._isShadyRoot;
if (this.node !== document) {
// If this node isn't a document or shady root, then it doesn't
// have an active element.
if (!this.node._isShadyRoot) {
if (!isShadyRoot) {
return null;
}
// If this shady root's host is the active element or the active
// element is not a descendant of the host, then it doesn't have
// an active element.
if (this.node.host === active || !this.node.host.contains(active)) {
if (this.node.host === active ||
!this.node.host.contains(active)) {
return null;
}
// If the active element is a light descendant of the shady root's
// host, return the active element.
if (this.node.host !== active && this._contains(this.node.host, active)) {
if (this.node.host !== active &&
this._contains(this.node.host, active)) {
return active;
}
}
// This node is either the document or a shady root of which the
// active element is a descendant of its host; iterate upwards to
// find the active element's most shallow host.
var activeRoot = Polymer.dom(active).getOwnerRoot();
while (activeRoot && activeRoot !== this.node && !(this.node._isShadyRoot && this._contains(this.node.host, active))) {
while (activeRoot && activeRoot !== this.node &&
!(isShadyRoot && this._contains(this.node.host, active))) {
active = activeRoot.host;
activeRoot = Polymer.dom(active).getOwnerRoot();
}
Expand Down

0 comments on commit 31f55f6

Please sign in to comment.