id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blocking	blockedby
7986	Bug in $.support.boxModel if page has DIV-element CSS	ALLPRO		"I have a demo page for a plugin that, for simplicity, has a CSS rule like this...

{{{
div { padding: 15px; border: 1px solid #999; }
}}}

This div rule BREAKS jQuery's $.support logic. The existing jQuery 1.4.4 code is like this...

{{{
div.style.width = div.style.paddingLeft = ""1px"";
...
jQuery.support.boxModel = div.offsetWidth === 2;
}}}

Because ONLY the leftPadding is specifically set, the DIV inherits defaults for other settings, which causes boxModel, inlineBlockNeedsLayout and shrinkWrapBlocks to be set WRONG in every browser.

It is not common for DIVs to have default styling set, but it is not unreasonable either. Therefore jQuery should handle this use-case by *specifically setting all relevant styles* to avoid errors - ie...

{{{
var s = div.style
s.width = s.padding = ""1px"";
s.border = 0; s.overflow = ""hidden"";
...
jQuery.support.boxModel = div.offsetWidth === 3;
}}}

In the sample above, padding is applied both left & right, so all tests in this section must be changed from '===2' to '===3'. OR paddingRight could be set to 0, but this requires extra code.

This may be a rare bug, but it takes less than a minute to fix it, so hopefully it won't be ignored."	bug	closed	high	1.7.2	support	1.4.4	fixed				10413
