ronantakizawa/codereview-bench huggingface dataset:
Repository: jquery/jquery
File: test/unit/manipulation.js (JavaScript)

Code before:

		assert.expect( 5 );

		test.forEach( function( result ) {
			assert.deepEqual( result.actual, result.expected, result.message );
		} );
	}
);

// Custom event handler test case

QUnit.test( "should handle custom '_se-custom-destroy' event correctly", function( assert ) {

	// Define the expected number of assertions

	assert.expect( 4 );

	// Set up the HTML structure by appending to the existing fixture

	var fixture = jQuery( "#qunit-fixture" );

	fixture.append( `
	<div id="container">
	  <div class="guarded removeself" data-elt="one">
	    Guarded 1
	  </div>
	  <div class="guarded" data-elt="two">
	    Guarded 2
	  </div>
	  <div class="guarded" data-elt="three">
	    Guarded 3
	  </div>
	</div>
	` );

	// Define the custom event handler
	jQuery.event.special[ "_se-custom-destroy" ] = {
	remove: function( _handleObj ) {
		var $t = jQuery( this );
		assert.step( $t.data( "elt" ) );
		if ( $t.is( ".removeself" ) ) {
			$t.remove();
		}
	}
	};

	// Attach an empty handler to trigger the `remove`
	// logic for the custom event when the element is removed.

	jQuery( ".guarded" ).on( "_se-custom-destroy", function( ) { } );


Review comment (bug):
Indentation is still incorrect. For example, in these few lines, there are:
* tabs mixed with spaces - we only use tabs
* the string inside of the call is indented as the call above - it should be indented more

Also, these tests need to work in IE 11, so no ES 6 is allowed. You need to use regular concatenated strings, as other tests do.

Code after:

		assert.expect( 5 );

		test.forEach( function( result ) {
			assert.deepEqual( result.actual, result.expected, result.message );
		} );
	}
);

QUnit.test( "should handle node removal in event's remove hook (gh-5214)", function( assert ) {

	assert.expect( 4 );

	jQuery(
		"<div id='container'>" +
		"	<div class='guarded removeself' data-elt='one'>" +
		"		Guarded 1" +
		"	</div>" +
		"	<div class='guarded' data-elt='two'>" +
		"		Guarded 2" +
		"	</div>" +
		"	<div class='guarded' data-elt='three'>" +
		"		Guarded 3" +
		"	</div>" +
		"</div>"
	).appendTo( "#qunit-fixture" );

	// Define the custom event handler
	jQuery.event.special.removeondestroy = {
		remove: function( ) {
			var $t = jQuery( this );
			assert.step( $t.data( "elt" ) );
			if ( $t.is( ".removeself" ) ) {
				$t.remove();
			}
		}
	};

	// Attach an empty handler to trigger the `remove`
	// logic for the custom event when the element is removed.
	jQuery( ".guarded" ).on( "removeondestroy", function( ) { } );

	// Trigger the event's removal logic by emptying the container
	jQuery( "#container" ).empty();

	assert.verifySteps( [ "one", "two", "three" ], "All elements were processed in order" );
} );
Repository: jquery/jquery
File: test/unit/manipulation.js (JavaScript)

Code before:
// Browsers with no TrustedHTML support still run tests on object wrappers with
// a proper `toString` function.
testIframe(
	"Basic TrustedHTML support (gh-4409)",
	"mock.php?action=trustedHtml",
	function( assert, jQuery, window, document, test ) {

		assert.expect( 5 );

		test.forEach( function( result ) {
			assert.deepEqual( result.actual, result.expected, result.message );
		} );
	}
);

// Custom event handler test case

