In my original design, I treat eTouchCancel to be like eTouchEnd for
ending a caret dragging procedure.
However when pointer events is enabled, it sents an eTouchCancel event
after the eTouchStart event whose primary usage is to be converted to
pointer events, which then cancels the normal caret dragging procedure.
Moreover, when pointer events is disabled, we don't get eTouchCancel
during a normal caret dragging scenario, so we don't really need to
handle eTouchCancel anyway.
MozReview-Commit-ID: GKju2Tp0q3Q
--HG--
extra : rebase_source : 31da189fc5543c7df0d748df004fc67c87f4da7f
This patch is generatedy by applying clang-format on
AccessibleCaretEventHub.cpp.
MozReview-Commit-ID: 10qPJ47CVMH
--HG--
extra : rebase_source : ff39be696ef4cd93ffbe0b9e7c95920aa03a6893
When enabling "dom.w3c_pointer_events.enabled", we might get a
eTouchCancel event without any touch data. That is, aEvent->touches is
an empty array. We need to make sure it's non-empty before accessing
aEvent->touches[0].
MozReview-Commit-ID: BQUsrJjHHEl
--HG--
extra : rebase_source : d5f435792ecc0cac79937121fa03ce6f22c59582
Also I removed the 'explicit' keywords from the constructor since they have no
argument so nothing can be implicited converted to them.
MozReview-Commit-ID: GrFcqO0Uf1o
--HG--
extra : rebase_source : 5994787b7feccf409db1faf6359676b5170ea203
extra : source : a27cd3e26cc146006db501efb86b54b097f28b57
Also I removed the 'explicit' keywords from the constructor since they have no
argument so nothing can be implicited converted to them.
MozReview-Commit-ID: GrFcqO0Uf1o
--HG--
extra : rebase_source : c4747c5e3ea09ddfc08bfc1b0c8e4bcedb1d75ce
extra : amend_source : 6289aaff79b22956b72956734e4d99bdd3b7977d
After calling FlushLayout(), PresShell::Destroy() might be called and we
should consider PresShell and other resources will be no longer valid.
Before this patch, AccessibleCaretManager and AccessibleCaret(s) are
deallocated in PresShell::Destroy(). However FlushLayout() are all
invoked in AccessibleCaretManager, we need to keep manager alive to
clean up after PresShell::Destroy().
This patch makes AccessibleCaretManager live after PresShell::Destroy(),
and use IsTerminated() to check whether PreShell is vaild after each
FlushLayout() calls.
Note that event though AccessibleCaretEventHub will be unref in
PresShell::Destroy(), all the callers to AccessibleCaretEventHub's
public methods already add a ref to AccessibleCaretEventHub. So we don't
need to worry about AccessibleCaretEventHub and AccessibleCaretManager
die immediately after PresShell::Destroy().
MozReview-Commit-ID: DDpXZ7v3zyo
--HG--
extra : rebase_source : 280e2512fb9f28d933f5b8d65a9f303ac81c58e5
extra : source : 10e71da98b144fbf42aaa81a1056910a3766a6cb
After calling FlushLayout(), PresShell::Destroy() might be called and we
should consider PresShell and other resources will be no longer valid.
Before this patch, AccessibleCaretManager and AccessibleCaret(s) are
deallocated in PresShell::Destroy(). However FlushLayout() are all
invoked in AccessibleCaretManager, we need to keep manager alive to
clean up after PresShell::Destroy().
This patch makes AccessibleCaretManager live after PresShell::Destroy(),
and use IsTerminated() to check whether PreShell is vaild after each
FlushLayout() calls.
Note that event though AccessibleCaretEventHub will be unref in
PresShell::Destroy(), all the callers to AccessibleCaretEventHub's
public methods already add a ref to AccessibleCaretEventHub. So we don't
need to worry about AccessibleCaretEventHub and AccessibleCaretManager
die immediately after PresShell::Destroy().
MozReview-Commit-ID: DDpXZ7v3zyo
--HG--
extra : rebase_source : 2698f0313e394b64ff8caacf21493c874510a7ce
This is a regression by "Bug 1121468 - Go to NoActionState after
receiving release on LongTapState."
When receiving a scroll event in LongTapState, i.e. apz starts, we
should call OnScrollStart() and move to the ScrollState.
--HG--
extra : commitid : GsQNnTtqhzh
extra : rebase_source : 0a6ad44a4bf97ed15b374094929df5409deeba41
This makes the state change match the user action. No functionality
changes is expected.
--HG--
extra : commitid : 4MyRasp0lRE
extra : rebase_source : 611819cb3419ffdf76a002d937f3541dc285ef4d
Both 'auto' and 'auto*' do not change the type inference. However, auto*
make 'self' only accept a pointer which is our intent here.
--HG--
extra : commitid : IvzkNKYE1Q4
extra : rebase_source : 7ea447ff8dae04751afe5ab3e5c84231a5fb8649
When constructing AccessibleCaretEventHub, bypass and store the
nsIPresShell pointer. This is a preparation for later patches.
Also, remove 'virtual' for Init() and Terminate() since the mock object
in gtest does not need to override them.
--HG--
extra : commitid : 4D5733d5Xr8
extra : rebase_source : ff934904a6144a3408746574a5534ab44731192d
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout. The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.
CLOSED TREE makes big refactorings like this a piece of cake.
# The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
xargs perl -p -i -e '
s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
s/nsRefPtr ?</RefPtr</g; # handle declarations and variables
'
# Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h
# Handle nsRefPtr.h itself, a couple places that define constructors
# from nsRefPtr, and code generators specially. We do this here, rather
# than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
# things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
mfbt/nsRefPtr.h \
xpcom/glue/nsCOMPtr.h \
xpcom/base/OwningNonNull.h \
ipc/ipdl/ipdl/lower.py \
ipc/ipdl/ipdl/builtin.py \
dom/bindings/Codegen.py \
python/lldbutils/lldbutils/utils.py
# In our indiscriminate substitution above, we renamed
# nsRefPtrGetterAddRefs, the class behind getter_AddRefs. Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'
if [ -d .git ]; then
git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
All desktop platforms support APZ now. eWheelOperationStart and
eWheelOperationEnd are superseded by AsyncPanZoomStarted and
AsyncPanZoomStopped respectively.
--HG--
extra : commitid : 7jsXCgpWZ7U
extra : rebase_source : 744d17707220ee602a4607239e7bb0d642839da6
This macro was used to implement Name() and Singleton() for state
classes. Instead of enforcing the state class to be a singleton, we can
implement singleton pattern in MOZ_IMPL_STATE_CLASS_GETTER directly.
--HG--
extra : commitid : 7jsXCgpWZ7U
extra : rebase_source : f03530931e3d27e7532022c9c11b834ccea9fc0e
In AccessibleCaretEventHub, it is not accurate to use APZ enabled to
determine whether to use long tap injector. On desktop browser, there's
no long tap events even if APZ is enabled. We should use a preference to
control that.
Since it's a fact the APZ on b2g has long tap events, we should use
preference to disable long tap injector so that when long tap events
stop dispatching to AccessibleCaretEventHub, we'll know immediately.
Delete SetUseAsyncPanZoom() usage in gtest since APZ is not related to
scrolling in AccessibleCaretEventHub.
--HG--
extra : commitid : KgAxEFNYaeb
extra : rebase_source : 1f0eb87354be8d97f946ea2b1f2a5425521bcf12
This functions is for hiding caret in cursor mode on desktop browser
when receiving NS_WHEEL_WHEEL, which is never used on B2G in production.
On desktop browser, a proper wheel scroll cycle begins by NS_WHEEL_START
and ends by NS_WHEEL_STOP, which was covered by gtest. Move the three
marionette test for TouchCaret only.
--HG--
extra : commitid : KCG4QMsPhdY
extra : rebase_source : b33ca79699cfffe33da1890aed10935fa7565e1c
See AccessibleCaretEventHub.h for the class description.
Both TouchCaret and SelectionCarets have their event handling mechanism,
which lead to a lot of code duplication. Now AccessibleCaretEventHub
serves as the single entry point for all events and callbacks.
We also encountered performance issues in SelectionCarets because many
unnecessary events might be dispatched to Gaia driven by the selection
changed events. SelectionCarets did not have clear internal states to
avoid this. To solve it, AccessibleCaretEventHub implements state
classes, and rely on the current states to call the CopyPasteManager's
handler only when it's needed.
For example, when dragging a caret, we do not interest in
NotifySelectionChanged() for updating the carets. Since we've known a
caret is being dragging, we can call UpdateCarets() directly. Hence
DragCaretState does not override OnSelectionChanged().