#11708 closed bug (invalid)
$.support.boxModel reports false for non-IE browsers
Reported by: | ALLPRO | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The new method for setting $.boxModel & $.support.boxModel is:
jquery-1.7.2 - line 1455
jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
This returns false for ALL browsers when viewing a page without a doctype. That is incorrect as only IE browsers revert to the IE5 doctype in quirks-mode. So it seems the test should really be:
jQuery.boxModel = support.boxModel = (!jQuery.browser.msie || document.compatMode === "CSS1Compat");
The old method for testing boxModel (before 1.7.2) was to create a div with padding and then test its width. This was cumbersome but at least gave a correct result. The new test does not.
This is a serious bug as any code using $.support.boxModel to decide how to measure and size elements is now broken.
Change History (3)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
jQuery doesn't support quirks-mode.
comment:3 Changed 11 years ago by
We talked about this at length during our weekly core dev meeting.
The problem is that use of the CSS box-model
property already breaks any code that looks at jQuery.support.boxModel
and expects an answer that applies to the whole page. Internally, jQuery can (and has) solved this issue, but we can't fix the external code.
Per your comment in #7986, we'll be clarifying in docs and release notes that the jQuery.support
property is not intended as a public interface and may change with short notice. In addition, we're hard-wiring jQuery.support.boxModel = true
with the idea that will cause less disruption to broken code in the meantime. But again, that code is broken due to its incorrect assumptions and we can't fix it.
Typo in ticket description - meant to say...
That is incorrect as only IE browsers revert to the IE5 boxModel in quirks-mode.