@@ 6946-6988 (lines=43) @@ | ||
6943 | value; |
|
6944 | } |
|
6945 | ||
6946 | function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { |
|
6947 | var i = extra === ( isBorderBox ? "border" : "content" ) ? |
|
6948 | ||
6949 | // If we already have the right measurement, avoid augmentation |
|
6950 | 4 : |
|
6951 | ||
6952 | // Otherwise initialize for horizontal or vertical properties |
|
6953 | name === "width" ? 1 : 0, |
|
6954 | ||
6955 | val = 0; |
|
6956 | ||
6957 | for ( ; i < 4; i += 2 ) { |
|
6958 | ||
6959 | // both box models exclude margin, so add it if we want it |
|
6960 | if ( extra === "margin" ) { |
|
6961 | val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); |
|
6962 | } |
|
6963 | ||
6964 | if ( isBorderBox ) { |
|
6965 | ||
6966 | // border-box includes padding, so remove it if we want content |
|
6967 | if ( extra === "content" ) { |
|
6968 | val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); |
|
6969 | } |
|
6970 | ||
6971 | // at this point, extra isn't border nor margin, so remove border |
|
6972 | if ( extra !== "margin" ) { |
|
6973 | val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); |
|
6974 | } |
|
6975 | } else { |
|
6976 | ||
6977 | // at this point, extra isn't content, so add padding |
|
6978 | val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); |
|
6979 | ||
6980 | // at this point, extra isn't content nor padding, so add border |
|
6981 | if ( extra !== "padding" ) { |
|
6982 | val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); |
|
6983 | } |
|
6984 | } |
|
6985 | } |
|
6986 | ||
6987 | return val; |
|
6988 | } |
|
6989 | ||
6990 | function getWidthOrHeight( elem, name, extra ) { |
|
6991 |
@@ 5907-5949 (lines=43) @@ | ||
5904 | value; |
|
5905 | } |
|
5906 | ||
5907 | function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { |
|
5908 | var i = extra === ( isBorderBox ? "border" : "content" ) ? |
|
5909 | ||
5910 | // If we already have the right measurement, avoid augmentation |
|
5911 | 4 : |
|
5912 | ||
5913 | // Otherwise initialize for horizontal or vertical properties |
|
5914 | name === "width" ? 1 : 0, |
|
5915 | ||
5916 | val = 0; |
|
5917 | ||
5918 | for ( ; i < 4; i += 2 ) { |
|
5919 | ||
5920 | // Both box models exclude margin, so add it if we want it |
|
5921 | if ( extra === "margin" ) { |
|
5922 | val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); |
|
5923 | } |
|
5924 | ||
5925 | if ( isBorderBox ) { |
|
5926 | ||
5927 | // border-box includes padding, so remove it if we want content |
|
5928 | if ( extra === "content" ) { |
|
5929 | val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); |
|
5930 | } |
|
5931 | ||
5932 | // At this point, extra isn't border nor margin, so remove border |
|
5933 | if ( extra !== "margin" ) { |
|
5934 | val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); |
|
5935 | } |
|
5936 | } else { |
|
5937 | ||
5938 | // At this point, extra isn't content, so add padding |
|
5939 | val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); |
|
5940 | ||
5941 | // At this point, extra isn't content nor padding, so add border |
|
5942 | if ( extra !== "padding" ) { |
|
5943 | val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); |
|
5944 | } |
|
5945 | } |
|
5946 | } |
|
5947 | ||
5948 | return val; |
|
5949 | } |
|
5950 | ||
5951 | function getWidthOrHeight( elem, name, extra ) { |
|
5952 |
@@ 5742-5779 (lines=38) @@ | ||
5739 | value; |
|
5740 | } |
|
5741 | ||
5742 | function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { |
|
5743 | var i = extra === ( isBorderBox ? "border" : "content" ) ? |
|
5744 | // If we already have the right measurement, avoid augmentation |
|
5745 | 4 : |
|
5746 | // Otherwise initialize for horizontal or vertical properties |
|
5747 | name === "width" ? 1 : 0, |
|
5748 | ||
5749 | val = 0; |
|
5750 | ||
5751 | for ( ; i < 4; i += 2 ) { |
|
5752 | // both box models exclude margin, so add it if we want it |
|
5753 | if ( extra === "margin" ) { |
|
5754 | val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); |
|
5755 | } |
|
5756 | ||
5757 | if ( isBorderBox ) { |
|
5758 | // border-box includes padding, so remove it if we want content |
|
5759 | if ( extra === "content" ) { |
|
5760 | val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); |
|
5761 | } |
|
5762 | ||
5763 | // at this point, extra isn't border nor margin, so remove border |
|
5764 | if ( extra !== "margin" ) { |
|
5765 | val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); |
|
5766 | } |
|
5767 | } else { |
|
5768 | // at this point, extra isn't content, so add padding |
|
5769 | val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); |
|
5770 | ||
5771 | // at this point, extra isn't content nor padding, so add border |
|
5772 | if ( extra !== "padding" ) { |
|
5773 | val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); |
|
5774 | } |
|
5775 | } |
|
5776 | } |
|
5777 | ||
5778 | return val; |
|
5779 | } |
|
5780 | ||
5781 | function getWidthOrHeight( elem, name, extra ) { |
|
5782 |