[Pkg-javascript-commits] [dojo] 08/19: fix dom-style.get for IE11+, fixes #17962

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


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

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

commit 8897a3c9e0b007a1b96f725e96ce898a83239c05
Author: Bill Keese <bill at dojotoolkit.org>
Date:   Fri May 9 09:03:30 2014 +0900

    fix dom-style.get for IE11+, fixes #17962
    
    (cherry picked from commit f5712e10969c16b14e591a2bec037758d6e86e9a)
---
 dom-style.js         | 2 +-
 tests/dom-style.html | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/dom-style.js b/dom-style.js
index bc3f5b6..81b1075 100644
--- a/dom-style.js
+++ b/dom-style.js
@@ -188,7 +188,7 @@ define(["./sniff", "./dom"], function(has, dom){
 	function _toStyleValue(node, type, value){
 		//TODO: should we really be doing string case conversion here? Should we cache it? Need to profile!
 		type = type.toLowerCase();
-		if(has("ie")){
+		if(has("ie") || has("trident")){
 			if(value == "auto"){
 				if(type == "height"){ return node.offsetHeight; }
 				if(type == "width"){ return node.offsetWidth; }
diff --git a/tests/dom-style.html b/tests/dom-style.html
index f5900ae..30b1300 100644
--- a/tests/dom-style.html
+++ b/tests/dom-style.html
@@ -30,6 +30,11 @@
 								doh.t(false);
 							}
 						}
+					},
+					function getWidth(){
+						// see http://bugs.dojotoolkit.org/ticket/17962
+						var rowWidth = domStyle.get(dom.byId("trow"), "width");
+						doh.t(rowWidth > 0, "width: " + rowWidth);
 					}
 				]);
 				doh.runOnLoad();
@@ -38,5 +43,6 @@
 	</head>
 	<body>
 	<div id="node" style="padding: 1px 2px 3px 4px;"></div>
+	<table><tbody><tr id="trow"><td>Col A</td><td>Col B</td></tr></tbody></table>
 	</body>
 </html>

-- 
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