Bug 1249201 Part 1 - Add "scroll" reason to CaretStateChangedEvent. draft
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 21 Apr 2016 16:43:11 +0800
changeset 354567 31145aa24085fcb3ff2c06cb285c88585b686144
parent 354226 f05a1242fb29023bd7ebc492897ed3d6907733c7
child 354568 591cdca7893ac6477a9d40791ec07ec87fbaafd1
child 354569 e737432838d7423faef7783fcc75b86fc69e6b46
push id16123
push usertlin@mozilla.com
push dateThu, 21 Apr 2016 08:46:39 +0000
bugs1249201
milestone48.0a1
Bug 1249201 Part 1 - Add "scroll" reason to CaretStateChangedEvent. When the carets are scrolled by APZ, they will hide and dispatch a "visibilitychange" reason. The floating toolbar (ActionBarHandler.js) on Android listens to the event to update its visibility. Now we want to show carets continuously when scrolling the page, so it make no sense to dispatch a "visibilitychange" reason. However we still need to notify the toolbar that the carets are scrolling by apz. Therefore, we need a this new "scroll" reason. It will be dispatch in AccessibleCaretManager::OnScrollStart() in Part 2. MozReview-Commit-ID: F9znxHV3xCZ
dom/webidl/CaretStateChangedEvent.webidl
--- a/dom/webidl/CaretStateChangedEvent.webidl
+++ b/dom/webidl/CaretStateChangedEvent.webidl
@@ -5,17 +5,18 @@
  */
 
 enum CaretChangedReason {
   "visibilitychange",
   "updateposition",
   "longpressonemptycontent",
   "taponcaret",
   "presscaret",
-  "releasecaret"
+  "releasecaret",
+  "scroll"
 };
 
 dictionary CaretStateChangedEventInit : EventInit {
   boolean collapsed = true;
   DOMRectReadOnly? boundingClientRect = null;
   CaretChangedReason reason = "visibilitychange";
   boolean caretVisible = false;
   boolean caretVisuallyVisible = false;