The new jQuery 2.0.2 adds "style" attribute to the body tag in DOM tree. Is there any specific reason?
Printscreen:
While this doesn't actually affect anything it's still a valid question.
The reason is this code:
// Workaround failing boxSizing test due to offsetWidth returning wrong value
// with some non-1 values of body zoom, ticket #13543
jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
support.boxSizing = div.offsetWidth === 4;
});
This is just a test for boxSizing support. jQuery.swap()
is described in the source as:
A method for quickly swapping in/out CSS properties to get correct calculations.
body.style.zoom != null ? { zoom: 1 } : {}
returns zoom: 1
if body.style.zoom
is not null
and an empty object if it is. The returned value is then applied to the body
element which is why it has an empty style
tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With