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
1c35f381
Commit
1c35f381
authored
Feb 13, 2012
by
Vladislav Zarakovsky
Committed by
Dave Methvin
Feb 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #11337. Properly calculate $.support.reliableMarginRight.
parent
52816619
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
21 deletions
+19
-21
support.js
src/support.js
+19
-21
No files found.
src/support.js
View file @
1c35f381
...
@@ -8,7 +8,6 @@ jQuery.support = (function() {
...
@@ -8,7 +8,6 @@ jQuery.support = (function() {
select
,
select
,
opt
,
opt
,
input
,
input
,
marginDiv
,
fragment
,
fragment
,
tds
,
tds
,
events
,
events
,
...
@@ -143,23 +142,6 @@ jQuery.support = (function() {
...
@@ -143,23 +142,6 @@ jQuery.support = (function() {
fragment
.
removeChild
(
input
);
fragment
.
removeChild
(
input
);
fragment
.
appendChild
(
div
);
fragment
.
appendChild
(
div
);
div
.
innerHTML
=
""
;
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. For more
// info see bug #3333
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
if
(
window
.
getComputedStyle
)
{
marginDiv
=
document
.
createElement
(
"div"
);
marginDiv
.
style
.
width
=
"0"
;
marginDiv
.
style
.
marginRight
=
"0"
;
div
.
style
.
width
=
"2px"
;
div
.
appendChild
(
marginDiv
);
support
.
reliableMarginRight
=
(
parseInt
(
(
window
.
getComputedStyle
(
marginDiv
,
null
)
||
{
marginRight
:
0
}
).
marginRight
,
10
)
||
0
)
===
0
;
}
// Technique from Juriy Zaytsev
// Technique from Juriy Zaytsev
// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
// We only care about the case where non-standard event systems
// We only care about the case where non-standard event systems
...
@@ -185,12 +167,12 @@ jQuery.support = (function() {
...
@@ -185,12 +167,12 @@ 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
=
marginDiv
=
div
=
input
=
null
;
fragment
=
select
=
opt
=
div
=
input
=
null
;
// Run tests that need a body at doc ready
// Run tests that need a body at doc ready
jQuery
(
function
()
{
jQuery
(
function
()
{
var
container
,
outer
,
inner
,
table
,
td
,
offsetSupport
,
var
container
,
outer
,
inner
,
table
,
td
,
offsetSupport
,
conMarginTop
,
ptlm
,
vb
,
style
,
html
,
marginDiv
,
conMarginTop
,
ptlm
,
vb
,
style
,
html
,
body
=
document
.
getElementsByTagName
(
"body"
)[
0
];
body
=
document
.
getElementsByTagName
(
"body"
)[
0
];
if
(
!
body
)
{
if
(
!
body
)
{
...
@@ -233,6 +215,22 @@ jQuery.support = (function() {
...
@@ -233,6 +215,22 @@ jQuery.support = (function() {
// (IE <= 8 fail this test)
// (IE <= 8 fail this test)
support
.
reliableHiddenOffsets
=
isSupported
&&
(
tds
[
0
].
offsetHeight
===
0
);
support
.
reliableHiddenOffsets
=
isSupported
&&
(
tds
[
0
].
offsetHeight
===
0
);
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. For more
// info see bug #3333
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
if
(
window
.
getComputedStyle
)
{
div
.
innerHTML
=
""
;
marginDiv
=
document
.
createElement
(
"div"
);
marginDiv
.
style
.
width
=
"0"
;
marginDiv
.
style
.
marginRight
=
"0"
;
div
.
style
.
width
=
"2px"
;
div
.
appendChild
(
marginDiv
);
support
.
reliableMarginRight
=
(
parseInt
(
(
window
.
getComputedStyle
(
marginDiv
,
null
)
||
{
marginRight
:
0
}
).
marginRight
,
10
)
||
0
)
===
0
;
}
// Figure out if the W3C box model works as expected
// Figure out if the W3C box model works as expected
div
.
innerHTML
=
""
;
div
.
innerHTML
=
""
;
div
.
style
.
width
=
div
.
style
.
paddingLeft
=
"1px"
;
div
.
style
.
width
=
div
.
style
.
paddingLeft
=
"1px"
;
...
@@ -289,7 +287,7 @@ jQuery.support = (function() {
...
@@ -289,7 +287,7 @@ jQuery.support = (function() {
}
}
body
.
removeChild
(
container
);
body
.
removeChild
(
container
);
div
=
container
=
null
;
marginDiv
=
div
=
container
=
null
;
jQuery
.
extend
(
support
,
offsetSupport
);
jQuery
.
extend
(
support
,
offsetSupport
);
});
});
...
...
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