Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
d837f119
Commit
d837f119
authored
Apr 25, 2014
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support: clean up comments and Support notation
Closes gh-1577
parent
ff9dcfb0
Changes
28
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
161 additions
and
170 deletions
+161
-170
ajax.js
src/ajax.js
+5
-6
attr.js
src/attributes/attr.js
+0
-2
classes.js
src/attributes/classes.js
+4
-4
prop.js
src/attributes/prop.js
+1
-3
support.js
src/attributes/support.js
+8
-8
val.js
src/attributes/val.js
+3
-5
core.js
src/core.js
+4
-6
init.js
src/core/init.js
+3
-3
ready.js
src/core/ready.js
+1
-1
css.js
src/css.js
+28
-29
addGetHookIf.js
src/css/addGetHookIf.js
+2
-4
curCSS.js
src/css/curCSS.js
+1
-1
defaultDisplay.js
src/css/defaultDisplay.js
+1
-1
support.js
src/css/support.js
+4
-0
data.js
src/data.js
+10
-11
Data.js
src/data/Data.js
+2
-2
deferred.js
src/deferred.js
+2
-2
dimensions.js
src/dimensions.js
+1
-1
effects.js
src/effects.js
+29
-30
Tween.js
src/effects/Tween.js
+7
-7
event.js
src/event.js
+5
-5
global.js
src/exports/global.js
+2
-2
intro.js
src/intro.js
+8
-8
manipulation.js
src/manipulation.js
+9
-11
support.js
src/manipulation/support.js
+6
-5
offset.js
src/offset.js
+9
-6
queue.js
src/queue.js
+3
-3
traversing.js
src/traversing.js
+3
-4
No files found.
src/ajax.js
View file @
d837f119
...
@@ -44,8 +44,8 @@ var
...
@@ -44,8 +44,8 @@ var
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
allTypes
=
"*/"
.
concat
(
"*"
);
allTypes
=
"*/"
.
concat
(
"*"
);
//
#8138, IE may throw an exception when accessing
//
Support: IE6
//
a field from window.location if document.domain has been set
//
Exception accessing window.location.href if document.domain is set (#8138)
try
{
try
{
ajaxLocation
=
location
.
href
;
ajaxLocation
=
location
.
href
;
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -610,7 +610,7 @@ jQuery.extend({
...
@@ -610,7 +610,7 @@ jQuery.extend({
return
jqXHR
.
abort
();
return
jqXHR
.
abort
();
}
}
//
a
borting is no longer a cancellation
//
A
borting is no longer a cancellation
strAbort
=
"abort"
;
strAbort
=
"abort"
;
// Install callbacks on deferreds
// Install callbacks on deferreds
...
@@ -722,8 +722,7 @@ jQuery.extend({
...
@@ -722,8 +722,7 @@ jQuery.extend({
isSuccess
=
!
error
;
isSuccess
=
!
error
;
}
}
}
else
{
}
else
{
// We extract error from statusText
// Extract error from statusText and normalize for non-aborts
// then normalize statusText and status for non-aborts
error
=
statusText
;
error
=
statusText
;
if
(
status
||
!
statusText
)
{
if
(
status
||
!
statusText
)
{
statusText
=
"error"
;
statusText
=
"error"
;
...
@@ -779,7 +778,7 @@ jQuery.extend({
...
@@ -779,7 +778,7 @@ jQuery.extend({
jQuery
.
each
(
[
"get"
,
"post"
],
function
(
i
,
method
)
{
jQuery
.
each
(
[
"get"
,
"post"
],
function
(
i
,
method
)
{
jQuery
[
method
]
=
function
(
url
,
data
,
callback
,
type
)
{
jQuery
[
method
]
=
function
(
url
,
data
,
callback
,
type
)
{
//
s
hift arguments if data argument was omitted
//
S
hift arguments if data argument was omitted
if
(
jQuery
.
isFunction
(
data
)
)
{
if
(
jQuery
.
isFunction
(
data
)
)
{
type
=
type
||
callback
;
type
=
type
||
callback
;
callback
=
data
;
callback
=
data
;
...
...
src/attributes/attr.js
View file @
d837f119
...
@@ -96,8 +96,6 @@ jQuery.extend({
...
@@ -96,8 +96,6 @@ jQuery.extend({
set
:
function
(
elem
,
value
)
{
set
:
function
(
elem
,
value
)
{
if
(
!
support
.
radioValue
&&
value
===
"radio"
&&
if
(
!
support
.
radioValue
&&
value
===
"radio"
&&
jQuery
.
nodeName
(
elem
,
"input"
)
)
{
jQuery
.
nodeName
(
elem
,
"input"
)
)
{
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to default in case type is set after value during creation
var
val
=
elem
.
value
;
var
val
=
elem
.
value
;
elem
.
setAttribute
(
"type"
,
value
);
elem
.
setAttribute
(
"type"
,
value
);
if
(
val
)
{
if
(
val
)
{
...
...
src/attributes/classes.js
View file @
d837f119
...
@@ -83,7 +83,7 @@ jQuery.fn.extend({
...
@@ -83,7 +83,7 @@ jQuery.fn.extend({
}
}
}
}
//
o
nly assign if different to avoid unneeded rendering.
//
O
nly assign if different to avoid unneeded rendering.
finalValue
=
value
?
jQuery
.
trim
(
cur
)
:
""
;
finalValue
=
value
?
jQuery
.
trim
(
cur
)
:
""
;
if
(
elem
.
className
!==
finalValue
)
{
if
(
elem
.
className
!==
finalValue
)
{
elem
.
className
=
finalValue
;
elem
.
className
=
finalValue
;
...
@@ -110,14 +110,14 @@ jQuery.fn.extend({
...
@@ -110,14 +110,14 @@ jQuery.fn.extend({
return
this
.
each
(
function
()
{
return
this
.
each
(
function
()
{
if
(
type
===
"string"
)
{
if
(
type
===
"string"
)
{
//
t
oggle individual class names
//
T
oggle individual class names
var
className
,
var
className
,
i
=
0
,
i
=
0
,
self
=
jQuery
(
this
),
self
=
jQuery
(
this
),
classNames
=
value
.
match
(
rnotwhite
)
||
[];
classNames
=
value
.
match
(
rnotwhite
)
||
[];
while
(
(
className
=
classNames
[
i
++
])
)
{
while
(
(
className
=
classNames
[
i
++
])
)
{
//
c
heck each className given, space separated list
//
C
heck each className given, space separated list
if
(
self
.
hasClass
(
className
)
)
{
if
(
self
.
hasClass
(
className
)
)
{
self
.
removeClass
(
className
);
self
.
removeClass
(
className
);
}
else
{
}
else
{
...
@@ -132,7 +132,7 @@ jQuery.fn.extend({
...
@@ -132,7 +132,7 @@ jQuery.fn.extend({
data_priv
.
set
(
this
,
"__className__"
,
this
.
className
);
data_priv
.
set
(
this
,
"__className__"
,
this
.
className
);
}
}
// If the element has a class name or if we're passed
"false"
,
// If the element has a class name or if we're passed
`false`
,
// then remove the whole classname (if there was one, the above saved it).
// then remove the whole classname (if there was one, the above saved it).
// Otherwise bring back whatever was previously saved (if anything),
// Otherwise bring back whatever was previously saved (if anything),
// falling back to the empty string if nothing was stored.
// falling back to the empty string if nothing was stored.
...
...
src/attributes/prop.js
View file @
d837f119
...
@@ -28,7 +28,7 @@ jQuery.extend({
...
@@ -28,7 +28,7 @@ jQuery.extend({
var
ret
,
hooks
,
notxml
,
var
ret
,
hooks
,
notxml
,
nType
=
elem
.
nodeType
;
nType
=
elem
.
nodeType
;
//
d
on't get/set properties on text, comment and attribute nodes
//
D
on't get/set properties on text, comment and attribute nodes
if
(
!
elem
||
nType
===
3
||
nType
===
8
||
nType
===
2
)
{
if
(
!
elem
||
nType
===
3
||
nType
===
8
||
nType
===
2
)
{
return
;
return
;
}
}
...
@@ -64,8 +64,6 @@ jQuery.extend({
...
@@ -64,8 +64,6 @@ jQuery.extend({
}
}
});
});
// Support: IE9+
// Selectedness for an option in an optgroup can be inaccurate
if
(
!
support
.
optSelected
)
{
if
(
!
support
.
optSelected
)
{
jQuery
.
propHooks
.
selected
=
{
jQuery
.
propHooks
.
selected
=
{
get
:
function
(
elem
)
{
get
:
function
(
elem
)
{
...
...
src/attributes/support.js
View file @
d837f119
...
@@ -9,21 +9,21 @@ define([
...
@@ -9,21 +9,21 @@ define([
input
.
type
=
"checkbox"
;
input
.
type
=
"checkbox"
;
// Support: iOS
5.1, Android 4.x, Android 2.3
// Support: iOS
<=5.1, Android<=4.2+
//
Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere)
//
Default value for a checkbox should be "on"
support
.
checkOn
=
input
.
value
!==
""
;
support
.
checkOn
=
input
.
value
!==
""
;
//
Must access the parent to make an option select properly
//
Support: IE<=11+
//
Support: IE9, IE10
//
Must access selectedIndex to make default options select
support
.
optSelected
=
opt
.
selected
;
support
.
optSelected
=
opt
.
selected
;
//
Make sure that the options inside disabled selects aren't marked as disabled
//
Support: Android<=2.3
//
(WebKit marks them as disabled)
//
Options inside disabled selects are incorrectly marked as disabled
select
.
disabled
=
true
;
select
.
disabled
=
true
;
support
.
optDisabled
=
!
opt
.
disabled
;
support
.
optDisabled
=
!
opt
.
disabled
;
//
Check if an input maintains its value after becoming a radio
//
Support: IE<=11+
//
Support: IE9, IE10
//
An input loses its value after becoming a radio
input
=
document
.
createElement
(
"input"
);
input
=
document
.
createElement
(
"input"
);
input
.
value
=
"t"
;
input
.
value
=
"t"
;
input
.
type
=
"radio"
;
input
.
type
=
"radio"
;
...
...
src/attributes/val.js
View file @
d837f119
...
@@ -22,9 +22,9 @@ jQuery.fn.extend({
...
@@ -22,9 +22,9 @@ jQuery.fn.extend({
ret
=
elem
.
value
;
ret
=
elem
.
value
;
return
typeof
ret
===
"string"
?
return
typeof
ret
===
"string"
?
//
h
andle most common string cases
//
H
andle most common string cases
ret
.
replace
(
rreturn
,
""
)
:
ret
.
replace
(
rreturn
,
""
)
:
//
h
andle cases where value is null/undef or number
//
H
andle cases where value is null/undef or number
ret
==
null
?
""
:
ret
;
ret
==
null
?
""
:
ret
;
}
}
...
@@ -132,7 +132,7 @@ jQuery.extend({
...
@@ -132,7 +132,7 @@ jQuery.extend({
}
}
}
}
//
f
orce browsers to behave consistently when non-matching value is set
//
F
orce browsers to behave consistently when non-matching value is set
if
(
!
optionSet
)
{
if
(
!
optionSet
)
{
elem
.
selectedIndex
=
-
1
;
elem
.
selectedIndex
=
-
1
;
}
}
...
@@ -153,8 +153,6 @@ jQuery.each([ "radio", "checkbox" ], function() {
...
@@ -153,8 +153,6 @@ jQuery.each([ "radio", "checkbox" ], function() {
};
};
if
(
!
support
.
checkOn
)
{
if
(
!
support
.
checkOn
)
{
jQuery
.
valHooks
[
this
].
get
=
function
(
elem
)
{
jQuery
.
valHooks
[
this
].
get
=
function
(
elem
)
{
// Support: Webkit
// "" is returned instead of "on" if a value isn't specified
return
elem
.
getAttribute
(
"value"
)
===
null
?
"on"
:
elem
.
value
;
return
elem
.
getAttribute
(
"value"
)
===
null
?
"on"
:
elem
.
value
;
};
};
}
}
...
...
src/core.js
View file @
d837f119
...
@@ -132,7 +132,7 @@ jQuery.extend = jQuery.fn.extend = function() {
...
@@ -132,7 +132,7 @@ jQuery.extend = jQuery.fn.extend = function() {
if
(
typeof
target
===
"boolean"
)
{
if
(
typeof
target
===
"boolean"
)
{
deep
=
target
;
deep
=
target
;
//
s
kip the boolean and the target
//
S
kip the boolean and the target
target
=
arguments
[
i
]
||
{};
target
=
arguments
[
i
]
||
{};
i
++
;
i
++
;
}
}
...
@@ -142,7 +142,7 @@ jQuery.extend = jQuery.fn.extend = function() {
...
@@ -142,7 +142,7 @@ jQuery.extend = jQuery.fn.extend = function() {
target
=
{};
target
=
{};
}
}
//
e
xtend jQuery itself if only one argument is passed
//
E
xtend jQuery itself if only one argument is passed
if
(
i
===
length
)
{
if
(
i
===
length
)
{
target
=
this
;
target
=
this
;
i
--
;
i
--
;
...
@@ -199,9 +199,6 @@ jQuery.extend({
...
@@ -199,9 +199,6 @@ jQuery.extend({
noop
:
function
()
{},
noop
:
function
()
{},
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction
:
function
(
obj
)
{
isFunction
:
function
(
obj
)
{
return
jQuery
.
type
(
obj
)
===
"function"
;
return
jQuery
.
type
(
obj
)
===
"function"
;
},
},
...
@@ -251,7 +248,7 @@ jQuery.extend({
...
@@ -251,7 +248,7 @@ jQuery.extend({
if
(
obj
==
null
)
{
if
(
obj
==
null
)
{
return
obj
+
""
;
return
obj
+
""
;
}
}
// Support: Android
< 4.0, iOS <
6 (functionish RegExp)
// Support: Android
<4.0, iOS<
6 (functionish RegExp)
return
typeof
obj
===
"object"
||
typeof
obj
===
"function"
?
return
typeof
obj
===
"object"
||
typeof
obj
===
"function"
?
class2type
[
toString
.
call
(
obj
)
]
||
"object"
:
class2type
[
toString
.
call
(
obj
)
]
||
"object"
:
typeof
obj
;
typeof
obj
;
...
@@ -281,6 +278,7 @@ jQuery.extend({
...
@@ -281,6 +278,7 @@ jQuery.extend({
},
},
// Convert dashed to camelCase; used by the css and data modules
// Convert dashed to camelCase; used by the css and data modules
// Support: IE9-11+
// Microsoft forgot to hump their vendor prefix (#9572)
// Microsoft forgot to hump their vendor prefix (#9572)
camelCase
:
function
(
string
)
{
camelCase
:
function
(
string
)
{
return
string
.
replace
(
rmsPrefix
,
"ms-"
).
replace
(
rdashAlpha
,
fcamelCase
);
return
string
.
replace
(
rmsPrefix
,
"ms-"
).
replace
(
rdashAlpha
,
fcamelCase
);
...
...
src/core/init.js
View file @
d837f119
...
@@ -38,7 +38,7 @@ var rootjQuery,
...
@@ -38,7 +38,7 @@ var rootjQuery,
if
(
match
[
1
]
)
{
if
(
match
[
1
]
)
{
context
=
context
instanceof
jQuery
?
context
[
0
]
:
context
;
context
=
context
instanceof
jQuery
?
context
[
0
]
:
context
;
// scripts is true for back-compat
//
Option to run
scripts is true for back-compat
// Intentionally let the error be thrown if parseHTML is not present
// Intentionally let the error be thrown if parseHTML is not present
jQuery
.
merge
(
this
,
jQuery
.
parseHTML
(
jQuery
.
merge
(
this
,
jQuery
.
parseHTML
(
match
[
1
],
match
[
1
],
...
@@ -66,8 +66,8 @@ var rootjQuery,
...
@@ -66,8 +66,8 @@ var rootjQuery,
}
else
{
}
else
{
elem
=
document
.
getElementById
(
match
[
2
]
);
elem
=
document
.
getElementById
(
match
[
2
]
);
//
Check parentNode to catch when Blackberry 4.6 returns
//
Support: Blackberry 4.6
//
nodes that are no longer in the document #6963
//
gEBID returns nodes no longer in the document (#6963)
if
(
elem
&&
elem
.
parentNode
)
{
if
(
elem
&&
elem
.
parentNode
)
{
// Inject the element directly into the jQuery object
// Inject the element directly into the jQuery object
this
.
length
=
1
;
this
.
length
=
1
;
...
...
src/core/ready.js
View file @
d837f119
...
@@ -73,7 +73,7 @@ jQuery.ready.promise = function( obj ) {
...
@@ -73,7 +73,7 @@ jQuery.ready.promise = function( obj ) {
readyList
=
jQuery
.
Deferred
();
readyList
=
jQuery
.
Deferred
();
// Catch cases where $(document).ready() is called after the browser event has already occurred.
// Catch cases where $(document).ready() is called after the browser event has already occurred.
//
w
e once tried to use readyState "interactive" here, but it caused issues like the one
//
W
e once tried to use readyState "interactive" here, but it caused issues like the one
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
if
(
document
.
readyState
===
"complete"
)
{
if
(
document
.
readyState
===
"complete"
)
{
// Handle it asynchronously to allow scripts the opportunity to delay ready
// Handle it asynchronously to allow scripts the opportunity to delay ready
...
...
src/css.js
View file @
d837f119
...
@@ -21,8 +21,8 @@ define([
...
@@ -21,8 +21,8 @@ define([
getStyles
,
curCSS
,
defaultDisplay
,
addGetHookIf
,
support
,
data_priv
)
{
getStyles
,
curCSS
,
defaultDisplay
,
addGetHookIf
,
support
,
data_priv
)
{
var
var
//
s
wappable if display is none or starts with table except "table", "table-cell", or "table-caption"
//
S
wappable if display is none or starts with table except "table", "table-cell", or "table-caption"
//
s
ee here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
//
S
ee here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
rdisplayswap
=
/^
(
none|table
(?!
-c
[
ea
])
.+
)
/
,
rdisplayswap
=
/^
(
none|table
(?!
-c
[
ea
])
.+
)
/
,
rnumsplit
=
new
RegExp
(
"^("
+
pnum
+
")(.*)$"
,
"i"
),
rnumsplit
=
new
RegExp
(
"^("
+
pnum
+
")(.*)$"
,
"i"
),
rrelNum
=
new
RegExp
(
"^([+-])=("
+
pnum
+
")"
,
"i"
),
rrelNum
=
new
RegExp
(
"^([+-])=("
+
pnum
+
")"
,
"i"
),
...
@@ -35,15 +35,15 @@ var
...
@@ -35,15 +35,15 @@ var
cssPrefixes
=
[
"Webkit"
,
"O"
,
"Moz"
,
"ms"
];
cssPrefixes
=
[
"Webkit"
,
"O"
,
"Moz"
,
"ms"
];
//
r
eturn a css property mapped to a potentially vendor prefixed property
//
R
eturn a css property mapped to a potentially vendor prefixed property
function
vendorPropName
(
style
,
name
)
{
function
vendorPropName
(
style
,
name
)
{
//
s
hortcut for names that are not vendor prefixed
//
S
hortcut for names that are not vendor prefixed
if
(
name
in
style
)
{
if
(
name
in
style
)
{
return
name
;
return
name
;
}
}
//
c
heck for vendor prefixed names
//
C
heck for vendor prefixed names
var
capName
=
name
[
0
].
toUpperCase
()
+
name
.
slice
(
1
),
var
capName
=
name
[
0
].
toUpperCase
()
+
name
.
slice
(
1
),
origName
=
name
,
origName
=
name
,
i
=
cssPrefixes
.
length
;
i
=
cssPrefixes
.
length
;
...
@@ -76,7 +76,7 @@ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
...
@@ -76,7 +76,7 @@ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
val
=
0
;
val
=
0
;
for
(
;
i
<
4
;
i
+=
2
)
{
for
(
;
i
<
4
;
i
+=
2
)
{
//
b
oth box models exclude margin, so add it if we want it
//
B
oth box models exclude margin, so add it if we want it
if
(
extra
===
"margin"
)
{
if
(
extra
===
"margin"
)
{
val
+=
jQuery
.
css
(
elem
,
extra
+
cssExpand
[
i
],
true
,
styles
);
val
+=
jQuery
.
css
(
elem
,
extra
+
cssExpand
[
i
],
true
,
styles
);
}
}
...
@@ -87,15 +87,15 @@ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
...
@@ -87,15 +87,15 @@ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
val
-=
jQuery
.
css
(
elem
,
"padding"
+
cssExpand
[
i
],
true
,
styles
);
val
-=
jQuery
.
css
(
elem
,
"padding"
+
cssExpand
[
i
],
true
,
styles
);
}
}
//
a
t this point, extra isn't border nor margin, so remove border
//
A
t this point, extra isn't border nor margin, so remove border
if
(
extra
!==
"margin"
)
{
if
(
extra
!==
"margin"
)
{
val
-=
jQuery
.
css
(
elem
,
"border"
+
cssExpand
[
i
]
+
"Width"
,
true
,
styles
);
val
-=
jQuery
.
css
(
elem
,
"border"
+
cssExpand
[
i
]
+
"Width"
,
true
,
styles
);
}
}
}
else
{
}
else
{
//
a
t this point, extra isn't content, so add padding
//
A
t this point, extra isn't content, so add padding
val
+=
jQuery
.
css
(
elem
,
"padding"
+
cssExpand
[
i
],
true
,
styles
);
val
+=
jQuery
.
css
(
elem
,
"padding"
+
cssExpand
[
i
],
true
,
styles
);
//
a
t this point, extra isn't content nor padding, so add border
//
A
t this point, extra isn't content nor padding, so add border
if
(
extra
!==
"padding"
)
{
if
(
extra
!==
"padding"
)
{
val
+=
jQuery
.
css
(
elem
,
"border"
+
cssExpand
[
i
]
+
"Width"
,
true
,
styles
);
val
+=
jQuery
.
css
(
elem
,
"border"
+
cssExpand
[
i
]
+
"Width"
,
true
,
styles
);
}
}
...
@@ -113,7 +113,7 @@ function getWidthOrHeight( elem, name, extra ) {
...
@@ -113,7 +113,7 @@ function getWidthOrHeight( elem, name, extra ) {
styles
=
getStyles
(
elem
),
styles
=
getStyles
(
elem
),
isBorderBox
=
jQuery
.
css
(
elem
,
"boxSizing"
,
false
,
styles
)
===
"border-box"
;
isBorderBox
=
jQuery
.
css
(
elem
,
"boxSizing"
,
false
,
styles
)
===
"border-box"
;
//
s
ome non-html elements return undefined for offsetWidth, so check for null/undefined
//
S
ome non-html elements return undefined for offsetWidth, so check for null/undefined
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
if
(
val
<=
0
||
val
==
null
)
{
if
(
val
<=
0
||
val
==
null
)
{
...
@@ -128,7 +128,7 @@ function getWidthOrHeight( elem, name, extra ) {
...
@@ -128,7 +128,7 @@ function getWidthOrHeight( elem, name, extra ) {
return
val
;
return
val
;
}
}
//
we need the c
heck for style in case a browser which returns unreliable values
//
C
heck for style in case a browser which returns unreliable values
// for getComputedStyle silently falls back to the reliable elem.style
// for getComputedStyle silently falls back to the reliable elem.style
valueIsBorderBox
=
isBorderBox
&&
valueIsBorderBox
=
isBorderBox
&&
(
support
.
boxSizingReliable
()
||
val
===
elem
.
style
[
name
]
);
(
support
.
boxSizingReliable
()
||
val
===
elem
.
style
[
name
]
);
...
@@ -137,7 +137,7 @@ function getWidthOrHeight( elem, name, extra ) {
...
@@ -137,7 +137,7 @@ function getWidthOrHeight( elem, name, extra ) {
val
=
parseFloat
(
val
)
||
0
;
val
=
parseFloat
(
val
)
||
0
;
}
}
//
u
se the active box-sizing model to add/subtract irrelevant styles
//
U
se the active box-sizing model to add/subtract irrelevant styles
return
(
val
+
return
(
val
+
augmentWidthOrHeight
(
augmentWidthOrHeight
(
elem
,
elem
,
...
@@ -201,12 +201,14 @@ function showHide( elements, show ) {
...
@@ -201,12 +201,14 @@ function showHide( elements, show ) {
}
}
jQuery
.
extend
({
jQuery
.
extend
({
// Add in style property hooks for overriding the default
// Add in style property hooks for overriding the default
// behavior of getting and setting a style property
// behavior of getting and setting a style property
cssHooks
:
{
cssHooks
:
{
opacity
:
{
opacity
:
{
get
:
function
(
elem
,
computed
)
{
get
:
function
(
elem
,
computed
)
{
if
(
computed
)
{
if
(
computed
)
{
// We should always get a number back from opacity
// We should always get a number back from opacity
var
ret
=
curCSS
(
elem
,
"opacity"
);
var
ret
=
curCSS
(
elem
,
"opacity"
);
return
ret
===
""
?
"1"
:
ret
;
return
ret
===
""
?
"1"
:
ret
;
...
@@ -234,12 +236,12 @@ jQuery.extend({
...
@@ -234,12 +236,12 @@ jQuery.extend({
// Add in properties whose names you wish to fix before
// Add in properties whose names you wish to fix before
// setting or getting the value
// setting or getting the value
cssProps
:
{
cssProps
:
{
// normalize float css property
"float"
:
"cssFloat"
"float"
:
"cssFloat"
},
},
// Get and set the style property on a DOM Node
// Get and set the style property on a DOM Node
style
:
function
(
elem
,
name
,
value
,
extra
)
{
style
:
function
(
elem
,
name
,
value
,
extra
)
{
// Don't set styles on text and comment nodes
// Don't set styles on text and comment nodes
if
(
!
elem
||
elem
.
nodeType
===
3
||
elem
.
nodeType
===
8
||
!
elem
.
style
)
{
if
(
!
elem
||
elem
.
nodeType
===
3
||
elem
.
nodeType
===
8
||
!
elem
.
style
)
{
return
;
return
;
...
@@ -252,33 +254,32 @@ jQuery.extend({
...
@@ -252,33 +254,32 @@ jQuery.extend({
name
=
jQuery
.
cssProps
[
origName
]
||
(
jQuery
.
cssProps
[
origName
]
=
vendorPropName
(
style
,
origName
)
);
name
=
jQuery
.
cssProps
[
origName
]
||
(
jQuery
.
cssProps
[
origName
]
=
vendorPropName
(
style
,
origName
)
);
// gets hook for the prefixed version
// Gets hook for the prefixed version, then unprefixed version
// followed by the unprefixed version
hooks
=
jQuery
.
cssHooks
[
name
]
||
jQuery
.
cssHooks
[
origName
];
hooks
=
jQuery
.
cssHooks
[
name
]
||
jQuery
.
cssHooks
[
origName
];
// Check if we're setting a value
// Check if we're setting a value
if
(
value
!==
undefined
)
{
if
(
value
!==
undefined
)
{
type
=
typeof
value
;
type
=
typeof
value
;
//
convert relative number strings (+= or -=) to relative numbers. #7345
//
Convert "+=" or "-=" to relative numbers (#7345)
if
(
type
===
"string"
&&
(
ret
=
rrelNum
.
exec
(
value
))
)
{
if
(
type
===
"string"
&&
(
ret
=
rrelNum
.
exec
(
value
))
)
{
value
=
(
ret
[
1
]
+
1
)
*
ret
[
2
]
+
parseFloat
(
jQuery
.
css
(
elem
,
name
)
);
value
=
(
ret
[
1
]
+
1
)
*
ret
[
2
]
+
parseFloat
(
jQuery
.
css
(
elem
,
name
)
);
// Fixes bug #9237
// Fixes bug #9237
type
=
"number"
;
type
=
"number"
;
}
}
// Make sure that null and NaN values aren't set
. See: #7116
// Make sure that null and NaN values aren't set
(#7116)
if
(
value
==
null
||
value
!==
value
)
{
if
(
value
==
null
||
value
!==
value
)
{
return
;
return
;
}
}
// If a number
was passed in
, add 'px' to the (except for certain CSS properties)
// If a number, add 'px' to the (except for certain CSS properties)
if
(
type
===
"number"
&&
!
jQuery
.
cssNumber
[
origName
]
)
{
if
(
type
===
"number"
&&
!
jQuery
.
cssNumber
[
origName
]
)
{
value
+=
"px"
;
value
+=
"px"
;
}
}
//
Fixes #8908, it can be done more correctly by specifying setters in cssHooks,
//
Support: IE9-11+
// b
ut it would mean to define eight (for every problematic property) identical function
s
// b
ackground-* props affect original clone's value
s
if
(
!
support
.
clearCloneStyle
&&
value
===
""
&&
name
.
indexOf
(
"background"
)
===
0
)
{
if
(
!
support
.
clearCloneStyle
&&
value
===
""
&&
name
.
indexOf
(
"background"
)
===
0
)
{
style
[
name
]
=
"inherit"
;
style
[
name
]
=
"inherit"
;
}
}
...
@@ -306,8 +307,7 @@ jQuery.extend({
...
@@ -306,8 +307,7 @@ jQuery.extend({
// Make sure that we're working with the right name
// Make sure that we're working with the right name
name
=
jQuery
.
cssProps
[
origName
]
||
(
jQuery
.
cssProps
[
origName
]
=
vendorPropName
(
elem
.
style
,
origName
)
);
name
=
jQuery
.
cssProps
[
origName
]
||
(
jQuery
.
cssProps
[
origName
]
=
vendorPropName
(
elem
.
style
,
origName
)
);
// gets hook for the prefixed version
// Try prefixed name followed by the unprefixed name
// followed by the unprefixed version
hooks
=
jQuery
.
cssHooks
[
name
]
||
jQuery
.
cssHooks
[
origName
];
hooks
=
jQuery
.
cssHooks
[
name
]
||
jQuery
.
cssHooks
[
origName
];
// If a hook was provided get the computed value from there
// If a hook was provided get the computed value from there
...
@@ -320,12 +320,12 @@ jQuery.extend({
...
@@ -320,12 +320,12 @@ jQuery.extend({
val
=
curCSS
(
elem
,
name
,
styles
);
val
=
curCSS
(
elem
,
name
,
styles
);
}
}
//
c
onvert "normal" to computed value
//
C
onvert "normal" to computed value
if
(
val
===
"normal"
&&
name
in
cssNormalTransform
)
{
if
(
val
===
"normal"
&&
name
in
cssNormalTransform
)
{
val
=
cssNormalTransform
[
name
];
val
=
cssNormalTransform
[
name
];
}
}
//
Return, converting to number
if forced or a qualifier was provided and val looks numeric
//
Make numeric
if forced or a qualifier was provided and val looks numeric
if
(
extra
===
""
||
extra
)
{
if
(
extra
===
""
||
extra
)
{
num
=
parseFloat
(
val
);
num
=
parseFloat
(
val
);
return
extra
===
true
||
jQuery
.
isNumeric
(
num
)
?
num
||
0
:
val
;
return
extra
===
true
||
jQuery
.
isNumeric
(
num
)
?
num
||
0
:
val
;
...
@@ -338,8 +338,9 @@ jQuery.each([ "height", "width" ], function( i, name ) {
...
@@ -338,8 +338,9 @@ jQuery.each([ "height", "width" ], function( i, name ) {
jQuery
.
cssHooks
[
name
]
=
{
jQuery
.
cssHooks
[
name
]
=
{
get
:
function
(
elem
,
computed
,
extra
)
{
get
:
function
(
elem
,
computed
,
extra
)
{
if
(
computed
)
{
if
(
computed
)
{
// certain elements can have dimension info if we invisibly show them
// however, it must have a current display style that would benefit from this
// Certain elements can have dimension info if we invisibly show them
// but it must have a current display style that would benefit
return
rdisplayswap
.
test
(
jQuery
.
css
(
elem
,
"display"
)
)
&&
elem
.
offsetWidth
===
0
?
return
rdisplayswap
.
test
(
jQuery
.
css
(
elem
,
"display"
)
)
&&
elem
.
offsetWidth
===
0
?
jQuery
.
swap
(
elem
,
cssShow
,
function
()
{
jQuery
.
swap
(
elem
,
cssShow
,
function
()
{
return
getWidthOrHeight
(
elem
,
name
,
extra
);
return
getWidthOrHeight
(
elem
,
name
,
extra
);
...
@@ -367,8 +368,6 @@ jQuery.each([ "height", "width" ], function( i, name ) {
...
@@ -367,8 +368,6 @@ jQuery.each([ "height", "width" ], function( i, name ) {
jQuery
.
cssHooks
.
marginRight
=
addGetHookIf
(
support
.
reliableMarginRight
,
jQuery
.
cssHooks
.
marginRight
=
addGetHookIf
(
support
.
reliableMarginRight
,
function
(
elem
,
computed
)
{
function
(
elem
,
computed
)
{
if
(
computed
)
{
if
(
computed
)
{
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
// Work around by temporarily setting element display to inline-block
return
jQuery
.
swap
(
elem
,
{
"display"
:
"inline-block"
},
return
jQuery
.
swap
(
elem
,
{
"display"
:
"inline-block"
},
curCSS
,
[
elem
,
"marginRight"
]
);
curCSS
,
[
elem
,
"marginRight"
]
);
}
}
...
@@ -386,7 +385,7 @@ jQuery.each({
...
@@ -386,7 +385,7 @@ jQuery.each({
var
i
=
0
,
var
i
=
0
,
expanded
=
{},
expanded
=
{},
//
a
ssumes a single number if not a string
//
A
ssumes a single number if not a string
parts
=
typeof
value
===
"string"
?
value
.
split
(
" "
)
:
[
value
];
parts
=
typeof
value
===
"string"
?
value
.
split
(
" "
)
:
[
value
];
for
(
;
i
<
4
;
i
++
)
{
for
(
;
i
<
4
;
i
++
)
{
...
...
src/css/addGetHookIf.js
View file @
d837f119
...
@@ -5,15 +5,13 @@ function addGetHookIf( conditionFn, hookFn ) {
...
@@ -5,15 +5,13 @@ function addGetHookIf( conditionFn, hookFn ) {
return
{
return
{
get
:
function
()
{
get
:
function
()
{
if
(
conditionFn
()
)
{
if
(
conditionFn
()
)
{
// Hook not needed (or it's not possible to use it due to missing dependency),
// Hook not needed (or it's not possible to use it due
// remove it.
// to missing dependency), remove it.
// Since there are no other hooks for marginRight, remove the whole object.
delete
this
.
get
;
delete
this
.
get
;
return
;
return
;
}
}
// Hook needed; redefine it so that the support test is not executed again.
// Hook needed; redefine it so that the support test is not executed again.
return
(
this
.
get
=
hookFn
).
apply
(
this
,
arguments
);
return
(
this
.
get
=
hookFn
).
apply
(
this
,
arguments
);
}
}
};
};
...
...
src/css/curCSS.js
View file @
d837f119
...
@@ -13,7 +13,7 @@ function curCSS( elem, name, computed ) {
...
@@ -13,7 +13,7 @@ function curCSS( elem, name, computed ) {
computed
=
computed
||
getStyles
(
elem
);
computed
=
computed
||
getStyles
(
elem
);
// Support: IE9
// Support: IE9
// getPropertyValue is only needed for .css('filter')
in IE9, see #12537
// getPropertyValue is only needed for .css('filter')
(#12537)
if
(
computed
)
{
if
(
computed
)
{
ret
=
computed
.
getPropertyValue
(
name
)
||
computed
[
name
];
ret
=
computed
.
getPropertyValue
(
name
)
||
computed
[
name
];
}
}
...
...
src/css/defaultDisplay.js
View file @
d837f119
...
@@ -19,7 +19,7 @@ function actualDisplay( name, doc ) {
...
@@ -19,7 +19,7 @@ function actualDisplay( name, doc ) {
// getDefaultComputedStyle might be reliably used only on attached element
// getDefaultComputedStyle might be reliably used only on attached element
display
=
window
.
getDefaultComputedStyle
&&
(
style
=
window
.
getDefaultComputedStyle
(
elem
[
0
]
)
)
?
display
=
window
.
getDefaultComputedStyle
&&
(
style
=
window
.
getDefaultComputedStyle
(
elem
[
0
]
)
)
?
// Use of this method is a temporary fix (more like optmization) until something better comes along,
// Use of this method is a temporary fix (more like opt
i
mization) until something better comes along,
// since it was removed from specification and supported only in FF
// since it was removed from specification and supported only in FF
style
.
display
:
jQuery
.
css
(
elem
[
0
],
"display"
);
style
.
display
:
jQuery
.
css
(
elem
[
0
],
"display"
);
...
...
src/css/support.js
View file @
d837f119
...
@@ -13,6 +13,8 @@ define([
...
@@ -13,6 +13,8 @@ define([
return
;
return
;
}
}
// Support: IE9-11+
// Style of cloned element affects source element cloned (#8908)
div
.
style
.
backgroundClip
=
"content-box"
;
div
.
style
.
backgroundClip
=
"content-box"
;
div
.
cloneNode
(
true
).
style
.
backgroundClip
=
""
;
div
.
cloneNode
(
true
).
style
.
backgroundClip
=
""
;
support
.
clearCloneStyle
=
div
.
style
.
backgroundClip
===
"content-box"
;
support
.
clearCloneStyle
=
div
.
style
.
backgroundClip
===
"content-box"
;
...
@@ -45,6 +47,7 @@ define([
...
@@ -45,6 +47,7 @@ define([
if
(
window
.
getComputedStyle
)
{
if
(
window
.
getComputedStyle
)
{
jQuery
.
extend
(
support
,
{
jQuery
.
extend
(
support
,
{
pixelPosition
:
function
()
{
pixelPosition
:
function
()
{
// This test is executed only once but we still do memoizing
// This test is executed only once but we still do memoizing
// since we can use the boxSizingReliable pre-computing.
// since we can use the boxSizingReliable pre-computing.
// No need to check if the test was already performed, though.
// No need to check if the test was already performed, though.
...
@@ -58,6 +61,7 @@ define([
...
@@ -58,6 +61,7 @@ define([
return
boxSizingReliableVal
;
return
boxSizingReliableVal
;
},
},
reliableMarginRight
:
function
()
{
reliableMarginRight
:
function
()
{
// Support: Android 2.3
// Support: Android 2.3
// Check if div with explicit width and no margin-right incorrectly
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. (#3333)
// gets computed margin-right based on width of container. (#3333)
...
...
src/data.js
View file @
d837f119
...
@@ -6,17 +6,16 @@ define([
...
@@ -6,17 +6,16 @@ define([
"./data/var/data_user"
"./data/var/data_user"
],
function
(
jQuery
,
rnotwhite
,
access
,
data_priv
,
data_user
)
{
],
function
(
jQuery
,
rnotwhite
,
access
,
data_priv
,
data_user
)
{
/*
// Implementation Summary
Implementation Summary
//
// 1. Enforce API surface and semantic compatibility with 1.9.x branch
1. Enforce API surface and semantic compatibility with 1.9.x branch
// 2. Improve the module's maintainability by reducing the storage
2. Improve the module's maintainability by reducing the storage
// paths to a single mechanism.
paths to a single mechanism.
// 3. Use the same single mechanism to support "private" and "user" data.
3. Use the same single mechanism to support "private" and "user" data.
// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
// 5. Avoid exposing implementation details on user objects (eg. expando properties)
5. Avoid exposing implementation details on user objects (eg. expando properties)
// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
6. Provide a clear path for implementation upgrade to WeakMap in 2014
*/
var
rbrace
=
/^
(?:\{[\w\W]
*
\}
|
\[[\w\W]
*
\])
$/
,
var
rbrace
=
/^
(?:\{[\w\W]
*
\}
|
\[[\w\W]
*
\])
$/
,
rmultiDash
=
/
([
A-Z
])
/g
;
rmultiDash
=
/
([
A-Z
])
/g
;
...
...
src/data/Data.js
View file @
d837f119
...
@@ -5,7 +5,7 @@ define([
...
@@ -5,7 +5,7 @@ define([
],
function
(
jQuery
,
rnotwhite
)
{
],
function
(
jQuery
,
rnotwhite
)
{
function
Data
()
{
function
Data
()
{
// Support: Android
<
4,
// Support: Android
<
4,
// Old WebKit does not have Object.preventExtensions/freeze method,
// Old WebKit does not have Object.preventExtensions/freeze method,
// return new empty object instead with no [[set]] accessor
// return new empty object instead with no [[set]] accessor
Object
.
defineProperty
(
this
.
cache
=
{},
0
,
{
Object
.
defineProperty
(
this
.
cache
=
{},
0
,
{
...
@@ -42,7 +42,7 @@ Data.prototype = {
...
@@ -42,7 +42,7 @@ Data.prototype = {
descriptor
[
this
.
expando
]
=
{
value
:
unlock
};
descriptor
[
this
.
expando
]
=
{
value
:
unlock
};
Object
.
defineProperties
(
owner
,
descriptor
);
Object
.
defineProperties
(
owner
,
descriptor
);
// Support: Android
<
4
// Support: Android
<
4
// Fallback to a less secure definition
// Fallback to a less secure definition
}
catch
(
e
)
{
}
catch
(
e
)
{
descriptor
[
this
.
expando
]
=
unlock
;
descriptor
[
this
.
expando
]
=
unlock
;
...
...
src/deferred.js
View file @
d837f119
...
@@ -119,7 +119,7 @@ jQuery.extend({
...
@@ -119,7 +119,7 @@ jQuery.extend({
progressValues
,
progressContexts
,
resolveContexts
;
progressValues
,
progressContexts
,
resolveContexts
;
//
a
dd listeners to Deferred subordinates; treat others as resolved
//
A
dd listeners to Deferred subordinates; treat others as resolved
if
(
length
>
1
)
{
if
(
length
>
1
)
{
progressValues
=
new
Array
(
length
);
progressValues
=
new
Array
(
length
);
progressContexts
=
new
Array
(
length
);
progressContexts
=
new
Array
(
length
);
...
@@ -136,7 +136,7 @@ jQuery.extend({
...
@@ -136,7 +136,7 @@ jQuery.extend({
}
}
}
}
//
i
f we're not waiting on anything, resolve the master
//
I
f we're not waiting on anything, resolve the master
if
(
!
remaining
)
{
if
(
!
remaining
)
{
deferred
.
resolveWith
(
resolveContexts
,
resolveValues
);
deferred
.
resolveWith
(
resolveContexts
,
resolveValues
);
}
}
...
...
src/dimensions.js
View file @
d837f119
...
@@ -7,7 +7,7 @@ define([
...
@@ -7,7 +7,7 @@ define([
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery
.
each
(
{
Height
:
"height"
,
Width
:
"width"
},
function
(
name
,
type
)
{
jQuery
.
each
(
{
Height
:
"height"
,
Width
:
"width"
},
function
(
name
,
type
)
{
jQuery
.
each
(
{
padding
:
"inner"
+
name
,
content
:
type
,
""
:
"outer"
+
name
},
function
(
defaultExtra
,
funcName
)
{
jQuery
.
each
(
{
padding
:
"inner"
+
name
,
content
:
type
,
""
:
"outer"
+
name
},
function
(
defaultExtra
,
funcName
)
{
//
m
argin is only for outerHeight, outerWidth
//
M
argin is only for outerHeight, outerWidth
jQuery
.
fn
[
funcName
]
=
function
(
margin
,
value
)
{
jQuery
.
fn
[
funcName
]
=
function
(
margin
,
value
)
{
var
chainable
=
arguments
.
length
&&
(
defaultExtra
||
typeof
margin
!==
"boolean"
),
var
chainable
=
arguments
.
length
&&
(
defaultExtra
||
typeof
margin
!==
"boolean"
),
extra
=
defaultExtra
||
(
margin
===
true
||
value
===
true
?
"margin"
:
"border"
);
extra
=
defaultExtra
||
(
margin
===
true
||
value
===
true
?
"margin"
:
"border"
);
...
...
src/effects.js
View file @
d837f119
...
@@ -44,16 +44,16 @@ var
...
@@ -44,16 +44,16 @@ var
start
=
+
target
||
1
;
start
=
+
target
||
1
;
do
{
do
{
// If previous iteration zeroed out, double until we get *something*
// If previous iteration zeroed out, double until we get *something*
.
// Use
a string for doubling factor
so we don't accidentally see scale as unchanged below
// Use
string for doubling
so we don't accidentally see scale as unchanged below
scale
=
scale
||
".5"
;
scale
=
scale
||
".5"
;
// Adjust and apply
// Adjust and apply
start
=
start
/
scale
;
start
=
start
/
scale
;
jQuery
.
style
(
tween
.
elem
,
prop
,
start
+
unit
);
jQuery
.
style
(
tween
.
elem
,
prop
,
start
+
unit
);
// Update scale, tolerating zero or NaN from tween.cur()
// Update scale, tolerating zero or NaN from tween.cur()
,
//
And breaking
the loop if scale is unchanged or perfect, or if we've just had enough
//
break
the loop if scale is unchanged or perfect, or if we've just had enough
}
while
(
scale
!==
(
scale
=
tween
.
cur
()
/
target
)
&&
scale
!==
1
&&
--
maxIterations
);
}
while
(
scale
!==
(
scale
=
tween
.
cur
()
/
target
)
&&
scale
!==
1
&&
--
maxIterations
);
}
}
...
@@ -85,8 +85,8 @@ function genFx( type, includeWidth ) {
...
@@ -85,8 +85,8 @@ function genFx( type, includeWidth ) {
i
=
0
,
i
=
0
,
attrs
=
{
height
:
type
};
attrs
=
{
height
:
type
};
//
i
f we include width, step value is 1 to do all cssExpand values,
//
I
f we include width, step value is 1 to do all cssExpand values,
//
if we don't include width,
step value is 2 to skip over Left and Right
//
otherwise
step value is 2 to skip over Left and Right
includeWidth
=
includeWidth
?
1
:
0
;
includeWidth
=
includeWidth
?
1
:
0
;
for
(
;
i
<
4
;
i
+=
2
-
includeWidth
)
{
for
(
;
i
<
4
;
i
+=
2
-
includeWidth
)
{
which
=
cssExpand
[
i
];
which
=
cssExpand
[
i
];
...
@@ -108,7 +108,7 @@ function createTween( value, prop, animation ) {
...
@@ -108,7 +108,7 @@ function createTween( value, prop, animation ) {
for
(
;
index
<
length
;
index
++
)
{
for
(
;
index
<
length
;
index
++
)
{
if
(
(
tween
=
collection
[
index
].
call
(
animation
,
prop
,
value
))
)
{
if
(
(
tween
=
collection
[
index
].
call
(
animation
,
prop
,
value
))
)
{
//
w
e're done with this property
//
W
e're done with this property
return
tween
;
return
tween
;
}
}
}
}
...
@@ -123,7 +123,7 @@ function defaultPrefilter( elem, props, opts ) {
...
@@ -123,7 +123,7 @@ function defaultPrefilter( elem, props, opts ) {
hidden
=
elem
.
nodeType
&&
isHidden
(
elem
),
hidden
=
elem
.
nodeType
&&
isHidden
(
elem
),
dataShow
=
data_priv
.
get
(
elem
,
"fxshow"
);
dataShow
=
data_priv
.
get
(
elem
,
"fxshow"
);
//
h
andle queue: false promises
//
H
andle queue: false promises
if
(
!
opts
.
queue
)
{
if
(
!
opts
.
queue
)
{
hooks
=
jQuery
.
_queueHooks
(
elem
,
"fx"
);
hooks
=
jQuery
.
_queueHooks
(
elem
,
"fx"
);
if
(
hooks
.
unqueued
==
null
)
{
if
(
hooks
.
unqueued
==
null
)
{
...
@@ -138,8 +138,7 @@ function defaultPrefilter( elem, props, opts ) {
...
@@ -138,8 +138,7 @@ function defaultPrefilter( elem, props, opts ) {
hooks
.
unqueued
++
;
hooks
.
unqueued
++
;
anim
.
always
(
function
()
{
anim
.
always
(
function
()
{
// doing this makes sure that the complete handler will be called
// Ensure the complete handler is called before this completes
// before this completes
anim
.
always
(
function
()
{
anim
.
always
(
function
()
{
hooks
.
unqueued
--
;
hooks
.
unqueued
--
;
if
(
!
jQuery
.
queue
(
elem
,
"fx"
).
length
)
{
if
(
!
jQuery
.
queue
(
elem
,
"fx"
).
length
)
{
...
@@ -149,7 +148,7 @@ function defaultPrefilter( elem, props, opts ) {
...
@@ -149,7 +148,7 @@ function defaultPrefilter( elem, props, opts ) {
});
});
}
}
//
h
eight/width overflow pass
//
H
eight/width overflow pass
if
(
elem
.
nodeType
===
1
&&
(
"height"
in
props
||
"width"
in
props
)
)
{
if
(
elem
.
nodeType
===
1
&&
(
"height"
in
props
||
"width"
in
props
)
)
{
// Make sure that nothing sneaks out
// Make sure that nothing sneaks out
// Record all 3 overflow attributes because IE9-10 do not
// Record all 3 overflow attributes because IE9-10 do not
...
@@ -211,7 +210,7 @@ function defaultPrefilter( elem, props, opts ) {
...
@@ -211,7 +210,7 @@ function defaultPrefilter( elem, props, opts ) {
dataShow
=
data_priv
.
access
(
elem
,
"fxshow"
,
{}
);
dataShow
=
data_priv
.
access
(
elem
,
"fxshow"
,
{}
);
}
}
//
s
tore state if its toggle - enables .stop().toggle() to "reverse"
//
S
tore state if its toggle - enables .stop().toggle() to "reverse"
if
(
toggle
)
{
if
(
toggle
)
{
dataShow
.
hidden
=
!
hidden
;
dataShow
.
hidden
=
!
hidden
;
}
}
...
@@ -271,8 +270,8 @@ function propFilter( props, specialEasing ) {
...
@@ -271,8 +270,8 @@ function propFilter( props, specialEasing ) {
value
=
hooks
.
expand
(
value
);
value
=
hooks
.
expand
(
value
);
delete
props
[
name
];
delete
props
[
name
];
//
not quite $.extend, this wont overwrite keys already present
.
//
Not quite $.extend, this won't overwrite existing keys
.
//
also - reusing 'index' from above
because we have the correct "name"
//
Reusing 'index'
because we have the correct "name"
for
(
index
in
value
)
{
for
(
index
in
value
)
{
if
(
!
(
index
in
props
)
)
{
if
(
!
(
index
in
props
)
)
{
props
[
index
]
=
value
[
index
];
props
[
index
]
=
value
[
index
];
...
@@ -291,7 +290,7 @@ function Animation( elem, properties, options ) {
...
@@ -291,7 +290,7 @@ function Animation( elem, properties, options ) {
index
=
0
,
index
=
0
,
length
=
animationPrefilters
.
length
,
length
=
animationPrefilters
.
length
,
deferred
=
jQuery
.
Deferred
().
always
(
function
()
{
deferred
=
jQuery
.
Deferred
().
always
(
function
()
{
//
d
on't match elem in the :animated selector
//
D
on't match elem in the :animated selector
delete
tick
.
elem
;
delete
tick
.
elem
;
}),
}),
tick
=
function
()
{
tick
=
function
()
{
...
@@ -300,7 +299,8 @@ function Animation( elem, properties, options ) {
...
@@ -300,7 +299,8 @@ function Animation( elem, properties, options ) {
}
}
var
currentTime
=
fxNow
||
createFxNow
(),
var
currentTime
=
fxNow
||
createFxNow
(),
remaining
=
Math
.
max
(
0
,
animation
.
startTime
+
animation
.
duration
-
currentTime
),
remaining
=
Math
.
max
(
0
,
animation
.
startTime
+
animation
.
duration
-
currentTime
),
// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
// Support: Android 2.3
// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
temp
=
remaining
/
animation
.
duration
||
0
,
temp
=
remaining
/
animation
.
duration
||
0
,
percent
=
1
-
temp
,
percent
=
1
-
temp
,
index
=
0
,
index
=
0
,
...
@@ -336,7 +336,7 @@ function Animation( elem, properties, options ) {
...
@@ -336,7 +336,7 @@ function Animation( elem, properties, options ) {
},
},
stop
:
function
(
gotoEnd
)
{
stop
:
function
(
gotoEnd
)
{
var
index
=
0
,
var
index
=
0
,
//
i
f we are going to the end, we want to run all the tweens
//
I
f we are going to the end, we want to run all the tweens
// otherwise we skip this part
// otherwise we skip this part
length
=
gotoEnd
?
animation
.
tweens
.
length
:
0
;
length
=
gotoEnd
?
animation
.
tweens
.
length
:
0
;
if
(
stopped
)
{
if
(
stopped
)
{
...
@@ -347,8 +347,7 @@ function Animation( elem, properties, options ) {
...
@@ -347,8 +347,7 @@ function Animation( elem, properties, options ) {
animation
.
tweens
[
index
].
run
(
1
);
animation
.
tweens
[
index
].
run
(
1
);
}
}
// resolve when we played the last frame
// Resolve when we played the last frame; otherwise, reject
// otherwise, reject
if
(
gotoEnd
)
{
if
(
gotoEnd
)
{
deferred
.
resolveWith
(
elem
,
[
animation
,
gotoEnd
]
);
deferred
.
resolveWith
(
elem
,
[
animation
,
gotoEnd
]
);
}
else
{
}
else
{
...
@@ -430,7 +429,7 @@ jQuery.speed = function( speed, easing, fn ) {
...
@@ -430,7 +429,7 @@ jQuery.speed = function( speed, easing, fn ) {
opt
.
duration
=
jQuery
.
fx
.
off
?
0
:
typeof
opt
.
duration
===
"number"
?
opt
.
duration
:
opt
.
duration
=
jQuery
.
fx
.
off
?
0
:
typeof
opt
.
duration
===
"number"
?
opt
.
duration
:
opt
.
duration
in
jQuery
.
fx
.
speeds
?
jQuery
.
fx
.
speeds
[
opt
.
duration
]
:
jQuery
.
fx
.
speeds
.
_default
;
opt
.
duration
in
jQuery
.
fx
.
speeds
?
jQuery
.
fx
.
speeds
[
opt
.
duration
]
:
jQuery
.
fx
.
speeds
.
_default
;
//
n
ormalize opt.queue - true/undefined/null -> "fx"
//
N
ormalize opt.queue - true/undefined/null -> "fx"
if
(
opt
.
queue
==
null
||
opt
.
queue
===
true
)
{
if
(
opt
.
queue
==
null
||
opt
.
queue
===
true
)
{
opt
.
queue
=
"fx"
;
opt
.
queue
=
"fx"
;
}
}
...
@@ -454,10 +453,10 @@ jQuery.speed = function( speed, easing, fn ) {
...
@@ -454,10 +453,10 @@ jQuery.speed = function( speed, easing, fn ) {
jQuery
.
fn
.
extend
({
jQuery
.
fn
.
extend
({
fadeTo
:
function
(
speed
,
to
,
easing
,
callback
)
{
fadeTo
:
function
(
speed
,
to
,
easing
,
callback
)
{
//
s
how any hidden elements after setting opacity to 0
//
S
how any hidden elements after setting opacity to 0
return
this
.
filter
(
isHidden
).
css
(
"opacity"
,
0
).
show
()
return
this
.
filter
(
isHidden
).
css
(
"opacity"
,
0
).
show
()
//
a
nimate to the value specified
//
A
nimate to the value specified
.
end
().
animate
({
opacity
:
to
},
speed
,
easing
,
callback
);
.
end
().
animate
({
opacity
:
to
},
speed
,
easing
,
callback
);
},
},
animate
:
function
(
prop
,
speed
,
easing
,
callback
)
{
animate
:
function
(
prop
,
speed
,
easing
,
callback
)
{
...
@@ -520,9 +519,9 @@ jQuery.fn.extend({
...
@@ -520,9 +519,9 @@ jQuery.fn.extend({
}
}
}
}
//
start the next in the queue if the last step wasn't forced
//
Start the next in the queue if the last step wasn't forced.
//
timers currently will call their complete callbacks, which will dequeue
//
Timers currently will call their complete callbacks, which
//
but only if they were gotoEnd
//
will dequeue but only if they were gotoEnd.
if
(
dequeue
||
!
gotoEnd
)
{
if
(
dequeue
||
!
gotoEnd
)
{
jQuery
.
dequeue
(
this
,
type
);
jQuery
.
dequeue
(
this
,
type
);
}
}
...
@@ -540,17 +539,17 @@ jQuery.fn.extend({
...
@@ -540,17 +539,17 @@ jQuery.fn.extend({
timers
=
jQuery
.
timers
,
timers
=
jQuery
.
timers
,
length
=
queue
?
queue
.
length
:
0
;
length
=
queue
?
queue
.
length
:
0
;
//
e
nable finishing flag on private data
//
E
nable finishing flag on private data
data
.
finish
=
true
;
data
.
finish
=
true
;
//
e
mpty the queue first
//
E
mpty the queue first
jQuery
.
queue
(
this
,
type
,
[]
);
jQuery
.
queue
(
this
,
type
,
[]
);
if
(
hooks
&&
hooks
.
stop
)
{
if
(
hooks
&&
hooks
.
stop
)
{
hooks
.
stop
.
call
(
this
,
true
);
hooks
.
stop
.
call
(
this
,
true
);
}
}
//
l
ook for any active animations, and finish them
//
L
ook for any active animations, and finish them
for
(
index
=
timers
.
length
;
index
--
;
)
{
for
(
index
=
timers
.
length
;
index
--
;
)
{
if
(
timers
[
index
].
elem
===
this
&&
timers
[
index
].
queue
===
type
)
{
if
(
timers
[
index
].
elem
===
this
&&
timers
[
index
].
queue
===
type
)
{
timers
[
index
].
anim
.
stop
(
true
);
timers
[
index
].
anim
.
stop
(
true
);
...
@@ -558,14 +557,14 @@ jQuery.fn.extend({
...
@@ -558,14 +557,14 @@ jQuery.fn.extend({
}
}
}
}
//
l
ook for any animations in the old queue and finish them
//
L
ook for any animations in the old queue and finish them
for
(
index
=
0
;
index
<
length
;
index
++
)
{
for
(
index
=
0
;
index
<
length
;
index
++
)
{
if
(
queue
[
index
]
&&
queue
[
index
].
finish
)
{
if
(
queue
[
index
]
&&
queue
[
index
].
finish
)
{
queue
[
index
].
finish
.
call
(
this
);
queue
[
index
].
finish
.
call
(
this
);
}
}
}
}
//
t
urn off finishing flag
//
T
urn off finishing flag
delete
data
.
finish
;
delete
data
.
finish
;
});
});
}
}
...
...
src/effects/Tween.js
View file @
d837f119
...
@@ -64,17 +64,18 @@ Tween.propHooks = {
...
@@ -64,17 +64,18 @@ Tween.propHooks = {
return
tween
.
elem
[
tween
.
prop
];
return
tween
.
elem
[
tween
.
prop
];
}
}
//
p
assing an empty string as a 3rd parameter to .css will automatically
//
P
assing an empty string as a 3rd parameter to .css will automatically
// attempt a parseFloat and fallback to a string if the parse fails
// attempt a parseFloat and fallback to a string if the parse fails
.
//
so, simple values such as "10px" are parsed to Float.
//
Simple values such as "10px" are parsed to Float;
// complex values such as "rotate(1rad)" are returned as
is.
// complex values such as "rotate(1rad)" are returned as
-
is.
result
=
jQuery
.
css
(
tween
.
elem
,
tween
.
prop
,
""
);
result
=
jQuery
.
css
(
tween
.
elem
,
tween
.
prop
,
""
);
// Empty strings, null, undefined and "auto" are converted to 0.
// Empty strings, null, undefined and "auto" are converted to 0.
return
!
result
||
result
===
"auto"
?
0
:
result
;
return
!
result
||
result
===
"auto"
?
0
:
result
;
},
},
set
:
function
(
tween
)
{
set
:
function
(
tween
)
{
// use step hook for back compat - use cssHook if its there - use .style if its
// Use step hook for back compat.
// available and use plain properties where available
// Use cssHook if its there.
// Use .style if available and use plain properties where available.
if
(
jQuery
.
fx
.
step
[
tween
.
prop
]
)
{
if
(
jQuery
.
fx
.
step
[
tween
.
prop
]
)
{
jQuery
.
fx
.
step
[
tween
.
prop
](
tween
);
jQuery
.
fx
.
step
[
tween
.
prop
](
tween
);
}
else
if
(
tween
.
elem
.
style
&&
(
tween
.
elem
.
style
[
jQuery
.
cssProps
[
tween
.
prop
]
]
!=
null
||
jQuery
.
cssHooks
[
tween
.
prop
]
)
)
{
}
else
if
(
tween
.
elem
.
style
&&
(
tween
.
elem
.
style
[
jQuery
.
cssProps
[
tween
.
prop
]
]
!=
null
||
jQuery
.
cssHooks
[
tween
.
prop
]
)
)
{
...
@@ -88,7 +89,6 @@ Tween.propHooks = {
...
@@ -88,7 +89,6 @@ Tween.propHooks = {
// Support: IE9
// Support: IE9
// Panic based approach to setting things on disconnected nodes
// Panic based approach to setting things on disconnected nodes
Tween
.
propHooks
.
scrollTop
=
Tween
.
propHooks
.
scrollLeft
=
{
Tween
.
propHooks
.
scrollTop
=
Tween
.
propHooks
.
scrollLeft
=
{
set
:
function
(
tween
)
{
set
:
function
(
tween
)
{
if
(
tween
.
elem
.
nodeType
&&
tween
.
elem
.
parentNode
)
{
if
(
tween
.
elem
.
nodeType
&&
tween
.
elem
.
parentNode
)
{
...
...
src/event.js
View file @
d837f119
...
@@ -379,8 +379,8 @@ jQuery.event = {
...
@@ -379,8 +379,8 @@ jQuery.event = {
j
=
0
;
j
=
0
;
while
(
(
handleObj
=
matched
.
handlers
[
j
++
])
&&
!
event
.
isImmediatePropagationStopped
()
)
{
while
(
(
handleObj
=
matched
.
handlers
[
j
++
])
&&
!
event
.
isImmediatePropagationStopped
()
)
{
// Triggered event must either 1) have no namespace, or
// Triggered event must either 1) have no namespace, or
2) have namespace(s)
//
2) have namespace(s)
a subset or equal to those in the bound event (both can have no namespace).
// a subset or equal to those in the bound event (both can have no namespace).
if
(
!
event
.
namespace_re
||
event
.
namespace_re
.
test
(
handleObj
.
namespace
)
)
{
if
(
!
event
.
namespace_re
||
event
.
namespace_re
.
test
(
handleObj
.
namespace
)
)
{
event
.
handleObj
=
handleObj
;
event
.
handleObj
=
handleObj
;
...
@@ -530,7 +530,7 @@ jQuery.event = {
...
@@ -530,7 +530,7 @@ jQuery.event = {
event
.
target
=
document
;
event
.
target
=
document
;
}
}
// Support: Safari 6.0+, Chrome
<
28
// Support: Safari 6.0+, Chrome
<
28
// Target should not be a text node (#504, #13143)
// Target should not be a text node (#504, #13143)
if
(
event
.
target
.
nodeType
===
3
)
{
if
(
event
.
target
.
nodeType
===
3
)
{
event
.
target
=
event
.
target
.
parentNode
;
event
.
target
=
event
.
target
.
parentNode
;
...
@@ -635,7 +635,7 @@ jQuery.Event = function( src, props ) {
...
@@ -635,7 +635,7 @@ jQuery.Event = function( src, props ) {
// by a handler lower down the tree; reflect the correct value.
// by a handler lower down the tree; reflect the correct value.
this
.
isDefaultPrevented
=
src
.
defaultPrevented
||
this
.
isDefaultPrevented
=
src
.
defaultPrevented
||
src
.
defaultPrevented
===
undefined
&&
src
.
defaultPrevented
===
undefined
&&
// Support: Android
<
4.0
// Support: Android
<
4.0
src
.
returnValue
===
false
?
src
.
returnValue
===
false
?
returnTrue
:
returnTrue
:
returnFalse
;
returnFalse
;
...
@@ -725,8 +725,8 @@ jQuery.each({
...
@@ -725,8 +725,8 @@ jQuery.each({
};
};
});
});
// Create "bubbling" focus and blur events
// Support: Firefox, Chrome, Safari
// Support: Firefox, Chrome, Safari
// Create "bubbling" focus and blur events
if
(
!
support
.
focusinBubbles
)
{
if
(
!
support
.
focusinBubbles
)
{
jQuery
.
each
({
focus
:
"focusin"
,
blur
:
"focusout"
},
function
(
orig
,
fix
)
{
jQuery
.
each
({
focus
:
"focusin"
,
blur
:
"focusout"
},
function
(
orig
,
fix
)
{
...
...
src/exports/global.js
View file @
d837f119
...
@@ -22,8 +22,8 @@ jQuery.noConflict = function( deep ) {
...
@@ -22,8 +22,8 @@ jQuery.noConflict = function( deep ) {
return
jQuery
;
return
jQuery
;
};
};
// Expose jQuery and $ identifiers, even in
// Expose jQuery and $ identifiers, even in
AMD
//
AMD
(#7102#comment:10, https://github.com/jquery/jquery/pull/557)
// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
// and CommonJS for browser emulators (#13566)
// and CommonJS for browser emulators (#13566)
if
(
typeof
noGlobal
===
strundefined
)
{
if
(
typeof
noGlobal
===
strundefined
)
{
window
.
jQuery
=
window
.
$
=
jQuery
;
window
.
jQuery
=
window
.
$
=
jQuery
;
...
...
src/intro.js
View file @
d837f119
...
@@ -15,13 +15,13 @@
...
@@ -15,13 +15,13 @@
(
function
(
global
,
factory
)
{
(
function
(
global
,
factory
)
{
if
(
typeof
module
===
"object"
&&
typeof
module
.
exports
===
"object"
)
{
if
(
typeof
module
===
"object"
&&
typeof
module
.
exports
===
"object"
)
{
// For CommonJS and CommonJS-like environments where a proper
window is present,
// For CommonJS and CommonJS-like environments where a proper
`window`
//
execute the factory and get jQuery
//
is present, execute the factory and get jQuery.
// For environments that do not
inherently posses a window with a document
// For environments that do not
have a `window` with a `document`
// (such as Node.js), expose a
jQuery-making factory as module.exports
// (such as Node.js), expose a
factory as module.exports.
// This accentuates the need for the creation of a real
window
// This accentuates the need for the creation of a real
`window`.
// e.g. var jQuery = require("jquery")(window);
// e.g. var jQuery = require("jquery")(window);
// See ticket #14549 for more info
// See ticket #14549 for more info
.
module
.
exports
=
global
.
document
?
module
.
exports
=
global
.
document
?
factory
(
global
,
true
)
:
factory
(
global
,
true
)
:
function
(
w
)
{
function
(
w
)
{
...
@@ -37,8 +37,8 @@
...
@@ -37,8 +37,8 @@
// Pass this if window is not defined yet
// Pass this if window is not defined yet
}(
typeof
window
!==
"undefined"
?
window
:
this
,
function
(
window
,
noGlobal
)
{
}(
typeof
window
!==
"undefined"
?
window
:
this
,
function
(
window
,
noGlobal
)
{
// Can't do this because several apps including ASP.NET trace
// Support: Firefox 18+
// Can't be in strict mode, several libs including ASP.NET trace
// the stack via arguments.caller.callee and Firefox dies if
// the stack via arguments.caller.callee and Firefox dies if
// you try to trace through "use strict" call chains. (#13335)
// you try to trace through "use strict" call chains. (#13335)
// Support: Firefox 18+
//"use strict";
//"use strict";
src/manipulation.js
View file @
d837f119
...
@@ -29,7 +29,7 @@ var
...
@@ -29,7 +29,7 @@ var
// We have to close these tags to support XHTML (#13200)
// We have to close these tags to support XHTML (#13200)
wrapMap
=
{
wrapMap
=
{
// Support: IE
9
// Support: IE9
option
:
[
1
,
"<select multiple='multiple'>"
,
"</select>"
],
option
:
[
1
,
"<select multiple='multiple'>"
,
"</select>"
],
thead
:
[
1
,
"<table>"
,
"</table>"
],
thead
:
[
1
,
"<table>"
,
"</table>"
],
...
@@ -40,7 +40,7 @@ var
...
@@ -40,7 +40,7 @@ var
_default
:
[
0
,
""
,
""
]
_default
:
[
0
,
""
,
""
]
};
};
// Support: IE
9
// Support: IE9
wrapMap
.
optgroup
=
wrapMap
.
option
;
wrapMap
.
optgroup
=
wrapMap
.
option
;
wrapMap
.
tbody
=
wrapMap
.
tfoot
=
wrapMap
.
colgroup
=
wrapMap
.
caption
=
wrapMap
.
thead
;
wrapMap
.
tbody
=
wrapMap
.
tfoot
=
wrapMap
.
colgroup
=
wrapMap
.
caption
=
wrapMap
.
thead
;
...
@@ -130,7 +130,7 @@ function getAll( context, tag ) {
...
@@ -130,7 +130,7 @@ function getAll( context, tag ) {
ret
;
ret
;
}
}
//
Support: IE >= 9
//
Fix IE bugs, see support tests
function
fixInput
(
src
,
dest
)
{
function
fixInput
(
src
,
dest
)
{
var
nodeName
=
dest
.
nodeName
.
toLowerCase
();
var
nodeName
=
dest
.
nodeName
.
toLowerCase
();
...
@@ -150,8 +150,7 @@ jQuery.extend({
...
@@ -150,8 +150,7 @@ jQuery.extend({
clone
=
elem
.
cloneNode
(
true
),
clone
=
elem
.
cloneNode
(
true
),
inPage
=
jQuery
.
contains
(
elem
.
ownerDocument
,
elem
);
inPage
=
jQuery
.
contains
(
elem
.
ownerDocument
,
elem
);
// Support: IE >= 9
// Fix IE cloning issues
// Fix Cloning issues
if
(
!
support
.
noCloneChecked
&&
(
elem
.
nodeType
===
1
||
elem
.
nodeType
===
11
)
&&
if
(
!
support
.
noCloneChecked
&&
(
elem
.
nodeType
===
1
||
elem
.
nodeType
===
11
)
&&
!
jQuery
.
isXMLDoc
(
elem
)
)
{
!
jQuery
.
isXMLDoc
(
elem
)
)
{
...
@@ -202,8 +201,8 @@ jQuery.extend({
...
@@ -202,8 +201,8 @@ jQuery.extend({
// Add nodes directly
// Add nodes directly
if
(
jQuery
.
type
(
elem
)
===
"object"
)
{
if
(
jQuery
.
type
(
elem
)
===
"object"
)
{
// Support: QtWebKit
// Support: QtWebKit
, PhantomJS
//
jQuery.merge because push.apply(_, arraylike) throws
//
push.apply(_, arraylike) throws on ancient WebKit
jQuery
.
merge
(
nodes
,
elem
.
nodeType
?
[
elem
]
:
elem
);
jQuery
.
merge
(
nodes
,
elem
.
nodeType
?
[
elem
]
:
elem
);
// Convert non-html into a text node
// Convert non-html into a text node
...
@@ -225,15 +224,14 @@ jQuery.extend({
...
@@ -225,15 +224,14 @@ jQuery.extend({
tmp
=
tmp
.
lastChild
;
tmp
=
tmp
.
lastChild
;
}
}
// Support: QtWebKit
// Support: QtWebKit
, PhantomJS
//
jQuery.merge because push.apply(_, arraylike) throws
//
push.apply(_, arraylike) throws on ancient WebKit
jQuery
.
merge
(
nodes
,
tmp
.
childNodes
);
jQuery
.
merge
(
nodes
,
tmp
.
childNodes
);
// Remember the top-level container
// Remember the top-level container
tmp
=
fragment
.
firstChild
;
tmp
=
fragment
.
firstChild
;
// Fixes #12346
// Ensure the created nodes are orphaned (#12392)
// Support: Webkit, IE
tmp
.
textContent
=
""
;
tmp
.
textContent
=
""
;
}
}
}
}
...
...
src/manipulation/support.js
View file @
d837f119
...
@@ -7,21 +7,22 @@ define([
...
@@ -7,21 +7,22 @@ define([
div
=
fragment
.
appendChild
(
document
.
createElement
(
"div"
)
),
div
=
fragment
.
appendChild
(
document
.
createElement
(
"div"
)
),
input
=
document
.
createElement
(
"input"
);
input
=
document
.
createElement
(
"input"
);
// #11217 - WebKit loses check when the name is after the checked attribute
// Support: Safari<=5.1
// Check state lost if the name is set (#11217)
// Support: Windows Web Apps (WWA)
// Support: Windows Web Apps (WWA)
// `name` and `type`
need .setAttribute for WWA
// `name` and `type`
must use .setAttribute for WWA (#14901)
input
.
setAttribute
(
"type"
,
"radio"
);
input
.
setAttribute
(
"type"
,
"radio"
);
input
.
setAttribute
(
"checked"
,
"checked"
);
input
.
setAttribute
(
"checked"
,
"checked"
);
input
.
setAttribute
(
"name"
,
"t"
);
input
.
setAttribute
(
"name"
,
"t"
);
div
.
appendChild
(
input
);
div
.
appendChild
(
input
);
// Support: Safari
5.1, iOS 5.1, Android 4.x, Android 2.3
// Support: Safari
<=5.1, Android<4.2
//
old
WebKit doesn't clone checked state correctly in fragments
//
Older
WebKit doesn't clone checked state correctly in fragments
support
.
checkClone
=
div
.
cloneNode
(
true
).
cloneNode
(
true
).
lastChild
.
checked
;
support
.
checkClone
=
div
.
cloneNode
(
true
).
cloneNode
(
true
).
lastChild
.
checked
;
// Support: IE<=11+
// Make sure textarea (and checkbox) defaultValue is properly cloned
// Make sure textarea (and checkbox) defaultValue is properly cloned
// Support: IE9-IE11+
div
.
innerHTML
=
"<textarea>x</textarea>"
;
div
.
innerHTML
=
"<textarea>x</textarea>"
;
support
.
noCloneChecked
=
!!
div
.
cloneNode
(
true
).
lastChild
.
defaultValue
;
support
.
noCloneChecked
=
!!
div
.
cloneNode
(
true
).
lastChild
.
defaultValue
;
})();
})();
...
...
src/offset.js
View file @
d837f119
...
@@ -39,7 +39,8 @@ jQuery.offset = {
...
@@ -39,7 +39,8 @@ jQuery.offset = {
calculatePosition
=
(
position
===
"absolute"
||
position
===
"fixed"
)
&&
calculatePosition
=
(
position
===
"absolute"
||
position
===
"fixed"
)
&&
(
curCSSTop
+
curCSSLeft
).
indexOf
(
"auto"
)
>
-
1
;
(
curCSSTop
+
curCSSLeft
).
indexOf
(
"auto"
)
>
-
1
;
// 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
if
(
calculatePosition
)
{
if
(
calculatePosition
)
{
curPosition
=
curElem
.
position
();
curPosition
=
curElem
.
position
();
curTop
=
curPosition
.
top
;
curTop
=
curPosition
.
top
;
...
@@ -96,8 +97,8 @@ jQuery.fn.extend({
...
@@ -96,8 +97,8 @@ jQuery.fn.extend({
return
box
;
return
box
;
}
}
// Support: BlackBerry 5, iOS 3 (original iPhone)
// If we don't have gBCR, just use 0,0 rather than error
// If we don't have gBCR, just use 0,0 rather than error
// BlackBerry 5, iOS 3 (original iPhone)
if
(
typeof
elem
.
getBoundingClientRect
!==
strundefined
)
{
if
(
typeof
elem
.
getBoundingClientRect
!==
strundefined
)
{
box
=
elem
.
getBoundingClientRect
();
box
=
elem
.
getBoundingClientRect
();
}
}
...
@@ -119,7 +120,7 @@ jQuery.fn.extend({
...
@@ -119,7 +120,7 @@ jQuery.fn.extend({
// Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
// Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
if
(
jQuery
.
css
(
elem
,
"position"
)
===
"fixed"
)
{
if
(
jQuery
.
css
(
elem
,
"position"
)
===
"fixed"
)
{
//
We assume that getBoundingClientRect is availabl
e when computed position is fixed
//
Assume getBoundingClientRect is ther
e when computed position is fixed
offset
=
elem
.
getBoundingClientRect
();
offset
=
elem
.
getBoundingClientRect
();
}
else
{
}
else
{
...
@@ -182,16 +183,18 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(
...
@@ -182,16 +183,18 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(
};
};
});
});
// Support: Safari<7+, Chrome<37+
// Add the top/left cssHooks using jQuery.fn.position
// Add the top/left cssHooks using jQuery.fn.position
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
// getComputedStyle returns percent when specified for top/left/bottom/right
// Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
// rather than make the css module depend on the offset module, we just check for it here
// getComputedStyle returns percent when specified for top/left/bottom/right;
// rather than make the css module depend on the offset module, just check for it here
jQuery
.
each
(
[
"top"
,
"left"
],
function
(
i
,
prop
)
{
jQuery
.
each
(
[
"top"
,
"left"
],
function
(
i
,
prop
)
{
jQuery
.
cssHooks
[
prop
]
=
addGetHookIf
(
support
.
pixelPosition
,
jQuery
.
cssHooks
[
prop
]
=
addGetHookIf
(
support
.
pixelPosition
,
function
(
elem
,
computed
)
{
function
(
elem
,
computed
)
{
if
(
computed
)
{
if
(
computed
)
{
computed
=
curCSS
(
elem
,
prop
);
computed
=
curCSS
(
elem
,
prop
);
//
i
f curCSS returns percentage, fallback to offset
//
I
f curCSS returns percentage, fallback to offset
return
rnumnonpx
.
test
(
computed
)
?
return
rnumnonpx
.
test
(
computed
)
?
jQuery
(
elem
).
position
()[
prop
]
+
"px"
:
jQuery
(
elem
).
position
()[
prop
]
+
"px"
:
computed
;
computed
;
...
...
src/queue.js
View file @
d837f119
...
@@ -50,7 +50,7 @@ jQuery.extend({
...
@@ -50,7 +50,7 @@ jQuery.extend({
queue
.
unshift
(
"inprogress"
);
queue
.
unshift
(
"inprogress"
);
}
}
//
c
lear up the last queue stop function
//
C
lear up the last queue stop function
delete
hooks
.
stop
;
delete
hooks
.
stop
;
fn
.
call
(
elem
,
next
,
hooks
);
fn
.
call
(
elem
,
next
,
hooks
);
}
}
...
@@ -60,7 +60,7 @@ jQuery.extend({
...
@@ -60,7 +60,7 @@ jQuery.extend({
}
}
},
},
//
not intended for public consumption - generates a queueHooks object, or returns
the current one
//
Not public - generate a queueHooks object, or return
the current one
_queueHooks
:
function
(
elem
,
type
)
{
_queueHooks
:
function
(
elem
,
type
)
{
var
key
=
type
+
"queueHooks"
;
var
key
=
type
+
"queueHooks"
;
return
data_priv
.
get
(
elem
,
key
)
||
data_priv
.
access
(
elem
,
key
,
{
return
data_priv
.
get
(
elem
,
key
)
||
data_priv
.
access
(
elem
,
key
,
{
...
@@ -90,7 +90,7 @@ jQuery.fn.extend({
...
@@ -90,7 +90,7 @@ jQuery.fn.extend({
this
.
each
(
function
()
{
this
.
each
(
function
()
{
var
queue
=
jQuery
.
queue
(
this
,
type
,
data
);
var
queue
=
jQuery
.
queue
(
this
,
type
,
data
);
//
e
nsure a hooks for this queue
//
E
nsure a hooks for this queue
jQuery
.
_queueHooks
(
this
,
type
);
jQuery
.
_queueHooks
(
this
,
type
);
if
(
type
===
"fx"
&&
queue
[
0
]
!==
"inprogress"
)
{
if
(
type
===
"fx"
&&
queue
[
0
]
!==
"inprogress"
)
{
...
...
src/traversing.js
View file @
d837f119
...
@@ -8,7 +8,7 @@ define([
...
@@ -8,7 +8,7 @@ define([
],
function
(
jQuery
,
indexOf
,
rneedsContext
)
{
],
function
(
jQuery
,
indexOf
,
rneedsContext
)
{
var
rparentsprev
=
/^
(?:
parents|prev
(?:
Until|All
))
/
,
var
rparentsprev
=
/^
(?:
parents|prev
(?:
Until|All
))
/
,
//
m
ethods guaranteed to produce a unique set when starting from a unique set
//
M
ethods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique
=
{
guaranteedUnique
=
{
children
:
true
,
children
:
true
,
contents
:
true
,
contents
:
true
,
...
@@ -88,8 +88,7 @@ jQuery.fn.extend({
...
@@ -88,8 +88,7 @@ jQuery.fn.extend({
return
this
.
pushStack
(
matched
.
length
>
1
?
jQuery
.
unique
(
matched
)
:
matched
);
return
this
.
pushStack
(
matched
.
length
>
1
?
jQuery
.
unique
(
matched
)
:
matched
);
},
},
// Determine the position of an element within
// Determine the position of an element within the set
// the matched set of elements
index
:
function
(
elem
)
{
index
:
function
(
elem
)
{
// No argument, return index in parent
// No argument, return index in parent
...
@@ -97,7 +96,7 @@ jQuery.fn.extend({
...
@@ -97,7 +96,7 @@ jQuery.fn.extend({
return
(
this
[
0
]
&&
this
[
0
].
parentNode
)
?
this
.
first
().
prevAll
().
length
:
-
1
;
return
(
this
[
0
]
&&
this
[
0
].
parentNode
)
?
this
.
first
().
prevAll
().
length
:
-
1
;
}
}
//
i
ndex in selector
//
I
ndex in selector
if
(
typeof
elem
===
"string"
)
{
if
(
typeof
elem
===
"string"
)
{
return
indexOf
.
call
(
jQuery
(
elem
),
this
[
0
]
);
return
indexOf
.
call
(
jQuery
(
elem
),
this
[
0
]
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment