aboutsummaryrefslogtreecommitdiffstats
path: root/src/data/var/acceptData.js
blob: 99c61d5fedef4e86b66a91ef91d07610c64104e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
define( [
	"../../core"
], function( jQuery ) {

/**
 * Determines whether an object can have data
 */
return function( elem ) {
	var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ],
		nodeType = +elem.nodeType || 1;

	// Do not set data on non-element DOM nodes because it will not be cleared (#8335).
	return nodeType !== 1 && nodeType !== 9 ?
		false :

		// Nodes accept data unless otherwise specified; rejection can be conditional
		!noData || noData !== true && elem.getAttribute( "classid" ) === noData;
};

} );