Version: (using KDE KDE 3.4.2) Installed from: Debian testing/unstable Packages A tab in a javascript string should always count as 1 character. However, konqueror from kde 3.4 (and according to Sho_ on IRC also konqueror from 3.5) seems to interpret a tab as 8 spaces rather than as one character. Thus the substring method can be severly off. As an example, the following JavaScript code shows the problem (note that there is exactly one tab character between "Is" and "this", as well as between "No" and "Yes"!): var myString='Is this No Yes Yes '; var tmpAnswer=myString.substring(15,18); document.write('<p>Is this correct: '+tmpAnswer+'</p>'); In Konqueror, the tab after the "Is" is counted as 8 spaces, thus the substring begins at "No ". In all other browsers (firefox and opera), the tabs are counted a as one character, so offset 15 is right at the last "Yes". I'll attach the sample file for quickly checking the bug. Cheers, Reinhold
Created attachment 13206 [details] Simple sample page to show the bug in kde 3.4 (and 3.5)
*** Bug 115330 has been marked as a duplicate of this bug. ***
This is a KHTML parser bug. The tabs are being expanded before they arrive at KJS.
Confirmed even on konqueror 4.0.3
*** Bug 141122 has been marked as a duplicate of this bug. ***
*** Bug 170401 has been marked as a duplicate of this bug. ***
http://pc44.one.pl/goorol/bugs/kde_001.html IE, FF, Opera, Safari alert TRUE KHTML alerts FALSE because wrongly interprets TAB char (chr(9)) as spaces string!
Created attachment 27357 [details] source
Created attachment 27361 [details] patch First try at fix... Or rather, it fixes that, but exposes some other likely bugs that need to be sorted out before committing.
Fixed in r860109