Version: (using KDE KDE 3.0.3) Installed from: Unspecified Linux www.treemenu.com does not work ... even if it is one of the most browser independent js menus i know
You call this browser independent? // browser sniffing routine browserName = navigator.appName; browserVersion = parseInt(navigator.appVersion); if(browserName == "Netscape" && browserVersion >= 3) { MTMUsableBrowser = (navigator.userAgent.indexOf("Opera") == -1) ? true : false; } else if(browserName == "Microsoft Internet Explorer" && browserVersion >= 4) { MTMUsableBrowser = true; } else if(browserName == "Opera" && browserVersion >= 5) { MTMUsableBrowser = true; } (from the top of the main page of www.treemenu.com) Ok after faking the useragent things start to actually happen....
Subject: kdelibs/khtml/ecma CVS commit by faure: Support for document.styleSheets(i) (function call instead of the usual [i]) Trick reused from HTMLCollection, and code simply calls tryGet(). Necessary for www.treemenu.com (with IE UA), but not enough for it. CCMAIL: 50833@bugs.kde.org M +24 -0 kjs_css.cpp 1.58 M +3 -0 kjs_css.h 1.25
The next step in the IE emulation would be to implement document.createStyleSheet. With a Mozilla useragent, it fails at <style>.sheet - ah that's a bug. Fixed too. Now the tree appears (yay!). But since the site then tests "document.layers" to identify the Mozilla code paths, instead of the initial browser detection, the two methods are being mixed, leading to errors.... (argl, why don't they do it properly?) Back to the IE code path then - but for later (possibly after kde-3.1).
Pardon me for bumping in here, a user tipped me about this bug. The non-existant support for Konqueror is known to me, and I'll be having a look at it as soon as time allows. There's an entry for it in the project's SourceForge bug database: http://sourceforge.net/tracker/index.php? func=detail&aid=593070&group_id=19589&atid=369589 Feel free to contact me if you have any specific questions or just want to rant about the lack of cross-browser support in my code. :)
I'm just debugging why the tree menu on a acer DSL router doesn't appear - and yes, I'm ranting on lack of cross-browser support too. You don't even test for getElementById for your DOM support test? Looking on how hard we have to emulate the createStyleSheet property. It doesn't seem to be used that much, so perhaps a bit faking might be enough already.
For full reference on what is missing and what is expected: http://www.quirksmode.org/dom/w3c_css.html
Is this bug still there in a recent version of KDE, such as 3.5.8 or KDE4.0 RC2?
Problem is still there in KDE 4.4. The missing document.createStyleSheet is the first error I'm getting on http://sandbox.onconfluence.com/display/DEV/Development+Team+Home+Page konqueror(7173)/khtml (jscript) KJS::DOMNode::getOwnPropertySlot: DOMNode::getOwnPropertySlot "createStyleSheet" WARNING: KJS Type error: Attempt to use a non-function object or a value as a function.
Ah. My investigation was wrong, createStyleSheet only exists on IE, the page works in Firefox because it goes into a different code path. <D2xSadEagle> What the website does is test for SVG DOM. If it's not there, it falls to an IE-specific path.
try-catch won't work for createStyleSheet: Konqueror still shows the errormessage (version 4.4.2) This makes using try { if(doc.createStyleSheet){IE-code}else{normal code} }catch(err){} not userfriendly in Konqueror
re: comment #10: please elaborate. It should just take the {normal code} branch in your example.
Created attachment 52423 [details] demo of problem
The demo gives the following results: IE & FF: as expected 4 messages Chrome & Safari: 3 messages, the one that does not throw an error does not print Konqueror: 3 messages (same as Chrome & Safari) but with errors thrown
Message from the Bugsquad and Konqueror teams: This bug is closed as outdated, as we do not have the manpower to maintain the KDE3 version anymore. If you still can reproduce this issue with Konqueror 4.8.4 or later, please open a new report. Thank you for your understanding.