Commit Graph

39 Commits

Author SHA1 Message Date
Tooru Fujisawa
4fac62d240 Bug 382721 - Part 0: Add missing includes and namespaces. r=jrmuizel 2015-09-10 19:24:34 +09:00
Nicholas Nethercote
3ba02d7a9b Bug 1232852 (part 3) - Remove unused parameters from some accessibility code. r=tbsaunde.
--HG--
extra : rebase_source : 7cdef8244e2b44b89e8061f66d45d40cbf245041
2015-12-15 21:24:06 -08:00
Ting-Yu Lin
ac9fa26bf1 Bug 1230582 - Always show caret even if input is empty on Fennec. f=capella, r=roc
--HG--
extra : commitid : Jy7HHc69qxH
2015-12-21 01:01:00 +08:00
Mark Capella
967e3dc2bd Bug 1230613 - Long-press to trigger text selection should vibrate, r=snorp 2015-12-10 18:57:02 -05:00
Mark Capella
e7b070ed41 Bug 1215959 - (GeckoCaret2) Upgrade Core and AccessibleCaret, r=smaug 2015-12-01 15:25:06 -05:00
Ting-Yu Lin
73f517c471 Bug 1082425 - Commit composition string before changing focus by long tap. r=masayuki
This also prevents that long tapping to select word while composing
corrupts the editable data on B2G.

--HG--
extra : commitid : BtrZDqpPayU
2015-11-25 05:16:00 +08:00
Jeremy Chen
da993aa4f9 Bug 1216857 - Notify selection dialog to update its position if carets are logically visible. r=TYLin
--HG--
extra : transplant_source : %98%40%E8%A6%85%D2%1A%2C%ED%CF%A0/N%E4WW%19%E6J%92
2015-10-23 10:21:16 +08:00
Nathan Froyd
055e2365e3 Bug 1217939 - part 2 - move nsContentUtils::GetSelectionBoundingRect to nsLayoutUtils; r=smaug
All callers of this function are in layout/base/ and it uses a lot of
things from nsLayoutUtils, so nsLayoutUtils seems like a better fit for
it.
2015-10-23 13:39:00 -04: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
05c6b15904 Bug 1212732 - Update caret in cursor mode on scroll-end if it was logically visible. r=roc
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
2015-10-08 15:18:03 +08:00
Ting-Yu Lin
23e9bd9f77 Bug 1200364 - Fix AccessibleCaret jumps when dragging. r=roc
TouchCaret does not have this issue since it clamps the dragging point
to the editable content boundary.

Fix this bug by porting TouchCaret::GetContentBoundary() to
AccessibleCaret. I apply the clamp logic to both cursor mode and
selection mode if the focus node is on an editable content, which makes
carets dragging in selection mode smoother than SelectionCarets.

--HG--
extra : commitid : CbqEsabADIl
extra : rebase_source : 86847ced02859cd556806d547461e8f4167eab73
2015-10-07 18:09:04 +08:00
Ting-Yu Lin
95b225eccd Bug 1196176 - Do not fire extra CaretStateChanged event when typing. r=mtseng
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
2015-09-22 17:39:36 +08:00
Ting-Yu Lin
0602eab24b Bug 1196176 - Fix CaretStateChanged not dispatch on empty content. r=mtseng
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
2015-09-22 17:39:36 +08:00
Ting-Yu Lin
a1ac42a2fb Bug 1196176 - Hide carets for mouse down reason. r=mtseng
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
2015-09-22 17:39:36 +08:00
Ting-Yu Lin
549ac3b8f4 Bug 1204872 - Prettify enum class printing. r=roc
Provide operator<< functions so that gtest can use them to print enum
classes.

--HG--
extra : commitid : JYu6ffen2Zr
extra : rebase_source : 6628de44b343a0c625fd4526d36dba34ad0cb5cc
2015-09-19 01:05:19 +08:00
Ting-Yu Lin
64e9080458 Bug 1204872 - Make AccessibleCaretManager testable. r=roc
We need to extract statements that touch PresShell, access frame trees,
or call other utility functions into functions so that we could mock or
stub them in gtest.

Inline GetFocusedContent since it's only used once.

--HG--
extra : commitid : 15oROwm04pa
extra : rebase_source : f40692f3f77f8848424f6021046b6e4eeb7752dc
2015-09-19 01:05:19 +08:00
Ting-Yu Lin
1e2a01e453 Bug 1204872 - Add documentation and rename mCaretMode. r=roc
Rename mCaretMode to mLastUpdateCaretsMode to make it clear that this
variable track the caret mode since last update. This also avoid the
confusion that GetCaretMode() returns mCaretMode.

