Override OnScrollPositionChanged() in ScrollState because we want to update
carets during scrolling in subframes without APZ.
Due to the observation in bug 1273045 comment 8, we do not distinguish
PositionChangedResult::NotChanged and PositionChangedResult::Changed.
Instead, we always update caret even if its position is not changed.
To avoid excessive CaretStateChangedEvents are dispatched in
OnScrollPositionChanged(), we add IsScrollStarted to distinguish whether
OnScrollStart() is called or not.
MozReview-Commit-ID: KNi9Mct4dSk
--HG--
extra : rebase_source : 61d29fb0e1b6b91971217d3f45a791c456fa4f07
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
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
This removes the unnecessary setting of c-basic-offset from all
python-mode files.
This was automatically generated using
perl -pi -e 's/; *c-basic-offset: *[0-9]+//'
... on the affected files.
The bulk of these files are moz.build files but there a few others as
well.
MozReview-Commit-ID: 2pPf3DEiZqx
--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
Add a pref "layout.accessiblecaret.always_show_when_scrolling" defaults
to true on all platforms except b2g. When it is set to false, the carets
will be hidden during scrolling, which is the current behavior before
applying this change.
The pref "layout.accessiblecaret.extendedvisibility" was added for
Fennec to keep ActionBar open when carets temporarily hiding during
panning or zooming. Now we make carets always show by default, so the
pref can be removed. However, the floating toolbar still need to be
notified when the scrolling begins, so we dispatch "scroll" instead.
In gtest, the preference changes were in the middle of the test
function. To make the preference change clearer, I add new pref changes
or move the existing ones to the beginning of the test functions.
The 250ms transition effect added in ua.css is per request of UX
designer in bug 1249201 comment 12.
MozReview-Commit-ID: 8NGvDLPbtNY
--HG--
extra : rebase_source : 3f7a9ebdf4c70b0282dbf9e8f18cbe5cca656dbe
This is to support Firefox Android L style carets assets that the two
carets always look like tilt.
This patch is derived from a WIP patch by Mark Capella
<markcapella@twcny.rr.com>
MozReview-Commit-ID: H3nKLz6HcpM
--HG--
extra : rebase_source : b3a77b0bb8aaea8f010002f54fde075c9d469711
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
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
Fennec enables sCaretsExtendedVisibility which uses
Appearance::NormalNotShown instead of Appearance::None to keep actionbar
shown during scrolling. This breaks selection mode update when the
positions of the carets are not changed after scrolling.
To fix this, we need to implement appearance recovering for selection
mode scrolling like we did for cursor mode in bug 1212732, and make
UpdateCaretsForSelectionMode() respects UpdateCaretsHint.
MozReview-Commit-ID: LkfUIGKHL0h
--HG--
extra : rebase_source : 0ef8d28ce55c3ddd29ea32ee6888ee7fe14c34ad
extra : source : bc3e37b63defca87d0de165fe167ef7f8a7db651
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
Fennec enables sCaretsExtendedVisibility which uses
Appearance::NormalNotShown instead of Appearance::None to keep actionbar
shown during scrolling. This breaks selection mode update when the
positions of the carets are not changed after scrolling.
To fix this, we need to implement appearance recovering for selection
mode scrolling like we did for cursor mode in bug 1212732, and make
UpdateCaretsForSelectionMode() respects UpdateCaretsHint.
MozReview-Commit-ID: LkfUIGKHL0h
--HG--
extra : rebase_source : 2e68786e09046967f7c6af16fa6b393f133dc12c
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
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
Currently, the caret in cursor mode is always hide after scrolling. I
think it's better to restore its appearance if it's logically visible
before scrolling. That is:
1) If the caret is logically visible (Normal or NormalNotShown) before
scrolling, update carets on scroll-end to show the caret again.
2) If the caret is hide due to timeout or blur, it should remain hidden
on scroll-end.
--HG--
extra : transplant_source : %40%2C%95%CB%EDzt%FB%F0CpK%C94TN2%27%2A%A3
All desktop platforms support APZ now. eWheelOperationStart and
eWheelOperationEnd are superseded by AsyncPanZoomStarted and
AsyncPanZoomStopped respectively.
--HG--
extra : commitid : 7jsXCgpWZ7U
extra : rebase_source : 744d17707220ee602a4607239e7bb0d642839da6
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
After HideCaret() is called via keyboard event,
OnScrollPositionChanged() still fire another CaretStateChanged event
even if the caret is hidden. We follow OnReflow() to update carets only
when carets are logically visible.
A test case:
1. Type a string on the rocketbar until the text is long enough to scroll.
2. Copy arbitrary string.
3. Tap on rocketbar to show caret, and move it to the end (within 15
seconds timeout)
4. Type a character.
The text selection dialog should not show.
--HG--
extra : transplant_source : %CB%AE%D4%3D%9A%E8vp%E9%90%5C%3Cl%0Ar%19%A2E%2B%B8
We should dispatch CaretStateChanged event in OnReflow() in cursor mode
when the first caret's appearance is NormalNotShown. Otherwise the text
selection dialog won't update its position.
--HG--
extra : transplant_source : TP%06%82Q%E9%A2%11C7%10H%B0B%EA%80%1D%21%2A%CF
SelectionCaret had been hiding carets upon receiving mouse down reason.
In this way, text selection dialog won't show, hide, and show again.
--HG--
extra : transplant_source : %EE%0C%C5%25%E9%00%F4%3D%3C%96%13%D0o%23R%AA%D5x%E5%29
I now think that mLastUpdateCaretMode is an implementation detail. Test
it will make test and implementation coupled.
It's better to call EXPECT_EQ directly in test functions so that the
line number in test result will be accurate when things go wrong.
--HG--
extra : transplant_source : %1C%CF%CF%9B%06%92x%0E%19%F6%B7%82%B1%B7%B3uS%5CA%DF
Add basic gtest to ensure AccessibleCaret and AccessibleCaretManager are
both testable. More tests to come.
Allow -Winconsistent-missing-override warning in gtest since MOCK_METHOD
does not have 'override' keyword. See bug 1169974.
--HG--
extra : commitid : 38ZTtolb0X9
extra : rebase_source : 52b93d89dddc3913dc3acab1f60971f80c009346
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
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973