/**
 * feature detection about dom
 * module  dom/feature
 */

KM.DOM.feature = function(){

	function elementsByTagName(wrap, tagName){
		return wrap.getElementsByTagName(tagName);
	};

	var DOC = document,
		element_test = DOC.createElement('div'),
		a;
	
	element_test.innerHTML = ' <link/><table></table><a href="/a" style="top:1px;float:left;opacity:.7;">a</a><input type="checkbox"/>';
	
	a = elementsByTagName(element_test, 'a')[0];
	
	return {
		
		// in some old webkit(including chrome), a.style.opacity === '0,7', so use regexp instead
		// ref: 
		opacity		: /^0.7$/.test(a.style.opacity),
		
		compactEl	: !DOC.compatMode || DOC.compatMode === 'CSS1Compat' ?
			  function(doc){ return doc.documentElement; } 
			: function(doc){ return doc.body; }
	};

}();
@@ -201,16 +201,49 @@
 cument,%0A
+%09%09defaultView = DOC.defaultView,%0A
 %09%09elemen
@@ -277,16 +277,111 @@
 'div'),%0A
+%09%09ADD_EVENT_LISTENER = 'addEventListener',%0A%09%09REMOVE_EVENT_LISTENER = 'removeEventListener',%0A%09%09%0A
 %09%09a;%0A%09%0A%09
@@ -576,16 +576,85 @@
 rn %7B%0A%09%09%0A
+%09%09computedStyle: !!(defaultView && defaultView.getComputedStyle),%0A%09%09%0A
 %09%09// in 
@@ -757,18 +757,16 @@
 %09opacity
-%09%09
 : /%5E0.7$
@@ -804,17 +804,16 @@
 ompactEl
-%09
 : !DOC.c
@@ -948,16 +948,404 @@
 .body; %7D
+,%0A%09%09%09%0A%09%09addEvent: element_test%5BADD_EVENT_LISTENER%5D ?%0A%09%09%09  function(el, type, fn)%7B el%5BADD_EVENT_LISTENER%5D(type, fn, false); %7D%0A%09%09%09: function(el, type, fn)%7B el.attachEvent('on' + type, fn); %7D,%0A%09%09%0A%09%09removeEvent: element_test%5BREMOVE_EVENT_LISTENER%5D ?%0A%09%09%09  function(el, type, fn)%7B el%5BREMOVE_EVENT_LISTENER%5D(type, fn, false); %7D%0A%09%09%09: function(el, type, fn)%7B el.detachEvent('on' + type, fn); %7D%0A%09%09%09
 %0A%09%7D;%0A%0A%7D(
@@ -1346,8 +1346,12 @@
 %7D;%0A%0A%7D();
+%0A%0A%0A%0A

add support to getComputedStyles, event handlers