dom-support
Test for browser rendering/styling quirks. Extracted from jQuery.
Installation
$ component install timoxley/dom-support
Usage
``js
var support = require('dom-support');
console.log(support.opacity) // true in Chrome, false in IE
`
API
All properties of the dom-support object are Boolean`.
$3
IE strips leading whitespace when .innerHTML is used
$3
Make sure that tbody elements aren't automatically inserted. IE will insert them into empty tables
$3
Make sure that link elements get serialized correctly by innerHTML. This requires a wrapper element in IE
$3
Get the style information from getAttribute (IE uses .cssText instead)
$3
Make sure that URLs aren't manipulated. (IE normalizes it by default)
$3
Make sure that element opacity exists (IE uses filter instead) Use a regex to work around a WebKit issue.
$3
Verify style float existence (IE uses styleFloat instead of cssFloat
$3
Make sure that if no value is specified for a checkbox that it defaults to "on". (WebKit defaults to "" instead)
$3
Make sure that a selected-by-default option has a working selected property. (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
$3
Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
$3
Tests for enctype support on a form
$3
Makes sure cloning an html5 element does not cause problems
$3
Detect support for bubbling the corresponding event in non-standard event systems (namely IE).
$3
Test to see if it's possible to delete an expando from an element (Fails
in IE)
$3
Cloning a node shouldn't copy over any bound event handlers (IE does this)
$3
Make sure checked status is properly cloned
$3
Make sure that the options inside disabled selects aren't marked as disabled (WebKit marks them as disabled)
$3
Check if a radio maintains its value after being appended to the DOM
$3
WebKit doesn't clone checked state correctly in fragments
$3
Check if a disconnected checkbox will retain its checked value of true after appended to the DOM (IE6/7)
$3
Check if table cells still have offsetWidth/Height when they are set
to display:none and there are still other visible table cells in a
table row; if so, offsetWidth/Height are not reliable for use when
determining if an element has been hidden directly using
display:none (it is still safe to use offsets if a parent element is
hidden; don safety goggles and see bug
#4512 for more information).
(only IE 8 fails this test)
$3
Checks box-sizing & margin behavior
$3
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
#3333Fails in WebKit before Feb 2011 nightlies
WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
$3
Check if natively block-level elements act like inline-block
elements when setting their display to 'inline' and giving
them layout. (IE < 8 does this)
$3
Check if elements with layout shrink-wrap their children (IE 6 does this)
License
MIT