diff --git a/src/attributes.js b/src/attributes.js index 5396a90e..9b8c4bf0 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -20,11 +20,11 @@ jQuery.fn.extend({ jQuery.removeAttr( this, name ); }); }, - + prop: function( name, value ) { return jQuery.access( this, name, value, true, jQuery.prop ); }, - + removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { @@ -156,7 +156,7 @@ jQuery.fn.extend({ val: function( value ) { var hooks, ret, elem = this[0]; - + if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; @@ -167,9 +167,9 @@ jQuery.fn.extend({ ret = elem.value; - return typeof ret === "string" ? + return typeof ret === "string" ? // handle most common string cases - ret.replace(rreturn, "") : + ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } @@ -290,15 +290,15 @@ jQuery.extend({ height: true, offset: true }, - + attrFix: { // Always normalize to ensure hook usage tabindex: "tabIndex" }, - + attr: function( elem, name, value, pass ) { var nType = elem.nodeType; - + // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return undefined; @@ -367,7 +367,7 @@ jQuery.extend({ var propName; if ( elem.nodeType === 1 ) { name = jQuery.attrFix[ name ] || name; - + if ( jQuery.support.getSetAttribute ) { // Use removeAttribute in browsers that support it elem.removeAttribute( name ); @@ -431,7 +431,7 @@ jQuery.extend({ frameborder: "frameBorder", contenteditable: "contentEditable" }, - + prop: function( elem, name, value ) { var nType = elem.nodeType; @@ -445,7 +445,7 @@ jQuery.extend({ // Try to normalize/fix the name name = notxml && jQuery.propFix[ name ] || name; - + hooks = jQuery.propHooks[ name ]; if ( value !== undefined ) { @@ -465,7 +465,7 @@ jQuery.extend({ } } }, - + propHooks: {} }); @@ -522,7 +522,7 @@ if ( !jQuery.support.getSetAttribute ) { // propFix is more comprehensive and contains all fixes jQuery.attrFix = jQuery.propFix; - + // Use this for any attribute on a form in IE6/7 formHook = jQuery.attrHooks.name = jQuery.attrHooks.title = jQuery.valHooks.button = { get: function( elem, name ) { diff --git a/test/abortonunload.php b/test/abortonunload.php new file mode 100644 index 00000000..2bcec853 --- /dev/null +++ b/test/abortonunload.php @@ -0,0 +1,114 @@ + + + + + jQuery Abort-On-Unload Test + + + + + + + + + + + + + + + + + + + + + + + + +

+ jQuery Abort-On-Unload Test +

+
+ This page tests a fix that will abort requests on abort so that Internet Explorer + does not keep connections alive. +
+
+ In this situation, no callback should be triggered. +
+
Take the following steps:
+
    +
  1. + open the console, +
  2. +
  3. + set it to persistent mode if available, +
  4. +
  5. + click this + + to make a request and trigger the beforeunload event, +
  6. +
  7. + then either: +
      +
    1. + wait for the request to complete then cancel unload, +
    2. +
    3. + fire unload (you have 10 seconds to do so). +
    4. +
    +
  8. +
+
+ Test passes if: +
    +
  1. + you get a "success" logged, +
  2. +
  3. + you get no "error" log and no alert. +
  4. +
+
+ + \ No newline at end of file diff --git a/test/delegatetest.html b/test/delegatetest.html index 169e60f7..7d891b95 100644 --- a/test/delegatetest.html +++ b/test/delegatetest.html @@ -182,16 +182,16 @@ BUTTON DOCUMENT - - + +

Mouseleave Tests

-

Count mouse leave event

-
-

mouse over here should not trigger the counter.

-
-

0

+

Count mouse leave event

+
+

mouse over here should not trigger the counter.

+
+

0

diff --git a/test/unit/attributes.js b/test/unit/attributes.js index 56c398e5..cd8d7777 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -6,7 +6,7 @@ var functionReturningObj = function(value) { return (function() { return value; test("jQuery.attrFix/jQuery.propFix integrity test", function() { expect(2); - + // This must be maintained and equal jQuery.attrFix when appropriate // Ensure that accidental or erroneous property // overwrites don't occur @@ -57,7 +57,7 @@ test("attr(String)", function() { equals( jQuery("
").attr("value"), "t", "Check setting custom attr named 'value' on a div" ); equals( jQuery("#form").attr("blah", "blah").attr("blah"), "blah", "Set non-existant attribute on a form" ); equals( jQuery("#foo").attr("height"), undefined, "Non existent height attribute should return undefined" ); - + // [7472] & [3113] (form contains an input with name="action" or name="id") var extras = jQuery("").appendTo("#testForm"); equals( jQuery("#form").attr("action","newformaction").attr("action"), "newformaction", "Check that action attribute was changed" ); @@ -67,7 +67,7 @@ test("attr(String)", function() { // Bug #3685 (form contains input with name="name") equals( jQuery("#testForm").attr("name"), undefined, "Retrieving name does not retrieve input with name=name" ); extras.remove(); - + equals( jQuery("#text1").attr("maxlength"), "30", "Check for maxlength attribute" ); equals( jQuery("#text1").attr("maxLength"), "30", "Check for maxLength attribute" ); equals( jQuery("#area1").attr("maxLength"), "30", "Check for maxLength attribute" ); @@ -248,7 +248,7 @@ test("attr(String, Object)", function() { commentNode = document.createComment("some comment"), textNode = document.createTextNode("some text"), obj = {}; - + jQuery.each( [commentNode, textNode, attributeNode], function( i, elem ) { var $elem = jQuery( elem ); $elem.attr( "nonexisting", "foo" ); @@ -288,7 +288,7 @@ test("attr(String, Object)", function() { j.removeAttr("name"); QUnit.reset(); - + // Type var type = jQuery("#check2").attr("type"); var thrown = false; @@ -450,7 +450,7 @@ test("removeAttr(String)", function() { equals( jQuery("#foo").attr("style", "position:absolute;").removeAttr("style").attr("style"), undefined, "Check removing style attribute" ); equals( jQuery("#form").attr("style", "position:absolute;").removeAttr("style").attr("style"), undefined, "Check removing style attribute on a form" ); equals( jQuery("#fx-test-group").attr("height", "3px").removeAttr("height").css("height"), "1px", "Removing height attribute has no effect on height set with style attribute" ); - + jQuery("#check1").removeAttr("checked").prop("checked", true).removeAttr("checked"); equals( document.getElementById("check1").checked, false, "removeAttr sets boolean properties to false" ); jQuery("#text1").prop("readOnly", true).removeAttr("readonly"); @@ -607,11 +607,11 @@ test("val()", function() { var $button = jQuery("").insertAfter("#button"); equals( $button.val(), "foobar", "Value retrieval on a button does not return innerHTML" ); equals( $button.val("baz").html(), "text", "Setting the value does not change innerHTML" ); - + equals( jQuery("