Skip to main content

Search and Top Navigation

#4950 closed bug (fixed)

Opened November 11, 2009 01:42PM UTC

Closed November 12, 2009 08:43PM UTC

CSSStyleDeclaration is used incorrectly

Reported by: divide Owned by:
Priority: major Milestone: 1.8
Component: ui.effects.core Version: 1.7.2
Keywords: konqueror, kjs, CSSStyleDeclaration, CSS, styles, getComputedStyle, animateClass Cc: divided.mind@gmail.com
Blocked by: Blocking:
Description

Currently animateClass() (and perhaps others) iterate directly over CSSStyleDeclaration returned from getComputedStyle() as if it were a hash with style values contained directly. But this convenient access mode is not codified in standards (http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration) and thus not necessarily available in all browsers.

In particular, KJS (Konqueror), as of KDE 4.3.75, only provides standards-compliant interface to CSSStyleDeclaration, which renders animateClass() (and any and all effects depending on it) unusable.

Attachments (0)
Change History (4)

Changed November 11, 2009 01:58PM UTC by divide comment:1

The following function converts to hash for drop-in replacement:

function css2hash(css) {
	var out = {};
	var i;
	for (i = 0; i < css.length; i++) {
		var key = css.item(i);
		out[key] = css.getPropertyValue(key);
	}
	return out;
}

Changed November 12, 2009 02:24PM UTC by scottgonzalez comment:2

Can you please test against trunk? This code has been completely rewritten.

Changed November 12, 2009 02:25PM UTC by scottgonzalez comment:3

component: ui.coreeffects.core
milestone: TBD1.8

Changed November 12, 2009 08:43PM UTC by scottgonzalez comment:4

resolution: → fixed
status: newclosed