Bug 1429373 - Add a clarifying comment to the declaration of APZCTreeManager::SetTargetAPZC(). r=kats draft
authorBotond Ballo <botond@mozilla.com>
Wed, 17 Jan 2018 18:46:07 -0500
changeset 721855 916c52d44857d93e6046d81c96a9716d32136fb6
parent 719698 2a78b2a40796d5b45659ecfa7628c69ee56a8bc0
child 721856 a6cfd2587ae622133e79a6499ae792851c07e560
child 722796 91b30d27b91deed21fb1321c84e36b434fbf7a1d
child 724281 441d173e486b9be6557916219a849b2f9425d55b
push id95970
push userbballo@mozilla.com
push dateWed, 17 Jan 2018 23:49:14 +0000
reviewerskats
bugs1429373
milestone59.0a1
Bug 1429373 - Add a clarifying comment to the declaration of APZCTreeManager::SetTargetAPZC(). r=kats MozReview-Commit-ID: CT1H5TH3UXn
gfx/layers/apz/src/APZCTreeManager.h
--- a/gfx/layers/apz/src/APZCTreeManager.h
+++ b/gfx/layers/apz/src/APZCTreeManager.h
@@ -261,16 +261,23 @@ public:
    * to confirm the target of the input block. This is only needed in cases
    * where the initial input event of the block hit a dispatch-to-content region
    * but is safe to call for all input blocks. This function should always be
    * invoked on the controller thread.
    * The different elements in the array of targets correspond to the targets
    * for the different touch points. In the case where the touch point has no
    * target, or the target is not a scrollable frame, the target's |mScrollId|
    * should be set to FrameMetrics::NULL_SCROLL_ID.
+   * Note: For mouse events that start a scrollbar drag, both SetTargetAPZC()
+   *       and StartScrollbarDrag() will be called, and the calls may happen
+   *       in either order. That's fine - whichever arrives first will confirm
+   *       the block, and StartScrollbarDrag() will fill in the drag metrics.
+   *       If the block is confirmed before we have drag metrics, some events
+   *       in the drag block may be handled as no-ops until the drag metrics
+   *       arrive.
    */
   void SetTargetAPZC(
       uint64_t aInputBlockId,
       const nsTArray<ScrollableLayerGuid>& aTargets) override;
 
   /**
    * Helper function for SetTargetAPZC when used with single-target events,
    * such as mouse wheel events.