Ticket #4950 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

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@…
Blocking: Blocked by:

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.

Change History

comment:1 Changed 5 years ago by divide

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

comment:2 Changed 5 years ago by scott.gonzalez

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

comment:3 Changed 5 years ago by scott.gonzalez

  • Component changed from ui.core to effects.core
  • Milestone changed from TBD to 1.8

comment:4 Changed 5 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.