Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#2612 closed defect (fixed)

Bug in 0.4.2 IE dealing with layouts

Reported by: ialpert@… Owned by: sjmiles
Priority: high Milestone:
Component: General Version: 0.4.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by joose)

Loading widgets in IE gives this problem: DEBUG: [TypeError: 'currentStyle' is null or not an object] when calling loadWrapper$joinpoint$method on [object Object] with arguments [object Object] FATAL exception raised: 'currentStyle' is null or not an object.

Appears the variable currentStyle gets set to null (if there's isn't a style associated with the object, in this piece of code:

if (dojo.render.html.ie) {
	// IE branch
	dojo.html.getComputedStyle = function(/*HTMLElement|String*/node, /*String*/property, /*String*/value) {
		// summary
		// Get the computed style value for style "property" on "node" (IE).
		node = dojo.byId(node);  // FIXME: remove ability to access nodes by id for this time-critical function
		if(!node || !node.style){return value;}
		// FIXME: standardize on camel-case input to improve speed
		return node.currentStyle[dojo.html.toCamelCase(property)]; // String
	}
	// SJM: getComputedStyle should be abandoned and replaced with the below function.
	// All our supported browsers can return CSS2 compliant CssStyleDeclaration objects
	// which can be queried directly for multiple styles.
	dojo.html.getComputedStyles = function(/*HTMLElement*/node) {
		// summary
		// Get a style object containing computed styles for HTML Element node (IE).
		return node.currentStyle; // CSSStyleDeclaration
	}
}

Attachments (1)

layout-patch.patch (612 bytes) - added by joose 13 years ago.
Fix for the bug

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by joose

Attachment: layout-patch.patch added

Fix for the bug

comment:1 Changed 13 years ago by joose

Description: modified (diff)

comment:2 Changed 13 years ago by bill

Owner: changed from anonymous to sjmiles

comment:3 Changed 13 years ago by James Burke

(In [7716]) (merge from trunk) Refs #2612 Replace bad null-test, 'style' to 'currentStyle'

comment:4 Changed 13 years ago by alex

Milestone: 0.4.20.4.3

comment:5 Changed 13 years ago by sjmiles

Resolution: fixed
Status: newclosed

This was actually fixed in 7716.

comment:6 Changed 12 years ago by (none)

Milestone: 0.4.3

Milestone 0.4.3 deleted

Note: See TracTickets for help on using tickets.