Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mattzeunert committed Dec 7, 2018
1 parent 3d1097a commit 10c0e9f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lighthouse-core/lib/tappable-rects.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const {
/**
* Merge client rects together and remove small ones. This may result in a larger overall
* size than that of the individual client rects.
* We use this to simulate a finger tap on those targets later on.
* @param {LH.Artifacts.Rect[]} clientRects
*/
function getTappableRectsFromClientRects(clientRects) {
Expand All @@ -39,6 +40,7 @@ function almostEqual(a, b) {
}

/**
* Merge touching rects based on what appears as one tappable area to the user.
* @param {LH.Artifacts.Rect[]} clientRects
* @returns {LH.Artifacts.Rect[]}
*/
Expand All @@ -49,6 +51,8 @@ function mergeTouchingClientRects(clientRects) {
const crB = clientRects[j];

/**
* We try to determine whether the rects appear as a single tappable
* area to the user, so that they'd tap in the middle of the merged rect.
* Examples of what we want to merge:
*
* AAABBB
Expand Down

0 comments on commit 10c0e9f

Please sign in to comment.