-
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.
- Loading branch information
1 parent
6ed836f
commit 1e9110a
Showing
4 changed files
with
115 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,7 +150,7 @@ | |
* payload. | ||
* @param {Object=} options Object specifying options. These may include: | ||
* `bubbles` (boolean, defaults to `true`), | ||
* `cancelable` (boolean, defaults to false), and | ||
* `cancelable` (boolean, defaults to false), and | ||
* `node` on which to fire the event (HTMLElement, defaults to `this`). | ||
* @return {CustomEvent} The new event that was fired. | ||
*/ | ||
|
@@ -199,11 +199,11 @@ | |
|
||
/** | ||
* Removes an item from an array, if it exists. | ||
* | ||
* If the array is specified by path, a change notification is | ||
* | ||
* If the array is specified by path, a change notification is | ||
* generated, so that observers, data bindings and computed | ||
* properties watching that path can update. | ||
* | ||
* properties watching that path can update. | ||
* | ||
* If the array is passed directly, **no change | ||
* notification is generated**. | ||
* | ||
|
@@ -306,6 +306,29 @@ | |
} | ||
} | ||
return elt; | ||
}, | ||
|
||
/** | ||
* Checks whether an element is in this element's light DOM tree. | ||
* | ||
* @method isLightDescendant | ||
* @param {HTMLElement=} node The element to be checked. | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
danbeam
Contributor
|
||
* @return {Boolean} true if node is in this element's light DOM tree. | ||
*/ | ||
isLightDescendant: function(node) { | ||
return this.contains(node) && | ||
Polymer.dom(this).getOwnerRoot() === Polymer.dom(node).getOwnerRoot(); | ||
}, | ||
|
||
/** | ||
* Checks whether an element is in this element's local DOM tree. | ||
* | ||
* @method isLocalDescendant | ||
* @param {HTMLElement=} node The element to be checked. | ||
* @return {Boolean} true if node is in this element's local DOM tree. | ||
*/ | ||
isLocalDescendant: function(node) { | ||
return this.root === Polymer.dom(node).getOwnerRoot(); | ||
} | ||
|
||
}); | ||
|
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
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
<body> | ||
|
||
<script> | ||
|
||
HTMLImports.whenReady(function() { | ||
Polymer({is: 'my-element'}); | ||
}); | ||
|
right now it seems that iron-behaviors are calling this from event handlers with, i.e.
unfortunately
e.target
can be anEventTarget
and is not necessarily anHTMLElement
or evenNode
(in some cases). examples:do we want all call sites to be casting to
Node
orHTMLElement
, or can this method be updated to take anEventTarget
instead?/cc @notwaldorf @rictic