Index: public/web/WebInputEvent.h |
diff --git a/public/web/WebInputEvent.h b/public/web/WebInputEvent.h |
index 819c62e1928b36c0c834fab1f5666d723e346cdd..cfa6b34756eddf2cede56b600f4b73dc6823da59 100644 |
--- a/public/web/WebInputEvent.h |
+++ b/public/web/WebInputEvent.h |
@@ -361,6 +361,24 @@ public: |
Phase phase; |
Phase momentumPhase; |
+ // See comment at the top of the file for why an int is used here. |
+ // Rubberbanding is an OSX visual effect. When a user scrolls the content |
+ // area with a track pad, and the content area is already at its limit in |
+ // the direction being scrolled, the entire content area is allowed to |
+ // scroll slightly off screen, revealing a grey background. When the user |
+ // lets go, the content area snaps back into place. Blink is responsible |
+ // for this rubberbanding effect, but the embedder may wish to disable |
+ // rubber banding in the left or right direction, if the scroll should have |
+ // an alternate effect. The common case is that a scroll in the left or |
+ // right directions causes a back or forwards navigation, respectively. |
+ // |
+ // These flags prevent rubber banding from starting in a given direction, |
+ // but have no effect on an ongoing rubber banding. A rubber banding that |
+ // started in the vertical direction is allowed to continue in the right |
+ // direction, even if canRubberbandRight is 0. |
+ int canRubberbandLeft; |
+ int canRubberbandRight; |
+ |
WebMouseWheelEvent(unsigned sizeParam = sizeof(WebMouseWheelEvent)) |
: WebMouseEvent(sizeParam) |
, deltaX(0.0f) |
@@ -373,6 +391,8 @@ public: |
, hasPreciseScrollingDeltas(false) |
, phase(PhaseNone) |
, momentumPhase(PhaseNone) |
+ , canRubberbandLeft(true) |
+ , canRubberbandRight(true) |
{ |
} |
}; |