Standards issue on kHTML button property of event object

David Faure faure at kde.org
Thu Mar 13 17:50:58 GMT 2008


On Tuesday 11 March 2008, Alex Fiestas wrote:
> Hello,
>  
> I have been checking lately how eyeOS works in Konqueror 4, and I think I have 
> found a problem related with the standards.
> The 'button' property of the 'event' object returns identical values just as 
> Internet Explorer, not complying with standards.
>  
> Internet explorer & khtml Revision 748931:
> LMB=1 RMB=2 MMB=4
> W3C/DOM:
> LMB=0 MMB=2 RMB=1 

... and mozilla/firefox too, I assume?

> In the file kjs_events.cpp of the revision 748931 there is a comment 
> indicating that khtml behaves in a different way 
> with the explained behaviour above.
>  
> 646 :   dfaure  112178   // Tricky. The DOM (and khtml) use 0 for LMB, 1 for 
> MMB and 2 for RMB
> 647 :                   // but MSIE uses 1=LMB, 2=RMB, 4=MMB, as a bitfield
>  
> Nevertheless, I found below a conditional that changes these values.
>  
> 649 :   dfaure  112178   int button = domButton==0 ? 1 : domButton==1 ? 4 : 
> domButton==2 ? 2 : 0;

True. I was trying to emulate IE as much as possible, at the time.
(Note the "netscape compat" code above that, which would use 0,1,2 when the user
chose a netscape useragent).

> In my opinion, I think that at least the possibility of making khtml 100% 
> standards compliant should at least be considered, including this property.

Nowadays, I would agree. IE isn't 99% of the market anymore, so I'm fine
with moving the IE emulation to "if the user chose a IE useragent",
and letting the default be: standards compliance.

Patch attached.

Current KHTML developers: would you agree with this patch for kde-4.1?

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kjs_events.diff
Type: text/x-diff
Size: 1220 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20080313/ef2d2c82/attachment.diff>


More information about the kfm-devel mailing list