QUnit.test( "should handle custom '_se-custom-destroy' event correctly", function( assert ) {

	// Define the expected number of assertions

	assert.expect( 4 );

	// Set up the HTML structure by appending to the existing fixture

	var fixture = jQuery( "#qunit-fixture" );

	fixture.append( `
	<div id="container">
	  <div class="guarded removeself" data-elt="one">
	    Guarded 1
	  </div>
	  <div class="guarded" data-elt="two">
	    Guarded 2
	  </div>
	  <div class="guarded" data-elt="three">
	    Guarded 3
	  </div>
	</div>
	` );

	// Define the custom event handler
	jQuery.event.special[ "_se-custom-destroy" ] = {
	remove: function( _handleObj ) {
		var $t = jQuery( this );
		assert.step( $t.data( "elt" ) );
		if ( $t.is( ".removeself" ) ) {
			$t.remove();
		}
	}
	};

Review comment (suggestion):
Is there any value in this variable? If anything, it makes more sense to save the element created from the template below to a variable and then call `.appendTo( "#qunit-fixture" )` on it.

Code after:
// Browsers with no TrustedHTML support still run tests on object wrappers with
// a proper `toString` function.
testIframe(
	"Basic TrustedHTML support (gh-4409)",
	"mock.php?action=trustedHtml",
	function( assert, jQuery, window, document, test ) {

		assert.expect( 5 );

		test.forEach( function( result ) {
			assert.deepEqual( result.actual, result.expected, result.message );
		} );
	}
);

QUnit.test( "should handle node removal in event's remove hook (gh-5214)", function( assert ) {

	assert.expect( 4 );

	jQuery(
		"<div id='container'>" +
		"	<div class='guarded removeself' data-elt='one'>" +
		"		Guarded 1" +
		"	</div>" +
		"	<div class='guarded' data-elt='two'>" +
		"		Guarded 2" +
		"	</div>" +
		"	<div class='guarded' data-elt='three'>" +
		"		Guarded 3" +
		"	</div>" +
		"</div>"
	).appendTo( "#qunit-fixture" );

	// Define the custom event handler
	jQuery.event.special.removeondestroy = {
		remove: function( ) {
			var $t = jQuery( this );
			assert.step( $t.data( "elt" ) );
			if ( $t.is( ".removeself" ) ) {
				$t.remove();
			}
		}
	};

	// Attach an empty handler to trigger the `remove`
	// logic for the custom event when the element is removed.
	jQuery( ".guarded" ).on( "removeondestroy", function( ) { } );

	// Trigger the event's removal logic by emptying the container
	jQuery( "#container" ).empty();
Repository: jquery/jquery
File: test/unit/manipulation.js (JavaScript)

Code before:
QUnit.test( "should handle custom '_se-custom-destroy' event correctly", function( assert ) {

	// Define the expected number of assertions

	assert.expect( 4 );

	// Set up the HTML structure by appending to the existing fixture

	var fixture = jQuery( "#qunit-fixture" );

	fixture.append( `
	<div id="container">
	  <div class="guarded removeself" data-elt="one">
	    Guarded 1
	  </div>
	  <div class="guarded" data-elt="two">
	    Guarded 2
	  </div>
	  <div class="guarded" data-elt="three">
	    Guarded 3
	  </div>
	</div>
	` );

	// Define the custom event handler
	jQuery.event.special[ "_se-custom-destroy" ] = {
	remove: function( _handleObj ) {
		var $t = jQuery( this );
		assert.step( $t.data( "elt" ) );
		if ( $t.is( ".removeself" ) ) {
			$t.remove();
		}
	}
	};

	// Attach an empty handler to trigger the `remove`
	// logic for the custom event when the element is removed.

	jQuery( ".guarded" ).on( "_se-custom-destroy", function( ) { } );

	// Trigger the event by emptying the container

	jQuery( "#container" ).empty();

	// Verify the steps to ensure the expected elements were processed

	assert.verifySteps( [ "one", "two", "three" ], "Steps should match the data-elt attributes" );
} );



Review comment (bug):
We don't need to use the same event name as in the bug report. I don't think it's a good idea as tests don't carry the same context. Let's use something generic, like `removeondestroy`.

Code after:
	assert.expect( 4 );

	jQuery(
		"<div id='container'>" +
		"	<div class='guarded removeself' data-elt='one'>" +
		"		Guarded 1" +
		"	</div>" +
		"	<div class='guarded' data-elt='two'>" +
		"		Guarded 2" +
		"	</div>" +
		"	<div class='guarded' data-elt='three'>" +
		"		Guarded 3" +
		"	</div>" +
		"</div>"
	).appendTo( "#qunit-fixture" );

	// Define the custom event handler
	jQuery.event.special.removeondestroy = {
		remove: function( ) {
			var $t = jQuery( this );
			assert.step( $t.data( "elt" ) );
			if ( $t.is( ".removeself" ) ) {
				$t.remove();
			}
		}
	};

	// Attach an empty handler to trigger the `remove`
	// logic for the custom event when the element is removed.
	jQuery( ".guarded" ).on( "removeondestroy", function( ) { } );

	// Trigger the event's removal logic by emptying the container
	jQuery( "#container" ).empty();

	assert.verifySteps( [ "one", "two", "three" ], "All elements were processed in order" );
} );
Repository: jquery/jquery
File: test/unit/manipulation.js (JavaScript)

Code before:
			assert.deepEqual( result.actual, result.expected, result.message );
		} );
	}
);

