[Pkg-javascript-commits] [dojo] 20/27: Sniffing cssFloat on a node, thx Bill, !strict, fixes #16540.

David Prévot taffit at moszumanska.debian.org
Sun Sep 14 16:23:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.7.6
in repository dojo.

commit 605243e5edd28166faa2c30c7605f59ed51085c1
Author: Eugene Lazutkin <eugene at lazutkin.com>
Date:   Wed Apr 3 21:47:29 2013 +0000

    Sniffing cssFloat on a node, thx Bill, !strict, fixes #16540.
    
    Squashed commit of [31127] and [31144] aka:
    (cherry picked from commit aaa694f088faced90b40ac6c866760095881c60c)
    (cherry picked from commit b8a2a4ab16ca6a2f774f6b173c400720a36b51b7)
    
    (cherry picked from commit 56f7863bfedeb1388349f77daf5f2a34d41e32c0)
---
 dom-style.js | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/dom-style.js b/dom-style.js
index d91a9ce..8e7991c 100644
--- a/dom-style.js
+++ b/dom-style.js
@@ -306,8 +306,7 @@ define(["./_base/sniff", "./dom"], function(has, dom){
 		return _pixelNamesCache[type] ? toPixel(node, value) : value;
 	}
 
-	var _floatStyle = has("ie") ? "styleFloat" : "cssFloat",
-		_floatAliases = {"cssFloat": _floatStyle, "styleFloat": _floatStyle, "float": _floatStyle};
+	var _floatAliases = {cssFloat: 1, styleFloat: 1, "float": 1};
 
 	// public API
 
@@ -316,14 +315,14 @@ define(["./_base/sniff", "./dom"], function(has, dom){
 		if(l == 2 && op){
 			return _getOpacity(n);
 		}
-		name = _floatAliases[name] || name;
+		name = _floatAliases[name] ? "cssFloat" in n.style ? "cssFloat" : "styleFloat" : name;
 		var s = style.getComputedStyle(n);
 		return (l == 1) ? s : _toStyleValue(n, name, s[name] || n.style[name]); /* CSS2Properties||String||Number */
 	};
 
 	style.set = function setStyle(/*DOMNode|String*/ node, /*String|Object*/ name, /*String?*/ value){
 		var n = dom.byId(node), l = arguments.length, op = (name == "opacity");
-		name = _floatAliases[name] || name;
+		name = _floatAliases[name] ? "cssFloat" in n.style ? "cssFloat" : "styleFloat" : name;
 		if(l == 3){
 			return op ? _setOpacity(n, value) : n.style[name] = value; // Number
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list