You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by jm...@apache.org on 2007/10/11 07:36:41 UTC

svn commit: r583716 - /incubator/xap/trunk/codebase/src/dojo/src/html/style.js

Author: jmargaris
Date: Thu Oct 11 00:36:41 2007
New Revision: 583716

URL: http://svn.apache.org/viewvc?rev=583716&view=rev
Log:
IE case first for optimization reasons

Modified:
    incubator/xap/trunk/codebase/src/dojo/src/html/style.js

Modified: incubator/xap/trunk/codebase/src/dojo/src/html/style.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/dojo/src/html/style.js?rev=583716&r1=583715&r2=583716&view=diff
==============================================================================
--- incubator/xap/trunk/codebase/src/dojo/src/html/style.js (original)
+++ incubator/xap/trunk/codebase/src/dojo/src/html/style.js Thu Oct 11 00:36:41 2007
@@ -230,13 +230,10 @@
 //the CSS selector should be the real css name, and the property (the new param) should be the param name
 //DOJO efficiency change
 dojo.html.getComputedStyle2 = function(/* HTMLElement */node, /* string */cssSelector, property, /* integer? */inValue){
-	//	summary
-	//	Returns the computed style of cssSelector on node.
-	node = dojo.byId(node);
-	// cssSelector may actually be in camel case, so force selector version
-	if(!node || !node.style){
-		return inValue;			
-	} else if (document.defaultView && dojo.html.isDescendantOf(node, node.ownerDocument)){ // W3, gecko, KHTML
+	if(node.currentStyle){ // IE
+		return node.currentStyle[property];	//	integer
+	} 
+	else if (document.defaultView && dojo.html.isDescendantOf(node, node.ownerDocument)){ // W3, gecko, KHTML
 		try{
 			// mozilla segfaults when margin-* and node is removed from doc
 			// FIXME: need to figure out a if there is quicker workaround
@@ -251,10 +248,7 @@
 				return inValue;	//	integer
 			}
 		}
-	} else if(node.currentStyle){ // IE
-		return node.currentStyle[property];	//	integer
-	}
-	
+	} 
 	if(node.style.getPropertyValue){ // W3
 		return node.style.getPropertyValue(cssSelector);	//	integer
 	}else{