QUnit.test( "should handle custom 'removeondestroy' event correctly", function( assert ) {

	assert.expect( 4 );

	jQuery( `
	<div id="container">
		<div class="guarded removeself" data-elt="one">
			Guarded 1
		</div>
		<div class="guarded" data-elt="two">
			Guarded 2
		</div>
		<div class="guarded" data-elt="three">
			Guarded 3
		</div>
	</div>
	` ).appendTo( "#qunit-fixture" );

	// Define the custom event handler
	jQuery.event.special.removeondestroy = {
	remove: function( _handleObj ) {
		var $t = jQuery( this );
		assert.step( $t.data( "elt" ) );
		if ( $t.is( ".removeself" ) ) {
			$t.remove();
		}
	}
	};

	// Attach an empty handler to trigger the `remove`
	// logic for the custom event when the element is removed.
	jQuery( ".guarded" ).on( "removeondestroy", function( ) { } );

	// Trigger the event's removal logic by emptying the container
	jQuery( "#container" ).empty();

	assert.verifySteps( [ "one", "two", "three" ], "All elements were processed in order" );
} );



Review comment (suggestion):
`_handleObj` is not used so let's just remove it:
```suggestion
	remove: function() {
```

Code after:
			assert.deepEqual( result.actual, result.expected, result.message );
		} );
	}
);

QUnit.test( "should handle node removal in event's remove hook (gh-5214)", function( assert ) {

	assert.expect( 4 );

	jQuery(
		"<div id='container'>" +
		"	<div class='guarded removeself' data-elt='one'>" +
		"		Guarded 1" +
		"	</div>" +
		"	<div class='guarded' data-elt='two'>" +
		"		Guarded 2" +
		"	</div>" +
		"	<div class='guarded' data-elt='three'>" +
		"		Guarded 3" +
		"	</div>" +
		"</div>"
	).appendTo( "#qunit-fixture" );

	// Define the custom event handler
	jQuery.event.special.removeondestroy = {
		remove: function( ) {
			var $t = jQuery( this );
			assert.step( $t.data( "elt" ) );
			if ( $t.is( ".removeself" ) ) {
				$t.remove();
			}
		}
	};

	// Attach an empty handler to trigger the `remove`
	// logic for the custom event when the element is removed.
	jQuery( ".guarded" ).on( "removeondestroy", function( ) { } );

	// Trigger the event's removal logic by emptying the container
	jQuery( "#container" ).empty();

	assert.verifySteps( [ "one", "two", "three" ], "All elements were processed in order" );
} );
Repository: jquery/jquery
File: src/manipulation/getAll.js (JavaScript)

Code before:
import { jQuery } from "../core.js";
import { nodeName } from "../core/nodeName.js";
import { arr } from "../var/arr.js";

export function getAll( context, tag ) {

	// Support: IE <=9 - 11+
	// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
	var ret;

	if ( typeof context.getElementsByTagName !== "undefined" ) {
		ret = arr.slice.call( context.getElementsByTagName( tag || "*" ) );

	} else if ( typeof context.querySelectorAll !== "undefined" ) {
		ret = context.querySelectorAll( tag || "*" );

	} else {
		ret = [];
	}

	if ( tag === undefined || tag && nodeName( context, tag ) ) {
		return jQuery.merge( [ context ], ret );
	}

	return ret;
}


Review comment (suggestion):
```suggestion
		// Use slice to snapshot the live collection from gEBTN
		ret = arr.slice.call( context.getElementsByTagName( tag || "*" ) );
```

Code after:
import { jQuery } from "../core.js";
import { nodeName } from "../core/nodeName.js";
import { arr } from "../var/arr.js";

