Added css hook to work around bug in WebKit computed margin-right. Fixes #3333 - .css("marginRight") is incorrect in WebKit
This commit is contained in:
parent
0cf336d2c9
commit
c3c507e900
3 changed files with 44 additions and 1 deletions
|
@ -67,7 +67,8 @@
|
|||
boxModel: null,
|
||||
inlineBlockNeedsLayout: false,
|
||||
shrinkWrapBlocks: false,
|
||||
reliableHiddenOffsets: true
|
||||
reliableHiddenOffsets: true,
|
||||
reliableMarginRight: true
|
||||
};
|
||||
|
||||
input.checked = true;
|
||||
|
@ -188,6 +189,17 @@
|
|||
jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
|
||||
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 ( document.defaultView && document.defaultView.getComputedStyle ) {
|
||||
div.style.width = "1px";
|
||||
div.style.marginRight = "0";
|
||||
jQuery.support.reliableMarginRight = ( parseInt(document.defaultView.getComputedStyle(div).marginRight, 10) || 0 ) === 0;
|
||||
}
|
||||
|
||||
body.removeChild( div ).style.display = "none";
|
||||
div = tds = null;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue