pageX/Y vs clientX/Y

Dirk Mueller mueller at kde.org
Wed Feb 11 04:24:08 CET 2004


Hi, 

I was wondering why the layerX/Y coordinates were so horribly wrong, and 
besides a typo I found a bug we accidentally merged from the safari tree: 
you're assuming that clientX/Y are "contents" coordinates, that means that 
they don't change when the document is scrolled. However, they're in fact 
viewport coordinates (relative to the topleft of the currently visible part 
of the document canvas). 

below the patch which fixes layerX/Y for us, and which should fix clientX/Y 
for you (since pageX/Y is something different now, the patch is a bit bigger 
than trivial). 

I also added a small kludge to fix scrollWidth/Height for document.body. In 
the long run we have to use overflow:visible for <body> and not do this 
special QScrollView case for the root canvas. But for now, this is better.
I'm not sure if safari still needs this, can't test. 


Dirk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pagexy.diff
Type: text/x-diff
Size: 17455 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/khtml-devel/attachments/20040211/51df7363/pagexy-0001.bin


More information about the Khtml-devel mailing list