Summary: | DOM2 getComputedStyle support | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Ilya Konstantinov <kde-bug-report> |
Component: | khtml | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | nicolasg |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Other | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Ilya Konstantinov
2001-05-28 19:12:47 UTC
Just implemented those JS bindings (defaultView and getComputedStyle with all of DOM2). However AbstractViewImpl::getComputedStyle is still a stub. Reassigning to khtml. -- David FAURE david@mandrakesoft.com faure@kde.org http://perso.mandrakesoft.com/~david/ http://www.konqueror.org/ KDE 3.0: Konquering the Desktops Full testcase: <script> function doit() { var element = document.getElementById('test'); var style = document.defaultView.getComputedStyle(element, ""); alert(style.getPropertyValue("height")); } </script> <body onload="doit()"> <div id='test' height=450>Hello world</div> </body> Gives "17px" in Mozilla. Ouch, the first issue is the defaultView method not found. I'll debug that one right now. Ok, defaultView thing fixed. We're back to "getComputedStyle not implemented". Just one thing I wanted to mention: you can use element.offsetHeight to get the real height of the element in the render-tree, that works ok. With offsetTop, offsetLeft, offsetHeight and offsetWidth, you can get all info on position and size of the element. Of course getComputedStyle covers much more :) This feature is important for KWord's HTML import filter. Otherwise CSS cannot be supported. Have a nice day/evening/night! Another testcase from the Mozilla site: http://www.mozilla.org/docs/dom/domref/examples7.html This bug may be one of the causes of the broken menu in http://bugs.kde.org/show_bug.cgi?id=54598 CVS commit by zrusin: Implementing DOM2 getComputedStyle support. CCMAIL: 26311-done@bugs.kde.org M +10 -0 ChangeLog 1.206 M +4 -2 css/Makefile.am 1.20 M +2 -3 css/css_valueimpl.cpp 1.94 M +10 -10 css/css_valueimpl.h 1.55 M +21 -21 css/parser.cpp 1.42 M +0 -1 rendering/render_object.cpp 1.251 M +14 -2 xml/dom2_viewsimpl.cpp 1.7 M +1 -2 xml/dom_elementimpl.cpp 1.196 |