export function getAll( context, tag ) {

	// Support: IE <=9 - 11+
	// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
	var ret;

	if ( typeof context.getElementsByTagName !== "undefined" ) {

		// Use slice to snapshot the live collection from gEBTN
		ret = arr.slice.call( context.getElementsByTagName( tag || "*" ) );

	} else if ( typeof context.querySelectorAll !== "undefined" ) {
		ret = context.querySelectorAll( tag || "*" );

	} else {
		ret = [];
	}

	if ( tag === undefined || tag && nodeName( context, tag ) ) {
		return jQuery.merge( [ context ], ret );
	}

	return ret;
}
Repository: jquery/jquery
File: src/manipulation/getAll.js (JavaScript)

Code before:
import { jQuery } from "../core.js";
import { nodeName } from "../core/nodeName.js";
import { arr } from "../var/arr.js";

export function getAll( context, tag ) {

	// Support: IE <=9 - 11+
	// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
	var ret;

	if ( typeof context.getElementsByTagName !== "undefined" ) {
		// Use slice to snapshot the live collection from gEBTN
		ret = arr.slice.call( context.getElementsByTagName( tag || "*" ) );

	} else if ( typeof context.querySelectorAll !== "undefined" ) {
		ret = context.querySelectorAll( tag || "*" );

	} else {
		ret = [];
	}

	if ( tag === undefined || tag && nodeName( context, tag ) ) {
		return jQuery.merge( [ context ], ret );
	}

	return ret;
}


Review comment (suggestion):
```suggestion

		// Use slice to snapshot the live collection from gEBTN
```

Code after:
import { jQuery } from "../core.js";
import { nodeName } from "../core/nodeName.js";
import { arr } from "../var/arr.js";

export function getAll( context, tag ) {

	// Support: IE <=9 - 11+
	// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
	var ret;

	if ( typeof context.getElementsByTagName !== "undefined" ) {

		// Use slice to snapshot the live collection from gEBTN
		ret = arr.slice.call( context.getElementsByTagName( tag || "*" ) );

	} else if ( typeof context.querySelectorAll !== "undefined" ) {
		ret = context.querySelectorAll( tag || "*" );

	} else {
		ret = [];
	}

	if ( tag === undefined || tag && nodeName( context, tag ) ) {
		return jQuery.merge( [ context ], ret );
	}

	return ret;
}
Repository: jquery/jquery
File: test/unit/manipulation.js (JavaScript)

Code before:
	function( assert, jQuery, window, document, test ) {

		assert.expect( 5 );

		test.forEach( function( result ) {
			assert.deepEqual( result.actual, result.expected, result.message );
		} );
	}
);

QUnit.test( "should handle node removal in event's remove hook (gh-5214)", function( assert ) {

	assert.expect( 4 );

	jQuery(
		"<div id='container'>" +
			"<div class='guarded removeself' data-elt='one'>" +
				"Guarded 1" +
			"</div>" +
			"<div class='guarded' data-elt='two'>" +
				"Guarded 2" +
			"</div>" +
			"<div class='guarded' data-elt='three'>" +
				"Guarded 3" +
			"</div>" +
		"</div>"
	).appendTo( "#qunit-fixture" );

	// Define the custom event handler
	jQuery.event.special.removeondestroy = {
		remove: function( ) {
			var $t = jQuery( this );
			assert.step( $t.data( "elt" ) );
			if ( $t.is( ".removeself" ) ) {
				$t.remove();
			}
		}
	};

	// Attach an empty handler to trigger the `remove`
	// logic for the custom event when the element is removed.
	jQuery( ".guarded" ).on( "removeondestroy", function( ) { } );

	// Trigger the event's removal logic by emptying the container
	jQuery( "#container" ).empty();

	assert.verifySteps( [ "one", "two", "three" ], "All elements were processed in order" );
} );



Review comment (suggestion):
I've just noticed this uses different indendation based on the intended HTML indentation. This poses two issues:
1. The final HTML string does not have this indentation at all.
2. If we enable indent ESLint rules for test, this code will be auto-fixed to start in one line.

When doing indentation in HTML strings, indentation should be a part of the string, not done outside. See https://github.com/jquery/jquery/blob/6d78c0768d9aa6ba213678724c89af69a1958df6/test/unit/css.js#L646-L670 for an example of such in-string indentation.

Code after:
	function( assert, jQuery, window, document, test ) {

		assert.expect( 5 );

		test.forEach( function( result ) {
			assert.deepEqual( result.actual, result.expected, result.message );
		} );
	}
);

