Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13241 closed defect (fixed)

dojox.html.ext-dojo.style breaks dojo.style

Reported by: kiuma Owned by: nic
Priority: high Milestone: 1.7
Component: Dojox Version: 1.7.0b1
Keywords: style Cc: dante
Blocked By: Blocking:

Description

requiring this package will break dojo.style when called with only one argument (see http://dojo-sandbox.net/public/d252a/0)

please replace

in dojox/html/ext-dojo/style.js

the redefinition of dojo.style

                        var ds = dojo.style, docStyle = dojo.doc.documentElement.style, extStyle = dojox.html["ext-dojo"].style;
                        dojo.style = function(  /*DomNode|String*/ node,
                                                                        /*String?|Object?*/ style,
                                                                        /*String?*/ value){
                                // summary:
                                //      extended dojo.style()
                                // description:
                                //      extended dojo.style() function, capable of handling the css3 "transform" and "transform-origin" properties
                                // example:
                                // | dojo.style("rotate(20deg) scaleX(1.5) scaleY(2) skew(10deg, 20deg)")
                                var n = dojo.byId(node),
                                        tr = (style == "transform"),
                                        to = (style == "transformOrigin"),
                                        args = arguments.length
                                ;
                                if(args == 3){
                                        if(tr){
                                                extStyle.setTransform(n, value, true);
                                        }else if(to){
                                                extStyle.setTransformOrigin(n, value);
                                        }else{
                                                ds(node, style, value);
                                        }
                                }
                                if(args == 2){
                                        if(tr){
                                                return extStyle.getTransform(node);
                                        }else if(to){
                                                return extStyle.getTransformOrigin(node);
                                        }else{
                                                return ds(node, style);
                                        }
                                }
                        };

with

                        var ds = dojo.style, docStyle = dojo.doc.documentElement.style, extStyle = dojox.html["ext-dojo"].style;
                        dojo.style = function(  /*DomNode|String*/ node,
                                                                        /*String?|Object?*/ style,
                                                                        /*String?*/ value){
                                // summary:
                                //      extended dojo.style()
                                // description:
                                //      extended dojo.style() function, capable of handling the css3 "transform" and "transform-origin" properties
                                // example:
                                // | dojo.style("rotate(20deg) scaleX(1.5) scaleY(2) skew(10deg, 20deg)")
                                var n = dojo.byId(node),
                                        tr = (style == "transform"),
                                        to = (style == "transformOrigin"),
                                        args = arguments.length
                                ;
                                if(args >= 3){
                                        if(tr){
                                                extStyle.setTransform(n, value, true);
                                        }else if(to){
                                                extStyle.setTransformOrigin(n, value);
                                        }else{
                                                ds(node, style, value);
                                        }
                                } else {
                                        if(tr){
                                                return extStyle.getTransform(node);
                                        }else if(to){
                                                return extStyle.getTransformOrigin(node);
                                        }else{
                                                return ds(node, style);
                                        }
                                }
                        };

Change History (5)

comment:1 Changed 8 years ago by Adam Peller

Cc: dante added
Owner: changed from Adam Peller to nic

comment:2 Changed 8 years ago by Adam Peller

Priority: highesthigh
severity: blockermajor

comment:3 Changed 8 years ago by nic

Status: newassigned

comment:4 Changed 8 years ago by nic

Resolution: fixed
Status: assignedclosed

(In [25541]) dojo.style returns the computed style with 1 argument. fixes #13241 !strict

comment:5 Changed 8 years ago by bill

Milestone: tbd1.7
Note: See TracTickets for help on using tickets.