<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>8128</bug_id>
          
          <creation_ts>2006-04-01 18:11:59 -0800</creation_ts>
          <short_desc>event.clientY is improperly implemented</short_desc>
          <delta_ts>2007-08-03 22:48:09 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>8707</dup_id>
          
          <bug_file_loc>http://www.gtalbot.org/DHTMLSection/WindowEventsNS6.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gérard Talbot (no longer involved)">browserbugs2</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ddkilzer</cc>
    
    <cc>gavin.sharp</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>38240</commentid>
    <comment_count>0</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2006-04-01 18:11:59 -0800</bug_when>
    <thetext>After a few email exchanges with Beau Hartshorne, author of the article
JavaScript Events January 18, 2006
http://hartshorne.ca/2006/01/18/javascript_events/
on event properties and browser support and after checking myself in an Internet Cafe with Safari 2.02 (416.13) this page
http://www.gtalbot.org/Shieldhost/DHTMLSection/WindowEventsNS6.html
I am convinced that Safari incorrectly implements event.clientX and event.clientY

Expected results:
event.pageY = event.clientY + [amount scrolled down from top of page]
or, in Safari,
event.pageY = event.clientY + document.body.scrollTop
or
event.pageY = event.clientY + window.pageYOffset
or
event.pageY = event.clientY + window.scrollY

DOM 2 Events defines these event.clientX and clientY as related to the client area, not related to whole document width or to whole document height.

event.clientX :
&quot;The horizontal coordinate at which the event occurred relative to the DOM implementation&apos;s client area.&quot;
http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-MouseEvent-clientX

event.clientY:
&quot;The vertical coordinate at which the event occurred relative to the DOM implementation&apos;s client area.&quot;
http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-MouseEvent-clientY

Right now, there is also an unanimity of implementing event.clientX and event.clientY in Opera 7+, Mozilla 1.x, Seamonkey 1.x, Firefox 1.x and MSIE 6. Only Safari 2.x seems to take the x/y-coordinate of the (whole) document as the event.clientX/Y instead of the x/y-coordinate of the viewing area.

This bug is important to fix so that DHTML applications (relying on measurement, coordinating, positioning, etc.) can work reliably across browsers.

Peter-Paul Koch, at this precise url
http://www.quirksmode.org/dom/w3c_events.html#mousepos
also confirms the erroneous implementation of event.clientX/clientY in Safari: &quot;Safari gives the mouse coordinates relative to the document which it also gives in pageX/Y.&quot;

I set version to 420+ since Beau Hartshorne data indicate that the incorrect implementation still exists in 417 / 420 .

I have searched for duplicates and did not find any. I set Component to JavaScript even though this bug is not a javascript engine bug; there does not seem to be any better component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38241</commentid>
    <comment_count>1</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2006-04-01 18:21:35 -0800</bug_when>
    <thetext>It&apos;s possible that bug 6574 involves the improper implementation of event.clientY; the DHTML code (which uses a not-so-reliable browser detect code) may fork Safari into a code branch where event.clientY is used/queried.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38544</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2006-04-04 14:11:56 -0700</bug_when>
    <thetext>This is a known issue in Safari, confirming.

Thanks for all the great analysis, Gérard!
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46529</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2006-06-21 03:55:40 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; http://www.gtalbot.org/Shieldhost/DHTMLSection/WindowEventsNS6.html

This is now:

http://www.gtalbot.org/DHTMLSection/WindowEventsNS6.html

See also Bug 8707.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46545</commentid>
    <comment_count>4</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2006-06-21 07:16:24 -0700</bug_when>
    <thetext>&gt; This is now:
&gt; http://www.gtalbot.org/DHTMLSection/WindowEventsNS6.html

Thanks for the correction. 

&gt; See also Bug 8707.

In my opinion, bug 8707 is exactly the same as bug 8128.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46930</commentid>
    <comment_count>5</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2006-06-24 03:22:18 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; In my opinion, bug 8707 is exactly the same as bug 8128.

Marking this bug as a duplicate of Bug 8707 per reporter&apos;s comment, and since patches are being supplied to that bug.


*** This bug has been marked as a duplicate of 8707 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>