QUnit.test( "should handle node removal in event's remove hook (gh-5214)", function( assert ) {

	assert.expect( 4 );

	jQuery(
		"<div id='container'>" +
		"	<div class='guarded removeself' data-elt='one'>" +
		"		Guarded 1" +
		"	</div>" +
		"	<div class='guarded' data-elt='two'>" +
		"		Guarded 2" +
		"	</div>" +
		"	<div class='guarded' data-elt='three'>" +
		"		Guarded 3" +
		"	</div>" +
		"</div>"
	).appendTo( "#qunit-fixture" );

	// Define the custom event handler
	jQuery.event.special.removeondestroy = {
		remove: function( ) {
			var $t = jQuery( this );
			assert.step( $t.data( "elt" ) );
			if ( $t.is( ".removeself" ) ) {
				$t.remove();
			}
		}
	};

	// Attach an empty handler to trigger the `remove`
	// logic for the custom event when the element is removed.
	jQuery( ".guarded" ).on( "removeondestroy", function( ) { } );

	// Trigger the event's removal logic by emptying the container
	jQuery( "#container" ).empty();

	assert.verifySteps( [ "one", "two", "three" ], "All elements were processed in order" );
} );
Repository: jquery/jquery
File: src/css/finalPropName.js (JavaScript)

Code before:
import { document } from "../var/document.js";

var cssPrefixes = [ "Webkit", "Moz", "ms" ],
	emptyStyle = document.createElement( "div" ).style;

// Return a potentially-mapped vendor prefixed property
export function finalPropName( name ) {
	if ( name in emptyStyle ) {
		return name;
	}

	// Check for vendor prefixed names
	var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
		i = cssPrefixes.length;

	while ( i-- ) {
		name = cssPrefixes[ i ] + capName;
		if ( name in emptyStyle ) {
			return name;
		}
	}

	return name;
}


Review comment (suggestion):
Just a reminder: as stated in https://github.com/jquery/jquery/pull/5583#issuecomment-2487013528, we have to avoid overwriting the `name` parameter, line 17 above.

Code after:
import { document } from "../var/document.js";

var cssPrefixes = [ "Webkit", "Moz", "ms" ],
	emptyStyle = document.createElement( "div" ).style;

// Return a vendor-prefixed property or undefined
function vendorPropName( name ) {

	// Check for vendor prefixed names
	var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
		i = cssPrefixes.length;

	while ( i-- ) {
		name = cssPrefixes[ i ] + capName;
		if ( name in emptyStyle ) {
			return name;
		}
	}
}

// Return a potentially-mapped vendor prefixed property
export function finalPropName( name ) {
	if ( name in emptyStyle ) {
		return name;
	}
	return vendorPropName( name ) || name;
}
Repository: jquery/jquery
File: src/attributes/attr.js (JavaScript)

Code before:
			// Attribute names can contain non-HTML whitespace characters
			// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
			attrNames = value && value.match( rnothtmlwhite );

		if ( attrNames && elem.nodeType === 1 ) {
			while ( ( name = attrNames[ i++ ] ) ) {
				elem.removeAttribute( name );
			}
		}
	}
} );

// Hooks for boolean attributes
boolHook = {
	set: function( elem, value, name ) {
		if ( value === false ) {

			// Remove boolean attributes when set to false
			jQuery.removeAttr( elem, name );
		} else if (
			name.toLowerCase() !== "hidden" ||
				String( value ).toLowerCase() !== "until-found"
		) {
			elem.setAttribute( name, name );
		} else {
			elem.setAttribute( name, value );
		}
		return name;
	}
};

jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
	var getter = attrHandle[ name ] || jQuery.find.attr;

	attrHandle[ name ] = function( elem, name, isXML ) {
		var ret, handle,
			lowercaseName = name.toLowerCase();

		if ( !isXML ) {

			// Avoid an infinite loop by temporarily removing this function from the getter
			handle = attrHandle[ lowercaseName ];
			attrHandle[ lowercaseName ] = ret;

			ret = getter( elem, name, isXML );
			if ( ret != null ) {
				if ( lowercaseName !== "hidden" ||
					ret.toLowerCase() !== "until-found"
				) {
					ret = lowercaseName;
				}

Review comment (suggestion):
```suggestion
        } else {
            elem.setAttribute( name, name.toLowerCase() === "hidden" &&
                strValue.toLowerCase() === "until-found" ? strValue : name );
```
(with `var strValue = String( value );`)

Code after:
			// Attribute names can contain non-HTML whitespace characters
			// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
			attrNames = value && value.match( rnothtmlwhite );

		if ( attrNames && elem.nodeType === 1 ) {
			while ( ( name = attrNames[ i++ ] ) ) {
				elem.removeAttribute( name );
			}
		}
	}
} );

