| 6605 | } ); |
| 6606 | |
| 6607 | function computeStyleTests() { |
| 6608 | var contents, divStyle, |
| 6609 | documentElement = document.documentElement; |
| 6610 | |
| 6611 | // Setup |
| 6612 | documentElement.appendChild( container ); |
| 6613 | |
| 6614 | div.style.cssText = |
| 6615 | |
| 6616 | // Support: Android 2.3 |
| 6617 | // Vendor-prefix box-sizing |
| 6618 | "-webkit-box-sizing:border-box;box-sizing:border-box;" + |
| 6619 | "position:relative;display:block;" + |
| 6620 | "margin:auto;border:1px;padding:1px;" + |
| 6621 | "top:1%;width:50%"; |
| 6622 | |
| 6623 | // Support: IE<9 |
| 6624 | // Assume reasonable values in the absence of getComputedStyle |
| 6625 | pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false; |
| 6626 | pixelMarginRightVal = reliableMarginRightVal = true; |
| 6627 | |
| 6628 | // Check for getComputedStyle so that this code is not run in IE<9. |
| 6629 | if ( window.getComputedStyle ) { |
| 6630 | divStyle = window.getComputedStyle( div ); |
| 6631 | pixelPositionVal = ( divStyle || {} ).top !== "1%"; |
| 6632 | reliableMarginLeftVal = ( divStyle || {} ).marginLeft === "2px"; |
| 6633 | boxSizingReliableVal = ( divStyle || { width: "4px" } ).width === "4px"; |
| 6634 | |
| 6635 | // Support: Android 4.0 - 4.3 only |
| 6636 | // Some styles come back with percentage values, even though they shouldn't |
| 6637 | div.style.marginRight = "50%"; |
| 6638 | pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px"; |
| 6639 | |
| 6640 | // Support: Android 2.3 only |
| 6641 | // Div with explicit width and no margin-right incorrectly |
| 6642 | // gets computed margin-right based on width of container (#3333) |
| 6643 | // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right |
| 6644 | contents = div.appendChild( document.createElement( "div" ) ); |
| 6645 | |
| 6646 | // Reset CSS: box-sizing; display; margin; border; padding |
| 6647 | contents.style.cssText = div.style.cssText = |
| 6648 | |
| 6649 | // Support: Android 2.3 |
| 6650 | // Vendor-prefix box-sizing |
| 6651 | "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + |
| 6652 | "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; |
| 6653 | contents.style.marginRight = contents.style.width = "0"; |
| 6654 | div.style.width = "1px"; |
| 6655 | |
| 6656 | reliableMarginRightVal = |
| 6657 | !parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight ); |
| 6658 | |
| 6659 | div.removeChild( contents ); |
| 6660 | } |
| 6661 | |
| 6662 | // Support: IE6-8 |
| 6663 | // First check that getClientRects works as expected |
| 6664 | // Check if table cells still have offsetWidth/Height when they are set |