Blame view

app/bower_components/jquery/src/css/support.js 2.4 KB
87c93a029   Dang YoungWorld   add modal
1
  define( [
f986e111b   TRUONG   add libs
2
  	"../core",
87c93a029   Dang YoungWorld   add modal
3
4
  	"../var/document",
  	"../var/documentElement",
f986e111b   TRUONG   add libs
5
  	"../var/support"
87c93a029   Dang YoungWorld   add modal
6
  ], function( jQuery, document, documentElement, support ) {
f986e111b   TRUONG   add libs
7

87c93a029   Dang YoungWorld   add modal
8
  "use strict";
f986e111b   TRUONG   add libs
9

87c93a029   Dang YoungWorld   add modal
10
  ( function() {
f986e111b   TRUONG   add libs
11

87c93a029   Dang YoungWorld   add modal
12
13
14
  	// Executing both pixelPosition & boxSizingReliable tests require only one layout
  	// so they're executed at the same time to save the second computation.
  	function computeStyleTests() {
f986e111b   TRUONG   add libs
15

87c93a029   Dang YoungWorld   add modal
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  		// This is a singleton, we need to execute it only once
  		if ( !div ) {
  			return;
  		}
  
  		div.style.cssText =
  			"box-sizing:border-box;" +
  			"position:relative;display:block;" +
  			"margin:auto;border:1px;padding:1px;" +
  			"top:1%;width:50%";
  		div.innerHTML = "";
  		documentElement.appendChild( container );
  
  		var divStyle = window.getComputedStyle( div );
  		pixelPositionVal = divStyle.top !== "1%";
  
  		// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  		reliableMarginLeftVal = divStyle.marginLeft === "2px";
  		boxSizingReliableVal = divStyle.width === "4px";
  
  		// Support: Android 4.0 - 4.3 only
  		// Some styles come back with percentage values, even though they shouldn't
  		div.style.marginRight = "50%";
  		pixelMarginRightVal = divStyle.marginRight === "4px";
  
  		documentElement.removeChild( container );
  
  		// Nullify the div so it wouldn't be stored in the memory and
  		// it will also be a sign that checks already performed
  		div = null;
  	}
f986e111b   TRUONG   add libs
47

87c93a029   Dang YoungWorld   add modal
48
49
50
  	var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
  		container = document.createElement( "div" ),
  		div = document.createElement( "div" );
f986e111b   TRUONG   add libs
51

87c93a029   Dang YoungWorld   add modal
52
53
54
55
  	// Finish early in limited (non-browser) environments
  	if ( !div.style ) {
  		return;
  	}
f986e111b   TRUONG   add libs
56

87c93a029   Dang YoungWorld   add modal
57
58
  	// Support: IE <=9 - 11 only
  	// Style of cloned element affects source element cloned (#8908)
f986e111b   TRUONG   add libs
59
60
61
  	div.style.backgroundClip = "content-box";
  	div.cloneNode( true ).style.backgroundClip = "";
  	support.clearCloneStyle = div.style.backgroundClip === "content-box";
87c93a029   Dang YoungWorld   add modal
62
63
64
  	container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
  		"padding:0;margin-top:1px;position:absolute";
  	container.appendChild( div );
f986e111b   TRUONG   add libs
65

87c93a029   Dang YoungWorld   add modal
66
67
68
69
70
  	jQuery.extend( support, {
  		pixelPosition: function() {
  			computeStyleTests();
  			return pixelPositionVal;
  		},
f986e111b   TRUONG   add libs
71
  		boxSizingReliable: function() {
87c93a029   Dang YoungWorld   add modal
72
  			computeStyleTests();
f986e111b   TRUONG   add libs
73
74
  			return boxSizingReliableVal;
  		},
87c93a029   Dang YoungWorld   add modal
75
76
77
  		pixelMarginRight: function() {
  			computeStyleTests();
  			return pixelMarginRightVal;
f986e111b   TRUONG   add libs
78
  		},
87c93a029   Dang YoungWorld   add modal
79
80
81
  		reliableMarginLeft: function() {
  			computeStyleTests();
  			return reliableMarginLeftVal;
f986e111b   TRUONG   add libs
82
  		}
87c93a029   Dang YoungWorld   add modal
83
84
  	} );
  } )();
f986e111b   TRUONG   add libs
85
86
  
  return support;
87c93a029   Dang YoungWorld   add modal
87
  } );