From e66f3b2b220554ee41c34a44fc4dcff6d2949e17 Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Thu, 18 Oct 2018 15:17:54 -0500 Subject: [PATCH 1/6] in-view center point: drop unnecessary grouping The outer groups are a distraction. --- index.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 91770c8e1..793646bbc 100644 --- a/index.html +++ b/index.html @@ -4501,26 +4501,26 @@

Element Interactability

returned by calling getClientRects on element.
  • Let left be - (max(0, min(x coordinate, - x coordinate + width dimension))). + max(0, min(x coordinate, + x coordinate + width dimension)).

  • Let right be - (min(innerWidth, + min(innerWidth, max(x coordinate, - x coordinate + width dimension))). + x coordinate + width dimension)).

  • Let top be - (max(0, min(y coordinate, - y coordinate + height dimension))). + max(0, min(y coordinate, + y coordinate + height dimension)).

  • Let bottom be - (min(innerHeight, + min(innerHeight, max(y coordinate, - y coordinate + height dimension))). + y coordinate + height dimension)). -

  • Let x be (0.5 × (left + right)). +

  • Let x be 0.5 × (left + right). -

  • Let y be (0.5 × (top + bottom)). +

  • Let y be 0.5 × (top + bottom).

  • Return x and y as a pair. From 5870628321cb50a65145b80e5f89353cdaaaf6d8 Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Thu, 18 Oct 2018 15:19:37 -0500 Subject: [PATCH 2/6] in-view center point: divide by 2.0 instead of multiply It's misleading to use multiplication by 0.5 since you wouldn't implement the in-view center point like this. Instead divide by 2.0, which makes it clear that we expect the result to be a floating point. --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 793646bbc..89d77d8a8 100644 --- a/index.html +++ b/index.html @@ -4518,9 +4518,9 @@

    Element Interactability

    max(y coordinate, y coordinate + height dimension)). -
  • Let x be 0.5 × (left + right). +

  • Let x be (left + right) ÷ 2.0. -

  • Let y be 0.5 × (top + bottom). +

  • Let y be (top + bottom) ÷ 2.0.

  • Return x and y as a pair. From a9f876d1c9e857e5f061da8bc5e6b5072449bf93 Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Thu, 18 Oct 2018 15:43:52 -0500 Subject: [PATCH 3/6] terminology: define division --- index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 89d77d8a8..c7f1ec73a 100644 --- a/index.html +++ b/index.html @@ -708,11 +708,13 @@

    Extensions

    Terminology

    -

    In equations, all numbers are integers, - addition is represented by “+”, - subtraction is represented by “−”, - and bitwise OR by “|”. - The characters “(” and “)” are used to provide logical grouping in these contexts. +

    +In equations, all numbers are integers, +addition is represented by “+”, +subtraction by “−”, +division by “÷”, +and bitwise OR by “|”. +The characters “(” and “)” are used to provide logical grouping in these contexts.

    The shorthand min(value, value[, value]) From 07cb9d7ccd0425cc9c0f8ee0b428f90237b9aa06 Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Thu, 18 Oct 2018 15:44:21 -0500 Subject: [PATCH 4/6] terminology: describe min/max as functions, not shorthands --- index.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index c7f1ec73a..f81aa160a 100644 --- a/index.html +++ b/index.html @@ -716,12 +716,14 @@

    Terminology

    and bitwise OR by “|”. The characters “(” and “)” are used to provide logical grouping in these contexts. -

    The shorthand - min(value, value[, value]) - returns the smallest item of two or more values. - Conversely, the shorthand - max(value, value[, value]) - returns the largest item of two or more values. +

    +The mathematical function +min(value, value[, value]) +returns the smallest item of two or more values. +Conversely, the function +max(value, value[, value]) +returns the largest item of two or more values. +

    A Universally Unique IDentifier (UUID) is a 128 bits long URN that requires no central registration process. [[!RFC4122]]. From 76746318b5913ccdb414f8dc4a99ee1e0e4acb0f Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Thu, 18 Oct 2018 15:44:37 -0500 Subject: [PATCH 5/6] terminology: define mathematical function floor() --- index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.html b/index.html index f81aa160a..52c5ba0b1 100644 --- a/index.html +++ b/index.html @@ -724,6 +724,10 @@

    Terminology

    max(value, value[, value]) returns the largest item of two or more values. +

    +The mathematical function floor(value) +produces the largest integer, closest to positive infinity, +that is not larger than value.

    A Universally Unique IDentifier (UUID) is a 128 bits long URN that requires no central registration process. [[!RFC4122]]. From 2467630e4ddbe35d586506a219ccd2ec46f6d743 Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Thu, 18 Oct 2018 15:46:55 -0500 Subject: [PATCH 6/6] in-view center point: floor coordinates Calculating the centre point of a square may produce a decimal precision number. Given a 1x1 px square the center point will be (0.5,0.5), but the DOM operates in integer CSS pixels. Rounding the number would get us the closest positive integer, or 1. However, the coordinate (1,1) is beyond the bounding box of the square. This means we need to floor the number to ensure we always get a click point that is within the client rect of the element. An additional complexity is that not all web platform APIs treat floating point numbers the same way. DOMElement.elementsFromPoint, which we use for getting the paint tree to determine if the web element is interactable, will floor the number which deems the element interactable. However, in Gecko, nsIDOMUtils.sendMouseEvent ceils the number, causing the actual click point to fall beyond the square. --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 52c5ba0b1..09dfb57ad 100644 --- a/index.html +++ b/index.html @@ -4526,11 +4526,11 @@

    Element Interactability

    max(y coordinate, y coordinate + height dimension)). -
  • Let x be (left + right) ÷ 2.0. +

  • Let x be floor((left + right) ÷ 2.0). -

  • Let y be (top + bottom) ÷ 2.0. +

  • Let y be floor((top + bottom) ÷ 2.0). -

  • Return x and y as a pair. +

  • Return the pair of (x, y).

    An element is in view