DOM2 getComputedStyle support

Zack Rusin zack at kde.org
Sun Feb 15 09:19:35 GMT 2004


On Saturday 14 February 2004 12:04, Dirk Mueller wrote:
> in that case one would have to implement a
> RenderedStyleDeclarationImpl that maps each and every query
> dynamically to the actual rendertree. on the other side, we can maybe
> reduce the code impact this way. I'd hate to write the reverse of
> CSSStyleSelector::applyRule() :/. But of course for making some sites
> / testcases work a quick&dirty implementation is more than fine.

Yeah, that's a good idea. I don't see a way of avoiding a big switch 
statement though. It's now reduced to just one call in each case 
statemant but it's still a switch. 
The adventage of using renderstyledeclarationimpl is also the fact that 
we can also use it for getoverridestyle  which is kinda like 
getcomputedstyle but writable. 
Also I put it in the khtml namespace since it's our helper and it's not 
explicitely in dom but it's not like we couldn't change namespace on 
it.

> > 2) It fixes 26311 but exposes the following problem:
> > Element::setAttribute changes the attribute but doesn't change the
> > actual rendering. Due to which the example on:
> > http://www.mozilla.org/docs/dom/domref/examples7.html doesn't work
> > (setAttribute calls change the value but the changes aren't
> > visible) Ideas?
>
> Well, thats by purpose, since editing the dom tree changes the
> default (initial) value, not the current one. so when you click
> "reset" you'd see the change.
>
> does this work in recent browsers? I think we implemented it this way
> exactly for the reason of being compatible with the other browsers.

Yeah, Mozilla now works the other way around 
( http://www.automatix.de/~zack/khtml/computed.html ).

Zack

-- 
Never underestimate the power of stupid people in large groups.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getcomputed.diff
Type: text/x-diff
Size: 4817 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040215/f5e05de0/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: css_renderstyledeclarationimpl.cpp
Type: text/x-c++src
Size: 10495 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040215/f5e05de0/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: css_renderstyledeclarationimpl.h
Type: text/x-chdr
Size: 2188 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040215/f5e05de0/attachment.h>


More information about the kfm-devel mailing list