Summary: | image border modified by javascript is not refreshed by the khtml engine | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Patrick Vander Linden <neo> |
Component: | khtml ecma | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | RedHat Enterprise Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Testcase mentioned above |
Description
Patrick Vander Linden
2004-09-03 00:58:21 UTC
Here is a example:<html> <head> <title>KHTML Javascript Bug</title> <script language="javascript" type="text/javascript"> function setImgBorder() { if (document.images.unxbsd.border == 3) { document.images.unxbsd.border = 0; } else if (document.images.unxbsd.border == 0) { document.images.unxbsd.border = 3; } else { alert('no way'); } alert('The img border is ' + document.images.unxbsd.border); } </script> </head> <body> <form> <h1>KHTML Javascript Bug</h1> <p/> <img alt="KDE Homepage" src="http://www.kde.org/media/images/kde_logo.jpg" name="unxbsd" width="296" height="79" border="0" /> <p/> <input type="button" value="Change Img border" onClick="setImgBorder()" /> </form> </body> </html> Created attachment 7588 [details]
Testcase mentioned above
Confirmed. Setting the border works. Clearing the border doesn't. Confirmed. With border > 0 it just works as expected. Could it be possible, that the problem is located at kdelibs/html/html/html_imageimpl.cpp line 95 at the if(attr->value().toInt()) condition cause if 0 addCSSLength(CSS_PROP_BORDER_WIDTH, attr->value()); just don't got executed? Just an idear cause other areas like html/html_objectimpl.cpp line 262 don't check if attr->value().toInt() == 0 :-) CVS commit by ggarand: remove CSS border properties when our image's border attribute translates to zero. BUG: 88727 M +6 -0 html_imageimpl.cpp 1.151 --- kdelibs/khtml/html/html_imageimpl.cpp #1.150:1.151 @@ -99,4 +99,10 @@ void HTMLImageElementImpl::parseAttribut addCSSProperty( CSS_PROP_BORDER_BOTTOM_STYLE, CSS_VAL_SOLID ); addCSSProperty( CSS_PROP_BORDER_LEFT_STYLE, CSS_VAL_SOLID ); + } else { + removeCSSProperty( CSS_PROP_BORDER_WIDTH ); + removeCSSProperty( CSS_PROP_BORDER_TOP_STYLE ); + removeCSSProperty( CSS_PROP_BORDER_RIGHT_STYLE ); + removeCSSProperty( CSS_PROP_BORDER_BOTTOM_STYLE ); + removeCSSProperty( CSS_PROP_BORDER_LEFT_STYLE ); } break; |