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
c18f1f11
Commit
c18f1f11
authored
Jun 18, 2012
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Detect IE collapsing body margin directly rather than inferring it.
parent
5c375065
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
offset.js
test/unit/offset.js
+6
-7
No files found.
test/unit/offset.js
View file @
c18f1f11
...
@@ -144,8 +144,8 @@ testIframe("offset/absolute", "absolute", function( jQuery ) {
...
@@ -144,8 +144,8 @@ testIframe("offset/absolute", "absolute", function( jQuery ) {
testIframe
(
"offset/relative"
,
"relative"
,
function
(
jQuery
)
{
testIframe
(
"offset/relative"
,
"relative"
,
function
(
jQuery
)
{
expect
(
60
);
expect
(
60
);
// IE is collapsing the top margin of 1px
// IE is collapsing the top margin of 1px
; detect and adjust accordingly
var
ie
=
document
.
documentMode
&&
document
.
documentMode
<
8
;
var
ie
=
jQuery
(
"#relative-1"
).
offset
().
top
===
6
;
// get offset
// get offset
var
tests
=
[
var
tests
=
[
...
@@ -205,8 +205,8 @@ testIframe("offset/relative", "relative", function( jQuery ) {
...
@@ -205,8 +205,8 @@ testIframe("offset/relative", "relative", function( jQuery ) {
testIframe
(
"offset/static"
,
"static"
,
function
(
jQuery
)
{
testIframe
(
"offset/static"
,
"static"
,
function
(
jQuery
)
{
expect
(
80
);
expect
(
80
);
// IE is collapsing the top margin of 1px
// IE is collapsing the top margin of 1px
; detect and adjust accordingly
var
ie
=
document
.
documentMode
&&
document
.
documentMode
<
8
;
var
ie
=
jQuery
(
"#static-1"
).
offset
().
top
===
6
;
// get offset
// get offset
var
tests
=
[
var
tests
=
[
...
@@ -349,13 +349,12 @@ testIframe("offset/table", "table", function( jQuery ) {
...
@@ -349,13 +349,12 @@ testIframe("offset/table", "table", function( jQuery ) {
testIframe
(
"offset/scroll"
,
"scroll"
,
function
(
jQuery
,
win
)
{
testIframe
(
"offset/scroll"
,
"scroll"
,
function
(
jQuery
,
win
)
{
expect
(
26
);
expect
(
26
);
var
ie
=
document
.
documentMode
&&
document
.
documentMode
<
8
;
// IE is collapsing the top margin of 1px; detect and adjust accordingly
var
ie
=
jQuery
(
"#scroll-1"
).
offset
().
top
==
6
;
// IE is collapsing the top margin of 1px
equal
(
jQuery
(
"#scroll-1"
).
offset
().
top
,
ie
?
6
:
7
,
"jQuery('#scroll-1').offset().top"
);
equal
(
jQuery
(
"#scroll-1"
).
offset
().
top
,
ie
?
6
:
7
,
"jQuery('#scroll-1').offset().top"
);
equal
(
jQuery
(
"#scroll-1"
).
offset
().
left
,
7
,
"jQuery('#scroll-1').offset().left"
);
equal
(
jQuery
(
"#scroll-1"
).
offset
().
left
,
7
,
"jQuery('#scroll-1').offset().left"
);
// IE is collapsing the top margin of 1px
equal
(
jQuery
(
"#scroll-1-1"
).
offset
().
top
,
ie
?
9
:
11
,
"jQuery('#scroll-1-1').offset().top"
);
equal
(
jQuery
(
"#scroll-1-1"
).
offset
().
top
,
ie
?
9
:
11
,
"jQuery('#scroll-1-1').offset().top"
);
equal
(
jQuery
(
"#scroll-1-1"
).
offset
().
left
,
11
,
"jQuery('#scroll-1-1').offset().left"
);
equal
(
jQuery
(
"#scroll-1-1"
).
offset
().
left
,
11
,
"jQuery('#scroll-1-1').offset().left"
);
...
...
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