--HG--
extra : commitid : BoFaTHocik
extra : rebase_source : 944882f796904671d516f4e15edb39a5ae88bada
2015-09-19 01:05:18 +08:00
Ting-Yu Lin
63aeeea1b1 Bug 1199161 - Add selectedTextContent to CaretStateChangedEvent. r=kanru, sr=smaug
The old SelectionStateChangedEvent dispatched by SelectionChanged had
this field, but it has not being ported to CaretStateChangedEvent. We
should include selected text in the event so that Gaia could have a
chance to enhance user experience.

--HG--
extra : rebase_source : 7304b71e251e2ee081192340b8f86f22bf6e03a6
2015-09-16 17:58:14 +08: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
b9f7a85db6 Bug 1200194 - Add UpdateCaretsHint to guide appearance changing. r=roc
This is the patch which fixed the bug.

When calling OnScrollPositionChanged in cursor mode, we want the
appearance of the caret to be preserved since the caret might be hidden
due to timeout. We should respect the old appearance of the caret.

Add a marionette test to ensure the caret does not appear due to
ScrollPositionChanged.

--HG--
extra : commitid : KCG4QMsPhdY
extra : rebase_source : e69ce44e11e079dc79c8e69e7aa25003ca5d0398
2015-09-09 16:47:20 +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
Ting-Yu Lin
cf9ff442dd Bug 1200194 - Fix AccessibleCaret is out of scrollport in cursor mode. r=roc
The comment reads "No need to consider whether the caret's position is
out of scrollport", which is untrue.

For example, the position of nsCaret might be shifted by typing and be
covered by other elements. So we need to set the appearance of first
caret to NormalNotShown when it becomes invisible.

--HG--
extra : commitid : KCG4QMsPhdY
extra : rebase_source : c5990c1b544354b80295507e3d886eb7bd11ed15
2015-09-09 16:47:20 +08:00
Ting-Yu Lin
4c1ccfafa3 Bug 1200194 - Expose nsCaret::GetFrameAndOffset for reuse. r=roc
This function can be reused by AccessibleCaret.

--HG--
extra : commitid : KCG4QMsPhdY
extra : rebase_source : ec6bb5f771f14d5b39c598c51bccced48909945d
2015-09-09 16:47:20 +08:00
Ting-Yu Lin
e63f8dd3e4 Bug 1197739 - Do not change focus too early unless the frame is selectable. r=roc
Split |ChangeFocus| into two separate functions: |GetFocusableFrame| and
|ChangeFocusToOrClearOldFocus|.

We should only change the focus to the focusable frame until
AccessibleCaretManager is going to:

1) Dispatch CaretStateChangedEvent on an empty editable field.
2) Select a word on a selectable frame.

--HG--
extra : transplant_source : %C9v%F6%9B%EE%85y%9B0%AD8%CB%1B%E1%22%98%DE%D5%B9e
2015-08-27 16:55:33 -04:00
Ting-Yu Lin
eebda9bb00 Bug 1195672 - Revise the logic of long tap on empty content. f=mtseng, r=roc
The only logic change is that we now call UpdateCaret() before
dispatching CaretStateChangedEvent.

This resolves a bug that the text selection dialog flashes when long
tapping on an empty content.

--HG--
extra : commitid : JHAxvifqpZS
extra : rebase_source : 9ae578f616eedc939839bc056c5437a84e8fedea
2015-08-19 15:54:10 +08:00
Ting-Yu Lin
8dbb5ca794 Bug 1195672 - Move the check that frame is selectable into SelectWord. f=mtseng, r=roc
There's a bug that when a frame is focusable but not selectable, we
won't focus on it because we call IsSelectable() before ChangeFocus().

By moving the check into SelectWord(), we'll have a chance to focus on
it.

This resolves a issue that when long press to select a word on a new
opened app, the selection highlight is gray instead of blue.

--HG--
extra : commitid : Fmupbt6gIQ9
extra : rebase_source : 0c427bf767c9d44e9467469e929f27e743e7d013
2015-08-19 15:54:10 +08:00
Ting-Yu Lin
1fc80119ff Bug 1195672 - Make focus changing by long tap behaves like by single tap. f=mtseng, r=roc
We want the focus changing behavior by long tap as close as to the one
by single tap.

