Commit 11adde51 authored by louisremi's avatar louisremi

second batch

parent cccd092f
...@@ -180,7 +180,7 @@ jQuery.offset = { ...@@ -180,7 +180,7 @@ jQuery.offset = {
curOffset = curElem.offset(), curOffset = curElem.offset(),
curCSSTop = jQuery.css( elem, "top" ), curCSSTop = jQuery.css( elem, "top" ),
curCSSLeft = jQuery.css( elem, "left" ), curCSSLeft = jQuery.css( elem, "left" ),
calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1, calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
props = {}, curPosition = {}, curTop, curLeft; props = {}, curPosition = {}, curTop, curLeft;
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -283,11 +283,11 @@ test(".data(String) and .data(String, Object)", function() { ...@@ -283,11 +283,11 @@ test(".data(String) and .data(String, Object)", function() {
// #3748 // #3748
var $elem = jQuery({exists:true}); var $elem = jQuery({exists:true});
equals( $elem.data('nothing'), undefined, "Non-existent data returns undefined"); equals( $elem.data("nothing"), undefined, "Non-existent data returns undefined");
equals( $elem.data('null',null).data('null'), null, "null's are preserved"); equals( $elem.data("null", null).data("null"), null, "null's are preserved");
equals( $elem.data('emptyString','').data('emptyString'), '', "Empty strings are preserved"); equals( $elem.data("emptyString", "").data("emptyString"), "", "Empty strings are preserved");
equals( $elem.data('false',false).data('false'), false, "false's are preserved"); equals( $elem.data("false", false).data("false"), false, "false's are preserved");
equals( $elem.data('exists'), undefined, "Existing data is not returned" ); equals( $elem.data("exists"), undefined, "Existing data is not returned" );
// Clean up // Clean up
$elem.removeData(); $elem.removeData();
...@@ -316,7 +316,7 @@ test("data-* attributes", function() { ...@@ -316,7 +316,7 @@ test("data-* attributes", function() {
div.remove(); div.remove();
child.appendTo('#main'); child.appendTo("#main");
equals( child.data("myobj"), "old data", "Value accessed from data-* attribute"); equals( child.data("myobj"), "old data", "Value accessed from data-* attribute");
child.data("myobj", "replaced"); child.data("myobj", "replaced");
...@@ -365,19 +365,19 @@ test("data-* attributes", function() { ...@@ -365,19 +365,19 @@ test("data-* attributes", function() {
.attr("data-null", "null") .attr("data-null", "null")
.attr("data-string", "test"); .attr("data-string", "test");
strictEqual( child.data('true'), true, "Primitive true read from attribute"); strictEqual( child.data("true"), true, "Primitive true read from attribute");
strictEqual( child.data('false'), false, "Primitive false read from attribute"); strictEqual( child.data("false"), false, "Primitive false read from attribute");
strictEqual( child.data('five'), 5, "Primitive number read from attribute"); strictEqual( child.data("five"), 5, "Primitive number read from attribute");
strictEqual( child.data('point'), 5.5, "Primitive number read from attribute"); strictEqual( child.data("point"), 5.5, "Primitive number read from attribute");
strictEqual( child.data('pointe'), 5500, "Primitive number read from attribute"); strictEqual( child.data("pointe"), 5500, "Primitive number read from attribute");
strictEqual( child.data('pointbad'), "5..5", "Bad number read from attribute"); strictEqual( child.data("pointbad"), "5..5", "Bad number read from attribute");
strictEqual( child.data('pointbad2'), "-.", "Bad number read from attribute"); strictEqual( child.data("pointbad2"), "-.", "Bad number read from attribute");
strictEqual( child.data('badjson'), "{123}", "Bad number read from attribute"); strictEqual( child.data("badjson"), "{123}", "Bad number read from attribute");
strictEqual( child.data('badjson2'), "[abc]", "Bad number read from attribute"); strictEqual( child.data("badjson2"), "[abc]", "Bad number read from attribute");
strictEqual( child.data('empty'), "", "Empty string read from attribute"); strictEqual( child.data("empty"), "", "Empty string read from attribute");
strictEqual( child.data('space'), " ", "Empty string read from attribute"); strictEqual( child.data("space"), " ", "Empty string read from attribute");
strictEqual( child.data('null'), null, "Primitive null read from attribute"); strictEqual( child.data("null"), null, "Primitive null read from attribute");
strictEqual( child.data('string'), "test", "Typical string read from attribute"); strictEqual( child.data("string"), "test", "Typical string read from attribute");
child.remove(); child.remove();
...@@ -401,12 +401,12 @@ test("data-* attributes", function() { ...@@ -401,12 +401,12 @@ test("data-* attributes", function() {
same(jQuery(elem).data("stuff"), [2,8], "Check stuff property"); same(jQuery(elem).data("stuff"), [2,8], "Check stuff property");
break; break;
default: default:
ok(false, ["Assertion failed on index ", index, ", with data ", data].join('')); ok(false, ["Assertion failed on index ", index, ", with data ", data].join(""));
} }
} }
var metadata = '<ol><li class="test test2" data-foo="bar" data-bar="baz" data-arr="[1,2]">Some stuff</li><li class="test test2" data-test="bar" data-bar="baz">Some stuff</li><li class="test test2" data-zoooo="bar" data-bar=\'{"test":"baz"}\'>Some stuff</li><li class="test test2" data-number=true data-stuff="[2,8]">Some stuff</li></ol>', var metadata = "<ol><li class='test test2' data-foo='bar' data-bar='baz' data-arr='[1,2]'>Some stuff</li><li class='test test2' data-test='bar' data-bar='baz'>Some stuff</li><li class='test test2' data-zoooo='bar' data-bar='{\"test\":\"baz\"}'>Some stuff</li><li class='test test2' data-number=true data-stuff='[2,8]'>Some stuff</li></ol>",
elem = jQuery(metadata).appendTo('#main'); elem = jQuery(metadata).appendTo("#main");
elem.find("li").each(testData); elem.find("li").each(testData);
elem.remove(); elem.remove();
...@@ -483,7 +483,7 @@ if (window.JSON && window.JSON.stringify) { ...@@ -483,7 +483,7 @@ if (window.JSON && window.JSON.stringify) {
var obj = { foo: "bar" }; var obj = { foo: "bar" };
jQuery.data(obj, "hidden", true); jQuery.data(obj, "hidden", true);
equals( JSON.stringify(obj), '{"foo":"bar"}', "Expando is hidden from JSON.stringify" ); equals( JSON.stringify(obj), "{\"foo\":\"bar\"}", "Expando is hidden from JSON.stringify" );
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment