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
fb94277b
Commit
fb94277b
authored
Nov 18, 2011
by
timmywil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No global vars allowed. Declare 'body' in support.
parent
d459bd40
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
support.js
src/support.js
+13
-14
support.js
test/unit/support.js
+1
-1
No files found.
src/support.js
View file @
fb94277b
...
@@ -184,28 +184,27 @@ jQuery.support = (function() {
...
@@ -184,28 +184,27 @@ jQuery.support = (function() {
fragment
.
removeChild
(
div
);
fragment
.
removeChild
(
div
);
// Null elements to avoid leaks in IE
// Null elements to avoid leaks in IE
fragment
=
select
=
opt
=
body
=
marginDiv
=
div
=
input
=
null
;
fragment
=
select
=
opt
=
marginDiv
=
div
=
input
=
null
;
// Run fixed position tests at doc ready to avoid a crash
// Run tests that need a body at doc ready
// related to the invisible body in IE8
jQuery
(
function
()
{
jQuery
(
function
()
{
var
container
,
outer
,
inner
,
table
,
td
,
offsetSupport
,
var
container
,
outer
,
inner
,
table
,
td
,
offsetSupport
,
conMarginTop
=
1
,
conMarginTop
,
ptlm
,
vb
,
style
,
html
,
ptlm
=
"position:absolute;top:0;left:0;width:1px;height:1px;margin:0;"
,
vb
=
"visibility:hidden;border:0;"
,
style
=
"style='"
+
ptlm
+
"border:5px solid #000;padding:0;'"
,
html
=
"<div "
+
style
+
"><div></div></div>"
+
"<table "
+
style
+
" cellpadding='0' cellspacing='0'>"
+
"<tr><td></td></tr></table>"
;
// Reconstruct a container
body
=
document
.
getElementsByTagName
(
"body"
)[
0
];
body
=
document
.
getElementsByTagName
(
"body"
)[
0
];
if
(
!
body
)
{
if
(
!
body
)
{
// Return for frameset docs that don't have a body
// Return for frameset docs that don't have a body
// These tests cannot be done
return
;
return
;
}
}
conMarginTop
=
1
;
ptlm
=
"position:absolute;top:0;left:0;width:1px;height:1px;margin:0;"
;
vb
=
"visibility:hidden;border:0;"
;
style
=
"style='"
+
ptlm
+
"border:5px solid #000;padding:0;'"
;
html
=
"<div "
+
style
+
"><div></div></div>"
+
"<table "
+
style
+
" cellpadding='0' cellspacing='0'>"
+
"<tr><td></td></tr></table>"
;
container
=
document
.
createElement
(
"div"
);
container
=
document
.
createElement
(
"div"
);
container
.
style
.
cssText
=
vb
+
"width:0;height:0;position:static;top:0;margin-top:"
+
conMarginTop
+
"px"
;
container
.
style
.
cssText
=
vb
+
"width:0;height:0;position:static;top:0;margin-top:"
+
conMarginTop
+
"px"
;
body
.
insertBefore
(
container
,
body
.
firstChild
);
body
.
insertBefore
(
container
,
body
.
firstChild
);
...
...
test/unit/support.js
View file @
fb94277b
...
@@ -50,7 +50,7 @@ supportIFrameTest( "body background is not lost if set prior to loading jQuery (
...
@@ -50,7 +50,7 @@ supportIFrameTest( "body background is not lost if set prior to loading jQuery (
for
(
i
in
support
)
{
for
(
i
in
support
)
{
if
(
!
(
i
in
jQuery
.
support
)
)
{
if
(
!
(
i
in
jQuery
.
support
)
)
{
passed
=
false
;
passed
=
false
;
strictEqual
(
src
[
i
],
des
t
[
i
],
"Unexpected property: "
+
i
);
strictEqual
(
jQuery
.
support
[
i
],
suppor
t
[
i
],
"Unexpected property: "
+
i
);
}
}
}
}
ok
(
passed
,
"Same support properties"
);
ok
(
passed
,
"Same support properties"
);
...
...
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