<commit_before>/*
 * L.DomUtil contains various utility functions for working with DOM
 */

L.DomUtil = {
	get: function(id) {
		return (typeof id == 'string' ? document.getElementById(id) : id);
	},
		
	getCumulativeOffset: function(el) {
		var top = 0, 
			left = 0;
		do {
			top += (el.offsetTop - el.scrollTop) || 0;
			left += el.offsetLeft || 0;
			el = el.offsetParent;
		} while (el);
		return new L.Point(left, top);
	},
		
	// used for disabling text selection while dragging
	disableTextSelection: function() {
		if (document.selection && document.selection.empty) { 
			document.selection.empty();
		}
		if (!L.DomUtil._onselectstart) {
			L.DomUtil._onselectstart = document.onselectstart;
			document.onselectstart = function() { return false; };
		}
	},
	enableTextSelection: function() {
		document.onselectstart = L.DomUtil._onselectstart;
		CM.DomEvent._onselectstart = null;
	}
};<commit_msg>positioning methods (with webkit acceleration support)<commit_after>/*
 * L.DomUtil contains various utility functions for working with DOM
 */

L.DomUtil = {
	get: function(id) {
		return (typeof id == 'string' ? document.getElementById(id) : id);
	},
		
	getCumulativeOffset: function(el) {
		var top = 0, 
			left = 0;
		do {
			top += (el.offsetTop - el.scrollTop) || 0;
			left += el.offsetLeft || 0;
			el = el.offsetParent;
		} while (el);
		return new L.Point(left, top);
	},
	
	setPosition: function(el, point) {
		el._leaflet_pos = point;
		if (L.Browser.webkit) {
			el.style.webkitTransform = 'translate(' + point.x + 'px,' + point.y + 'px)';
		} else {
			el.style.left = point.x;
			el.style.top = point.y;
		}
	},
	getPosition: function(el) {
		return el._leaflet_pos;
	},
		
	// used for disabling text selection while dragging
	disableTextSelection: function() {
		if (document.selection && document.selection.empty) { 
			document.selection.empty();
		}
		if (!L.DomUtil._onselectstart) {
			L.DomUtil._onselectstart = document.onselectstart;
			document.onselectstart = function() { return false; };
		}
	},
	enableTextSelection: function() {
		document.onselectstart = L.DomUtil._onselectstart;
		CM.DomEvent._onselectstart = null;
	}
};
{'fraction_non_alphanumeric': 0.1433840479483633, 'fraction_numerical': 0.0036883356385431073, 'mean_word_length': 3.5302713987473906, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6770703', 'n_tokens_mistral': 815, 'n_tokens_neox': 729, 'n_words': 165}