MyMongodb/node_modules/jquery/test/unit/attributes.js

(开头部分) 52KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

module( "attributes", {
	teardown: moduleTeardown
});

var bareObj = function( value ) {
	return value;
};

var functionReturningObj = function( value ) {
	return (function() {
		return value;
	});
};

/*
	======== local reference =======
	bareObj and functionReturningObj can be used to test passing functions to setters
	See testVal below for an example

	bareObj( value );
		This function returns whatever value is passed in

	functionReturningObj( value );
		Returns a function that returns the value
*/

test( "jQuery.propFix integrity test", function() {
	expect( 1 );

	//  This must be maintained and equal jQuery.attrFix when appropriate
	//  Ensure that accidental or erroneous property
	//  overwrites don't occur
	//  This is simply for better code coverage and future proofing.
	var props = {
		"tabindex": "tabIndex",
		"readonly": "readOnly",
		"for": "htmlFor",
		"class": "className",
		"maxlength": "maxLength",
		"cellspacing": "cellSpacing",
		"cellpadding": "cellPadding",
		"rowspan": "rowSpan",
		"colspan": "colSpan",
		"usemap": "useMap",
		"frameborder": "frameBorder",
		"contenteditable": "contentEditable"
	};

	if ( !jQuery.support.enctype ) {
		props.enctype = "encoding";
	}

	deepEqual( props, jQuery.propFix, "jQuery.propFix passes integrity check" );
});

test( "attr(String)", function() {
	expect( 50 );

	equal( jQuery("#text1").attr("type"), "text", "Check for type attribute" );
	equal( jQuery("#radio1").attr("type"), "radio", "Check for type attribute" );
后面还有 1272 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。