The only functional change is that we always clear old focus and
re-focus the window if a focusable frame cannot be found. This behavior
is the same as the single tap implemented in
EventStateManager::PostHandleEvent().

Besides, ChangeFocus now returns the new focusable frame instead of bool
which provides more information.

--HG--
extra : commitid : 3y2smyRZQCW
extra : rebase_source : 36e7b65cf67f3148ea24668eef7078ee4daadb3c
2015-08-19 15:54:10 +08:00
Ting-Yu Lin
f5102fc4ca Bug 1194063 - Always launch caret timer in cursor mode. r=mtseng
If the timer is not launched when the content is empty, the first caret
will always has Appearance::NormalNotShown, which is not consistent with
the behavior when the caret is shown when the content is not empty.

After this patch, Gaia will always receive an update event after 3
seconds timeout. Hence fixed a bug that the shortcut text dialog does
not hide after 3 seconds timeout.

--HG--
extra : commitid : BwUbPSfjZs2
2015-08-17 21:20:00 +08:00
Jeremy Chen
b253b6b253 Bug 1181418 - Send selectionEditable info to app_text_selection_dialog. r=tlin, r=kanru, sr=smaug
--HG--
extra : commitid : DO8T9n6MMXa
extra : amend_source : d359d938905e00a8a4d6c5cebf0bee14b7527b6e
2015-07-31 04:34:00 +08:00
Ting-Yu Lin
fc4e0a5e5c Bug 1174600 - Fix first AccessibleCarets jumps to top of the screen when dragging. r=mtseng
When the second AccessibleCaret is out of scrollport, its logical
position becomes (0, 0). Therefore we should adjust the dragging point
for first AccessibleCaret only if dragDownBoundaryY > 0.

--HG--
extra : commitid : 9OQxownfw5q
2015-06-14 22:40:00 +08:00
Ting-Yu Lin
2217c13f8b Bug 1170084 - Dispatch CaretStateChangedEvent via AsyncEventDispatcher. r=mtseng
We should not dispatch an event if it is not safe to run script since
the event handlers might be implemented by Javascript.
To fix this, we always use AsyncEventDispatcher to dispatch the event.

--HG--
extra : transplant_source : %1F%C0%7C%DBGDn%F7%F7%E5%92%18Cw%28%D5C%88%23%9F
2015-06-05 15:03:47 +08:00
Ting-Yu Lin
4a4a54ff49 Bug 1169151 - Update carets after long tapping on empty input. r=mtseng
This fixed AccessibleCarets remain on the screen when long tapping on an
empty input.
2015-05-28 02:33:00 +08:00
Morris Tseng
c7cdc44318 Bug 1155493 - Part 3: Dispatch event when carets are updated, pressed, released, tap, longpressonemptycontent, hidden. r=roc 2015-05-13 20:10:00 -04:00
Morris Tseng
974788b953 Bug 1155493 - Part 1: Add CaretStateChangedEvent and corresponding utility function. r=roc, sr=smaug 2015-05-19 20:59:00 -04:00
Ryan VanderMeulen
cf9976434d Backed out 4 changesets (bug 1155493) for Android test_browserElement_inproc_CopyPaste.html timeouts/crashes.
Backed out changeset 3bd7adb9f591 (bug 1155493)
Backed out changeset 0380b1684e6b (bug 1155493)
Backed out changeset 58b7c1eaf3c8 (bug 1155493)
Backed out changeset 896beb5088a7 (bug 1155493)
2015-05-25 13:15:06 -04:00
Morris Tseng
b538815b50 Bug 1155493 - Part 3: Dispatch event when carets are updated, pressed, released, tap, longpressonemptycontent, hidden. r=roc
--HG--
extra : source : ca51748d62b232c8312ff9d8decaf1a16aebf0a2
2015-05-13 20:10:00 -04:00
Morris Tseng
c1b8ea5c2d Bug 1155493 - Part 1: Add CaretStateChangedEvent and corresponding utility function. r=roc, sr=smaug
--HG--
extra : source : 1e690405d3146521cb01cf4b44c92028049f237f
2015-05-19 20:59:00 -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
506bc5b7fb Bug 1110039 - Part 2.3 - Add AccessibleCaretManager. r=roc
See AccessibleCaretManager.h for the class description.

AccessibleCaretManager uses two AccessibleCarets to unify the
functionality provided by TouchCaret and SelectionCarets. It has
"cursor" mode and "selection" mode, which corresponds to TouchCaret and
SelectionCarets, respectively.
2015-04-30 00:59:00 +02:00