Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit58f0c00

Browse files
authored
Core: Remove deprecated jQuery APIs
Fixesgh-4056Closesgh-4364
1 parent6f2fae7 commit58f0c00

File tree

6 files changed

+14
-497
lines changed

6 files changed

+14
-497
lines changed

‎src/css.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,6 @@ jQuery.extend( {
199199
}
200200
},
201201

202-
// Add in properties whose names you wish to fix before
203-
// setting or getting the value
204-
cssProps:{},
205-
206202
// Get and set the style property on a DOM Node
207203
style:function(elem,name,value,extra){
208204

‎src/css/finalPropName.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
define([
2-
"../var/document",
3-
"../core"
4-
],function(document,jQuery){
2+
"../var/document"
3+
],function(document){
54

65
"use strict";
76

@@ -24,9 +23,9 @@ function vendorPropName( name ) {
2423
}
2524
}
2625

27-
// Return a potentially-mappedjQuery.cssProps orvendor prefixed property
26+
// Return a potentially-mapped vendor prefixed property
2827
functionfinalPropName(name){
29-
varfinal=jQuery.cssProps[name]||vendorProps[name];
28+
varfinal=vendorProps[name];
3029

3130
if(final){
3231
returnfinal;

‎src/deprecated.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -71,28 +71,4 @@ jQuery.holdReady = function( hold ) {
7171
jQuery.ready(true);
7272
}
7373
};
74-
jQuery.isArray=Array.isArray;
75-
jQuery.parseJSON=JSON.parse;
76-
jQuery.nodeName=nodeName;
77-
jQuery.isFunction=isFunction;
78-
jQuery.isWindow=isWindow;
79-
jQuery.camelCase=cssCamelCase;
80-
jQuery.type=toType;
81-
82-
jQuery.now=Date.now;
83-
84-
jQuery.isNumeric=function(obj){
85-
86-
// As of jQuery 3.0, isNumeric is limited to
87-
// strings and numbers (primitives or objects)
88-
// that can be coerced to finite numbers (gh-2662)
89-
vartype=jQuery.type(obj);
90-
return(type==="number"||type==="string")&&
91-
92-
// parseFloat NaNs numeric-cast false positives ("")
93-
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
94-
// subtraction forces infinities to NaN
95-
!isNaN(obj-parseFloat(obj));
96-
};
97-
9874
});

‎test/unit/css.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,23 +1108,6 @@ QUnit.test( "box model properties incorrectly returning % instead of px, see #10
11081108
assert.equal(el2.css("marginLeft"),"100px","css('marginLeft') returning incorrect pixel value, see #12088");
11091109
});
11101110

1111-
QUnit.test("jQuery.cssProps behavior, (bug #8402)",function(assert){
1112-
assert.expect(2);
1113-
1114-
vardiv=jQuery("<div>").appendTo(document.body).css({
1115-
"position":"absolute",
1116-
"top":0,
1117-
"left":10
1118-
});
1119-
jQuery.cssProps.top="left";
1120-
assert.equal(div.css("top"),"10px","the fixed property is used when accessing the computed style");
1121-
div.css("top","100px");
1122-
assert.equal(div[0].style.left,"100px","the fixed property is used when setting the style");
1123-
1124-
// cleanup jQuery.cssProps
1125-
jQuery.cssProps.top=undefined;
1126-
});
1127-
11281111
QUnit.test("widows & orphans #8936",function(assert){
11291112

11301113
var$p=jQuery("<p>").appendTo("#qunit-fixture");
@@ -1713,13 +1696,6 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function(
17131696
(function(){
17141697
varvendorPrefixes=["Webkit","Moz","ms"];
17151698

1716-
functionresetCssPropsFor(name){
1717-
deletejQuery.cssProps[name];
1718-
jQuery.each(vendorPrefixes,function(index,prefix){
1719-
deletejQuery.cssProps[prefix+name[0].toUpperCase()+name.slice(1)];
1720-
});
1721-
}
1722-
17231699
QUnit.test("Don't default to a cached previously used wrong prefixed name (gh-2015)",function(assert){
17241700

17251701
// Note: this test needs a property we know is only supported in a prefixed version
@@ -1753,9 +1729,6 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function(
17531729

17541730
assert.expect(!!appearanceName+!!transformName+1);
17551731

1756-
resetCssPropsFor("appearance");
1757-
resetCssPropsFor("transform");
1758-
17591732
elem=jQuery("<div/>")
17601733
.css({
17611734
msAppearance:"none",

‎test/unit/data.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ QUnit.test( ".data supports interoperable hyphenated/camelCase get/set of proper
755755

756756
QUnit.test(".data supports interoperable removal of hyphenated/camelCase properties",function(assert){
757757
vardiv=jQuery("<div/>",{id:"hyphened"}).appendTo("#qunit-fixture"),
758+
rdashAlpha=/-([a-z])/g,
758759
datas={
759760
"non-empty":"a string",
760761
"empty-string":"",
@@ -773,11 +774,19 @@ QUnit.test( ".data supports interoperable removal of hyphenated/camelCase proper
773774

774775
assert.expect(27);
775776

777+
functionfcamelCase(all,letter){
778+
returnletter.toUpperCase();
779+
}
780+
776781
jQuery.each(datas,function(key,val){
777782
div.data(key,val);
778783

779784
assert.deepEqual(div.data(key),val,"get: "+key);
780-
assert.deepEqual(div.data(jQuery.camelCase(key)),val,"get: "+jQuery.camelCase(key));
785+
assert.deepEqual(
786+
div.data(key.replace(rdashAlpha,fcamelCase)),
787+
val,
788+
"get: "+key.replace(rdashAlpha,fcamelCase)
789+
);
781790

782791
div.removeData(key);
783792

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp