Граф коммитов

47 Коммитов

Автор SHA1 Сообщение Дата
Kartikaya Gupta 5a688fe072 Bug 1304263 - On Windows, fire the eMouseLongTap event as soon as APZ detects the long-press. r=TYLin
On Windows, the contextmenu event is fired when the finger is lifted after a
long-press. However, there are various bits of code, such as the AccessibleCaret
or potential fixes for bug 1147335, which would benefit from knowing when the
long-press gesture was detected. By moving eMouseLongTap event up we can satisfy
that need. An alternative approach considered was to fire the eMouseLongTap
before the contextmenu on all platforms unconditionally, but that makes it harder
to implement platform-specific text selection behaviour the way we want. In
particular we would have to add an extra message or notification for non-Windows
platforms that initiated text selection if the contextmenu event was not
consumed.

MozReview-Commit-ID: 2lmwxmmGrVD
2016-10-04 09:31:15 -04:00
Kartikaya Gupta 8b51259dcd Bug 1293483 - Keep the carets hidden when the user is using a mouse to modify the selection. r=TYLin
MozReview-Commit-ID: FJwODLk6XMS
2016-10-03 08:57:44 -04:00
Ting-Yu Lin 3b594c3216 Bug 1298704 - Use flag to avoid calling AccessibleCaretEventHub::Reflow() recursively. r=mats
MozReview-Commit-ID: Jkf7sSqxG2d

--HG--
extra : rebase_source : f606f09e9fe88bde39f73690771cdde091f1b8c8
2016-08-29 15:36:45 +08:00
Ting-Yu Lin 1ef637a036 Bug 1292904 Part 3 - Use only caret image for touch area if event is a mouse type. r=mtseng
That is, exclude the text overlay to fix the double clicking and triple
clicking on a word in editable text area.

MozReview-Commit-ID: 5bELcNSRo2A

--HG--
extra : rebase_source : 4664e186b13b3170022c0fe294f580cd15650271
2016-08-14 21:39:30 +08:00
Kartikaya Gupta ea0f7627b9 Bug 1195722 - On desktop, allow the context menu to pop up concurrently with text selection. r=tylin
On desktop, the context menu is shown when the user lifts their finger after
a long press, but only if the eMouseLongTap event is not cancelled. So by
not cancelling it, we allow both the text selection and the context menu.

On Android, the context menu takes priority over text selection, so this
has no effect (i.e. if the context menu is shown, then the AccessibleCaret
code never even gets the eMouseLongTap event). Also on Android nothing
else relies on the cancellation of the eMouseLongTap event, so this change
is a no-op.

MozReview-Commit-ID: peFzB2afha
2016-08-03 12:00:19 -04:00
Kartikaya Gupta e0f363fe61 Bug 1255555 - When a frame reconstruction triggers caret elements to be cloned, ensure the dummy touch listeners are re-registered on the clones. r=tylin
MozReview-Commit-ID: 8txWmd64LC9
2016-07-11 08:16:39 -04:00
Masayuki Nakano cbe8f5268a Bug 1259656 part.1 Rename WidgetEvent::refPoint to WidgetEvent::mRefPoint r=smaug
MozReview-Commit-ID: ESWM5ZyBpSR

--HG--
extra : rebase_source : c5e1e3f60bcdde2a7f6c399e72430b29a3e552cd
2016-04-18 23:09:02 +09:00
Masayuki Nakano 57445d0047 Bug 1259668 Rename WidgetTouchEvent::touches to WidgetTouchEvent::mTouches r=smaug
MozReview-Commit-ID: FLbows8davI

--HG--
extra : rebase_source : b564d09aa76311793a78d80b6c78c91e232edc47
2016-03-30 18:44:28 +09:00
Ting-Yu Lin a423fc51d3 Bug 1251915 - Ignore handling eTouchCancel events. r=roc
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
2016-02-29 15:51:44 +08:00
Ting-Yu Lin 5b6692bd2c Bug 1251915 - Correct AccessibleCaretEventHub coding style by clang-format. r=roc
This patch is generatedy by applying clang-format on
AccessibleCaretEventHub.cpp.