// Hooks for boolean attributes
boolHook = {
	set: function( elem, value, name ) {
		var strValue = String( value );

		if ( value === false ) {

			// Remove boolean attributes when set to false
			jQuery.removeAttr( elem, name );
		} else {
			elem.setAttribute( name,
				name.toLowerCase() === "hidden" &&
						strValue.toLowerCase() === "until-found" ?
					strValue :
					name
			);
		}
		return name;
	}
};

jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
	var getter = attrHandle[ name ] || jQuery.find.attr;

	attrHandle[ name ] = function( elem, name, isXML ) {
		var ret, handle,
			lowercaseName = name.toLowerCase();

		if ( !isXML ) {

			// Avoid an infinite loop by temporarily removing this function from the getter
			handle = attrHandle[ lowercaseName ];
			attrHandle[ lowercaseName ] = ret;

			ret = getter( elem, name, isXML );
			ret = ret == null ||
					( lowercaseName === "hidden" && ret.toLowerCase() === "until-found" ) ?
				ret :
				lowercaseName;
Repository: jquery/jquery
File: src/attributes/attr.js (JavaScript)

Code before:
		}
		return name;
	}
};

jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
	var getter = attrHandle[ name ] || jQuery.find.attr;

	attrHandle[ name ] = function( elem, name, isXML ) {
		var ret, handle,
			lowercaseName = name.toLowerCase();

		if ( !isXML ) {

			// Avoid an infinite loop by temporarily removing this function from the getter
			handle = attrHandle[ lowercaseName ];
			attrHandle[ lowercaseName ] = ret;

			ret = getter( elem, name, isXML );
			if ( ret != null ) {
				if ( lowercaseName !== "hidden" ||
					ret.toLowerCase() !== "until-found"
				) {
					ret = lowercaseName;
				}
			}

			attrHandle[ lowercaseName ] = handle;
		}
		return ret;
	};
} );

} );


Review comment (suggestion):
```suggestion
            ret = ret == null || lowercaseName === "hidden" &&
                ret.toLowerCase() === "until-found" ? ret : lowercaseName;
```

Code after:
					name
			);
		}
		return name;
	}
};

jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
	var getter = attrHandle[ name ] || jQuery.find.attr;

	attrHandle[ name ] = function( elem, name, isXML ) {
		var ret, handle,
			lowercaseName = name.toLowerCase();

		if ( !isXML ) {

			// Avoid an infinite loop by temporarily removing this function from the getter
			handle = attrHandle[ lowercaseName ];
			attrHandle[ lowercaseName ] = ret;

			ret = getter( elem, name, isXML );
			ret = ret == null ||
					( lowercaseName === "hidden" && ret.toLowerCase() === "until-found" ) ?
				ret :
				lowercaseName;

			attrHandle[ lowercaseName ] = handle;
		}
		return ret;
	};
} );

} );
Repository: jquery/jquery
File: src/var/createElement.js (JavaScript)

Code before:
import { document } from "./document.js";

// Support: XSLT documents
// In XSLT-transformed documents, `document.createElement` creates elements
// in the XML namespace where `.style` is `undefined`. Using `createElementNS`
// with the XHTML namespace ensures elements have full HTML behavior.
export function createElement( tag ) {
	return document.createElementNS( "http://www.w3.org/1999/xhtml", tag );
}


Review comment (suggestion):
It's not just XSLT documents but any XML ones, i.e. with `Content-type: application/xml`, right? Let's change the comment to be more about XML.

Code after:
import { document } from "./document.js";

// Support: XML documents
// In XML documents, `document.createElement` creates elements in the XML
// namespace where `.style` is `undefined`. Using `createElementNS` with
// the XHTML namespace ensures elements have full HTML behavior.
export function createElement( tag ) {
	return document.createElementNS( "http://www.w3.org/1999/xhtml", tag );
}