<?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>29775</bug_id>
          
          <creation_ts>2016-08-17 12:08:19 +0000</creation_ts>
          <short_desc>Wrong wording in spec, mess in &quot;visible width&quot; vs &quot;visible height&quot;, and copy/paste bugs.</short_desc>
          <delta_ts>2016-08-17 12:44:13 +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>127147</commentid>
    <comment_count>0</comment_count>
    <who name="Aleksey">alexchem</who>
    <bug_when>2016-08-17 12:08:19 +0000</bug_when>
    <thetext>The specification in a few placed contains something like this:

&quot;
Let visible width be element’s bounding rectangle’s (max(x coordinate, x coordinate + width dimension) – the current browsing context’s innerWidth).
&quot;

E.g. here:
https://www.w3.org/TR/webdriver/#element-interactability

Let&apos;s suppose we have rectangle with x = 1, and width = 6,
and viewPort innerWidth is 10.

According to this formula:

visible_width = max(1, 1 + 6) - 10 = -3 (MINUS 3).

And then we have x center point at 1 - 3/2 = -0.5 (MINUS 0.5 which is out of the element boundaries).

Maybe there should be such a wording:
&quot;
Let visible width be element’s bounding rectangle’s (min(max(x coordinate, x coordinate + width dimension), the current browsing context’s innerWidth)).
&quot;

================

Also there are everywhere mess between visible width and height, like this:

&quot;
Let vertical centre offset be (visible width / 2.0). // height and not width must be here

Let horizontal centre offset be (visible height / 2.0). // width and not height must be here.

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

================

Also there is copy/paste bugs. Like: &quot;
Let visible width be element’s bounding rectangle’s (max(x coordinate, x coordinate + width dimension) – the current browsing context’s innerWidth).

Let visible height be element’s bounding rectangle’s (max(y coordinate, y coordinate + height dimension) – the current browsing context’s innerWidth).
&quot;

The second sentence contains innerWidth again instead of innerHeight.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127151</commentid>
    <comment_count>1</comment_count>
    <who name="Aleksey">alexchem</who>
    <bug_when>2016-08-17 12:44:13 +0000</bug_when>
    <thetext>More exactly 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>