MozReview-Commit-ID: 10qPJ47CVMH

--HG--
extra : rebase_source : ff39be696ef4cd93ffbe0b9e7c95920aa03a6893
2016-02-29 15:51:44 +08:00
Ting-Yu Lin 883cfca3eb Bug 1250560 - Fix crash in HandleTouchEvent. r=roc
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
2016-02-28 23:16:45 +08:00
Ting-Yu Lin 52bb178c2f Bug 1248847 - Assert AccessibleCaretEventHub mRefCnt > 1 in all its entry points. r=mats
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
2016-02-19 18:21:16 +08:00
Carsten "Tomcat" Book 1fec837eb9 Backed out changeset a27cd3e26cc1 (bug 1248847) for bustage 2016-02-19 09:38:59 +01:00
Ting-Yu Lin 4a4798d88b Bug 1248847 - Assert AccessibleCaretEventHub mRefCnt > 1 in all its entry points. r=mats
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
2016-02-18 18:38:44 +08:00
Ting-Yu Lin 9410058023 Bug 1246918 - Handle PresShell gone after FlushLayout(). r=roc
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
2016-02-15 15:12:35 +08:00
Carsten "Tomcat" Book 8cbc76d2fd Backed out changeset 10e71da98b14 (bug 1246918) 2016-02-17 14:34:49 +01:00
Ting-Yu Lin 585b41e8b5 Bug 1246918 - Handle PresShell gone after FlushLayout(). r=roc
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
2016-02-15 15:12:35 +08:00
Ting-Yu Lin 07b84af1aa Bug 1246477 - Fix carets not updated by scroll events in LongTapState. r=roc
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
2016-02-08 16:08:45 +08:00
Ting-Yu Lin 79a0b3623c Bug 1121468 - Go to NoActionState after receiving release on LongTapState. r=roc
This makes the state change match the user action. No functionality
changes is expected.

--HG--
extra : commitid : 4MyRasp0lRE
extra : rebase_source : 611819cb3419ffdf76a002d937f3541dc285ef4d
2016-01-25 15:50:28 +08:00
Ting-Yu Lin f7bd8d83d9 Bug 1121468 - Use auto* to explicit declare 'self' as a pointer. r=roc
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
2016-01-25 15:50:28 +08:00
Tooru Fujisawa 4fac62d240 Bug 382721 - Part 0: Add missing includes and namespaces. r=jrmuizel 2015-09-10 19:24:34 +09:00
Ting-Yu Lin 3d15f9d1ae Bug 1206545 - Store nsIPresShell pointer in constructor instead of Init(). r=roc
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
2015-11-16 18:16:43 +08:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
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
2015-10-18 01:24:48 -04:00
Ting-Yu Lin 1a9cfec14b Bug 1211365 - Delete wheel event handling. r=mtseng
All desktop platforms support APZ now. eWheelOperationStart and
eWheelOperationEnd are superseded by AsyncPanZoomStarted and
AsyncPanZoomStopped respectively.

