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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>29776</bug_id>
          
          <creation_ts>2016-08-17 12:42:45 +0000</creation_ts>
          <short_desc>Wrong mathematics at element center calculations.</short_desc>
          <delta_ts>2016-08-17 12:42:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Browser Test/Tools WG</product>
          <component>WebDriver</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>20860</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Aleksey">alexchem</reporter>
          <assigned_to name="Browser Testing and Tools WG">public-browser-tools-testing</assigned_to>
          <cc>alexchem</cc>
    
    <cc>mike</cc>
          
          <qa_contact name="Browser Testing and Tools WG">public-browser-tools-testing</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>127150</commentid>
    <comment_count>0</comment_count>
    <who name="Aleksey">alexchem</who>
    <bug_when>2016-08-17 12:42:45 +0000</bug_when>
    <thetext>https://www.w3.org/TR/webdriver/#element-click:

&quot;Let visible width be rect’s bounding rectangle’s (max(x coordinate, x coordinate + width dimension)).

Let visible height be element’s bounding rectangle’s (max(y coordinate, y coordinate + height dimension)).

Let vertical centre offset be (visible width / 2.0).

Let horizontal centre offset be (visible height / 2.0).

Let centre point be a pair of rect’s (rectangle x coordinate + horizontal centre offset) and (rectangle y coordinate + vertical centre offset)&quot;

(Let&apos;s omit the typo with visible height instead of visible width for horizontal center offset).

I don&apos;t understand such a math:

Say, x = 100, width = 5.

x center will be 100 + (100 + 5) / 2 = 152.5.
And it is out of the right rectancle boundary.


I think the x center should be calculated as:

0.5 * (max(0, min(x, x + width)) + min(innerWidth, max(x, x + width)))</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>