Setting CSS props and timers from JavaScript

Koos Vriezen koos.vriezen at xs4all.nl
Fri Nov 8 11:07:23 GMT 2002


On Sun, 3 Nov 2002, Koos Vriezen wrote:

> On Sun, 3 Nov 2002, David Faure wrote:
>
> > On Sunday 03 November 2002 17:43, Koos Vriezen wrote:
> > > No, the speed penalty of 'styleDecl.getPropertyValue(prop)' is much
> > > smaller than that of a recalc imo.
> >
> > Ah yes, I forgot to take into account the recalc. OK, now I see your point.
> >
> > > It's only one extra lookup (which could
> > > be eliminated if we really want to, removeProperty also must find it).
> >
> > Yes - but that means using Impl classes once more instead of the DOM.
>
> Well only if we really want to, but its a hashtable lookup. Speed penalty
> is small then. Leave it then as in the posted patch. Should I commit this
> one too?

And? (Meaning
--- ecma/kjs_css.cpp    2002/11/03 18:07:17     1.57
+++ ecma/kjs_css.cpp    2002/11/08 11:02:55
@@ -176,6 +176,8 @@ void DOMCSSStyleDeclaration::tryPut(Exec
 #ifdef KJS_VERBOSE
     kdDebug(6070) << "DOMCSSStyleDeclaration: prop=" << prop << "
propvalue=" << propvalue << endl;
 #endif
+    if (styleDecl.getPropertyValue(prop) == propvalue)
+        return;
     styleDecl.removeProperty(prop);
     if(!propvalue.isEmpty())
     {

)

Koos





More information about the kfm-devel mailing list