--HG--
extra : commitid : 7jsXCgpWZ7U
extra : rebase_source : 744d17707220ee602a4607239e7bb0d642839da6
2015-10-05 16:52:29 +08:00
Ting-Yu Lin 2c11c71f3b Bug 1211365 - Remove NS_IMPL_STATE_UTILITIES. r=mtseng
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
2015-10-05 16:52:29 +08:00
Ting-Yu Lin d7357db411 Bug 1210315 - Use preference to control whether to use long tap injector. r=roc
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
2015-10-02 23:10:29 +08:00
Masayuki Nakano 683794135c Bug 895274 part.244 Rename NS_TOUCH_CANCEL to eTouchCancel r=smaug 2015-09-15 00:14:35 +09:00
Masayuki Nakano 51d7268995 Bug 895274 part.243 Rename NS_TOUCH_END to eTouchEnd r=smaug 2015-09-15 00:14:35 +09:00
Masayuki Nakano 52a7afe36c Bug 895274 part.242 Rename NS_TOUCH_MOVE to eTouchMove r=smaug 2015-09-15 00:14:35 +09:00
Masayuki Nakano 7a48a6f2ab Bug 895274 part.241 Rename NS_TOUCH_START to eTouchStart r=smaug 2015-09-15 00:14:34 +09:00
Masayuki Nakano 94be7ec146 Bug 895274 part.186 Rename NS_WHEEL_END to eWheelOperationEnd r=smaug 2015-09-11 01:59:55 +09:00
Masayuki Nakano 5dac954442 Bug 895274 part.185 Rename NS_WHEEL_START to eWheelOperationStart r=smaug 2015-09-11 01:59:55 +09:00
Masayuki Nakano 6b885d1496 Bug 895274 part.184 Rename NS_WHEEL_WHEEL to eWheel r=smaug 2015-09-11 01:59:54 +09:00
Ting-Yu Lin 8d952a059e Bug 1200194 - Remove unneeded AccessibleCaretManager::OnScrolling(). r=roc
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
2015-09-09 16:47:21 +08:00
Ting-Yu Lin d8ee309227 Bug 1200194 - Tweak formatting and debug logging. r=roc
No logic change is involved.

--HG--
extra : commitid : KCG4QMsPhdY
extra : rebase_source : 2dc984fe27992b95e51f9bc1c5af52fcafc57844
2015-09-09 16:47:20 +08:00
Masayuki Nakano 83f18479ed Bug 895274 part.38 Rename NS_MOUSE_MOZLONGTAP to eMouseLongTap r=smaug 2015-08-29 08:58:33 +09:00
Masayuki Nakano db00b74a82 Bug 895274 part.27 Rename NS_MOUSE_BUTTON_DOWN to eMouseDown r=smaug 2015-08-29 08:58:30 +09:00
Masayuki Nakano 30fdd39afb Bug 895274 part.26 Rename NS_MOUSE_BUTTON_UP to eMouseUp r=smaug 2015-08-29 08:58:30 +09:00
Masayuki Nakano 717c415187 Bug 895274 part.25 Rename NS_MOUSE_MOVE to eMouseMove r=smaug 2015-08-29 08:58:29 +09:00
Masayuki Nakano ba5b3f3fe6 Bug 895274 part.11 Rename NS_KEY_DOWN to eKeyDown r=smaug 2015-08-29 08:58:27 +09:00
Masayuki Nakano 28c9f34179 Bug 895274 part.10 Rename NS_KEY_UP to eKeyUp r=smaug 2015-08-29 08:58:27 +09:00
Masayuki Nakano d311a11cc1 Bug 895274 part.9 Rename NS_KEY_PRESS to eKeyPress r=smaug 2015-08-29 08:58:27 +09:00
Masayuki Nakano 66f2c27305 Bug 895274 part.1 Rename WidgetEvent::message to WidgetEvent::mMessage r=smaug 2015-08-22 10:34:51 +09:00
Ting-Yu Lin 6bbb4e6fcd Bug 1189353 - Change NS_ macro prefix to MOZ_ in AccessibleCaretEventHub. r=mtseng 2015-07-30 08:07:00 -04:00
David Anderson b2eb29a9c5 Use widgets for APZ checks, rather than gfxPrefs. (bug 1162064, r=kats,mstange) 2015-06-04 16:51:10 -04:00
Eric Rahm 682623740c Bug 1164620 - Part 1: Remove instances of #ifdef PR_LOGGING in various places. r=froydnj
PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
2015-05-14 10:13:24 -07:00
Ting-Yu Lin 30e280820a Bug 1110039 - Part 2.4 - Add AccessibleCaretEventHub. r=roc
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().
2015-05-03 23:37:00 +02:00