]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/ex-mode/node_modules/space-pen/node_modules/jquery/src/css/support.js
b9eaf140207fdf8c3c568d782217ba0f5df381a9
4 ], function( jQuery
, support
) {
7 var pixelPositionVal
, boxSizingReliableVal
,
8 docElem
= document
.documentElement
,
9 container
= document
.createElement( "div" ),
10 div
= document
.createElement( "div" );
17 // Style of cloned element affects source element cloned (#8908)
18 div
.style
.backgroundClip
= "content-box";
19 div
.cloneNode( true ).style
.backgroundClip
= "";
20 support
.clearCloneStyle
= div
.style
.backgroundClip
=== "content-box";
22 container
.style
.cssText
= "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
24 container
.appendChild( div
);
26 // Executing both pixelPosition & boxSizingReliable tests require only one layout
27 // so they're executed at the same time to save the second computation.
28 function computePixelPositionAndBoxSizingReliable() {
30 // Support: Firefox<29, Android 2.3
31 // Vendor-prefix box-sizing
32 "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
33 "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
34 "border:1px;padding:1px;width:4px;position:absolute";
36 docElem
.appendChild( container
);
38 var divStyle
= window
.getComputedStyle( div
, null );
39 pixelPositionVal
= divStyle
.top
!== "1%";
40 boxSizingReliableVal
= divStyle
.width
=== "4px";
42 docElem
.removeChild( container
);
45 // Support: node.js jsdom
46 // Don't assume that getComputedStyle is a property of the global object
47 if ( window
.getComputedStyle
) {
48 jQuery
.extend( support
, {
49 pixelPosition: function() {
51 // This test is executed only once but we still do memoizing
52 // since we can use the boxSizingReliable pre-computing.
53 // No need to check if the test was already performed, though.
54 computePixelPositionAndBoxSizingReliable();
55 return pixelPositionVal
;
57 boxSizingReliable: function() {
58 if ( boxSizingReliableVal
== null ) {
59 computePixelPositionAndBoxSizingReliable();
61 return boxSizingReliableVal
;
63 reliableMarginRight: function() {
65 // Support: Android 2.3
66 // Check if div with explicit width and no margin-right incorrectly
67 // gets computed margin-right based on width of container. (#3333)
68 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
69 // This support function is only executed once so no memoizing is needed.
71 marginDiv
= div
.appendChild( document
.createElement( "div" ) );
73 // Reset CSS: box-sizing; display; margin; border; padding
74 marginDiv
.style
.cssText
= div
.style
.cssText
=
75 // Support: Firefox<29, Android 2.3
76 // Vendor-prefix box-sizing
77 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
78 "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
79 marginDiv
.style
.marginRight
= marginDiv
.style
.width
= "0";
80 div
.style
.width
= "1px";
81 docElem
.appendChild( container
);
83 ret
= !parseFloat( window
.getComputedStyle( marginDiv
, null ).marginRight
);
85 docElem
.removeChild( container
);
86 div
.removeChild( marginDiv
);