Version: (using KDE KDE 3.5.1) Installed from: SuSE RPMs OS: Linux Insert an empty string in innerHTML of a table cell. After that, try to insert a string in the same cell: it does not work! If you try again, the string is correctly inserted. In attachment an example html page: click on "GO RIGHT", the string "Informazioni al momento non disponibili" is replaced with an empty string. Correct! Now click on GO LEFT. Expected: the empty string is going to be replaced with "Informazioni al momento non disponibili". Wrong! You have to click a second time. The page works as expected with firefox or internet explorer. I looked the code, I think that the problem is in htmltokenizer.cpp or in htmlparser.cpp. Infact, if checking the HTMLElementImpl::setInnerHtml, the fragment created does not have children when the string is empty, so the rect is not repainted. Now the example: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <script type="text/javascript" language="JavaScript"> var programDescObj = null; function init() { programDescObj=document.getElementById("programDesc"); updateEventGraphic(); } function updateEventGraphic(arg) { if (arg == "right") { programDescObj.innerHTML = ""; } else { programDescObj.innerHTML = "Informazioni al momento non disponibili"; } } </script> <style type="text/css"> #programInfoDesc{position:absolute;left:93px;top:374px;z-index:2;width:445px;height:117px;visibility:visible;} .nero16cont {color:#000000;padding-left:5px;padding-right:5px;line-height:23px;} </style> </head> <body onload="init()" > <!-- ++++++++++ programInfoDesc +++++++++++++ --> <div id="programInfoDesc" class="programInfoDescTop1"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td id="programDesc" width="445" height="118" valign="top" class="nero16cont"></td> </tr> </table> </div> <div style="position:absolute;top:200px;left:40px;"> <a id="0-0" href="javascript:updateEventGraphic('left')" fwleft="1-1" fwright="1-1">GO LEFT</a> <a id="1-1" href="javascript:updateEventGraphic('right')" fwleft="0-0" fwright="0-0">GO RIGHT</a> </div> </body> </html>
Created attachment 17911 [details] test case attached
confirmed, svn r583k
Tested again with kdelibs r626611. Actually, it is not necessary to click on "GO LEFT" to show the hidden text. Even a click on the page in any place under which the div is supposed to go seems to trigger a refresh of the hidden area. I have reduced the testcase a bit more, and the required condition to see the bug is that the <td> must contain the width attribute.
Created attachment 19396 [details] Reduced testcase This is a reduced testcase still showing the bug.
Bug appears to be fixed in SVN trunk rev. 798811. Can still be reproduced in 3.5.9.
closing as its resolved in 4.0.3