nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components / jquery / src / css / support.js
1 define( [
2         "../core",
3         "../var/document",
4         "../var/documentElement",
5         "../var/support"
6 ], function( jQuery, document, documentElement, support ) {
7
8 ( function() {
9         var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
10                 container = document.createElement( "div" ),
11                 div = document.createElement( "div" );
12
13         // Finish early in limited (non-browser) environments
14         if ( !div.style ) {
15                 return;
16         }
17
18         // Support: IE9-11+
19         // Style of cloned element affects source element cloned (#8908)
20         div.style.backgroundClip = "content-box";
21         div.cloneNode( true ).style.backgroundClip = "";
22         support.clearCloneStyle = div.style.backgroundClip === "content-box";
23
24         container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
25                 "padding:0;margin-top:1px;position:absolute";
26         container.appendChild( div );
27
28         // Executing both pixelPosition & boxSizingReliable tests require only one layout
29         // so they're executed at the same time to save the second computation.
30         function computeStyleTests() {
31                 div.style.cssText =
32
33                         // Support: Firefox<29, Android 2.3
34                         // Vendor-prefix box-sizing
35                         "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" +
36                         "position:relative;display:block;" +
37                         "margin:auto;border:1px;padding:1px;" +
38                         "top:1%;width:50%";
39                 div.innerHTML = "";
40                 documentElement.appendChild( container );
41
42                 var divStyle = window.getComputedStyle( div );
43                 pixelPositionVal = divStyle.top !== "1%";
44                 reliableMarginLeftVal = divStyle.marginLeft === "2px";
45                 boxSizingReliableVal = divStyle.width === "4px";
46
47                 // Support: Android 4.0 - 4.3 only
48                 // Some styles come back with percentage values, even though they shouldn't
49                 div.style.marginRight = "50%";
50                 pixelMarginRightVal = divStyle.marginRight === "4px";
51
52                 documentElement.removeChild( container );
53         }
54
55         jQuery.extend( support, {
56                 pixelPosition: function() {
57
58                         // This test is executed only once but we still do memoizing
59                         // since we can use the boxSizingReliable pre-computing.
60                         // No need to check if the test was already performed, though.
61                         computeStyleTests();
62                         return pixelPositionVal;
63                 },
64                 boxSizingReliable: function() {
65                         if ( boxSizingReliableVal == null ) {
66                                 computeStyleTests();
67                         }
68                         return boxSizingReliableVal;
69                 },
70                 pixelMarginRight: function() {
71
72                         // Support: Android 4.0-4.3
73                         // We're checking for boxSizingReliableVal here instead of pixelMarginRightVal
74                         // since that compresses better and they're computed together anyway.
75                         if ( boxSizingReliableVal == null ) {
76                                 computeStyleTests();
77                         }
78                         return pixelMarginRightVal;
79                 },
80                 reliableMarginLeft: function() {
81
82                         // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37
83                         if ( boxSizingReliableVal == null ) {
84                                 computeStyleTests();
85                         }
86                         return reliableMarginLeftVal;
87                 },
88                 reliableMarginRight: function() {
89
90                         // Support: Android 2.3
91                         // Check if div with explicit width and no margin-right incorrectly
92                         // gets computed margin-right based on width of container. (#3333)
93                         // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
94                         // This support function is only executed once so no memoizing is needed.
95                         var ret,
96                                 marginDiv = div.appendChild( document.createElement( "div" ) );
97
98                         // Reset CSS: box-sizing; display; margin; border; padding
99                         marginDiv.style.cssText = div.style.cssText =
100
101                                 // Support: Android 2.3
102                                 // Vendor-prefix box-sizing
103                                 "-webkit-box-sizing:content-box;box-sizing:content-box;" +
104                                 "display:block;margin:0;border:0;padding:0";
105                         marginDiv.style.marginRight = marginDiv.style.width = "0";
106                         div.style.width = "1px";
107                         documentElement.appendChild( container );
108
109                         ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight );
110
111                         documentElement.removeChild( container );
112                         div.removeChild( marginDiv );
113
114                         return ret;
115                 }
116         } );
117 } )();
118
119 return support;
120
121 } );