* Check if a node is in the document. * Note: document.documentElement.contains should work here * but always returns false for comment nodes in phantomjs, * making unit tests difficult. This is fixed by doing the * contains() check on the node's parentNode instead of * the node itsel
(node)
| 1145 | */ |
| 1146 | |
| 1147 | function inDoc(node) { |
| 1148 | if (!node) return false; |
| 1149 | var doc = node.ownerDocument.documentElement; |
| 1150 | var parent = node.parentNode; |
| 1151 | return doc === node || doc === parent || !!(parent && parent.nodeType === 1 && doc.contains(parent)); |
| 1152 | } |
| 1153 | |
| 1154 | /** |
| 1155 | * Get and remove an attribute from a node. |
no outgoing calls
no test coverage detected