aboutsummaryrefslogtreecommitdiffstats
path: root/src/css/support.js
blob: 053f494b263004c9b4a1faf661b3a0fc647549f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
define( [
	"../var/document",
	"../var/documentElement",
	"../var/support"
], function( document, documentElement, support ) {

"use strict";

var reliableTrDimensionsVal;

// Support: IE 11+, Edge 15 - 18+
// IE/Edge misreport `getComputedStyle` of table rows with width/height
// set in CSS while `offset*` properties report correct values.
support.reliableTrDimensions = function() {
	var table, tr, trChild;
	if ( reliableTrDimensionsVal == null ) {
		table = document.createElement( "table" );
		tr = document.createElement( "tr" );
		trChild = document.createElement( "div" );

		table.style.cssText = "position:absolute;left:-11111px";
		tr.style.height = "1px";
		trChild.style.height = "9px";

		documentElement
			.appendChild( table )
			.appendChild( tr )
			.appendChild( trChild );

		var trStyle = window.getComputedStyle( tr );
		reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;

		documentElement.removeChild( table );
	}
	return reliableTrDimensionsVal;
};

return support;

} );