-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #3295. Only cache a false-y result for an element's owner shady…
… root iff the element is currently in the document.
- Loading branch information
Steven Orvell
committed
Jan 14, 2016
1 parent
44232bd
commit 6e16619
Showing
3 changed files
with
88 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
|
||
<title>early owner-root</title> | ||
|
||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<script src="../../../webcomponentsjs/webcomponents-lite.js"></script> | ||
<link rel="import" href="../../polymer.html"> | ||
|
||
</head> | ||
<body> | ||
|
||
|
||
<dom-module id="x-owner-root"> | ||
<template>where am I?</template> | ||
<script> | ||
Polymer({ | ||
is: 'x-owner-root', | ||
|
||
properties: { | ||
nug: {type: String, observer: '_nugChanged'} | ||
}, | ||
|
||
_nugChanged: function() { | ||
console.log(this.localName, Polymer.dom(this).getOwnerRoot()); | ||
} | ||
|
||
|
||
}); | ||
</script> | ||
</dom-module> | ||
|
||
<dom-module id="x-test"> | ||
<template> | ||
<template is="dom-if" if="{{foo}}"> | ||
<x-owner-root nug="foo"></x-owner-root> | ||
</template> | ||
</template> | ||
<script> | ||
Polymer({ | ||
is: 'x-test', | ||
attached: function() { | ||
this.foo = true; | ||
Polymer.dom.flush(); | ||
var e = Polymer.dom(this.root).querySelector('x-owner-root'); | ||
var r = e && Polymer.dom(e).getOwnerRoot(); | ||
console.log(e, r, r === this.root); | ||
} | ||
}); | ||
</script> | ||
</dom-module> | ||
|
||
<x-test></x-test> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters