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

125 Коммитов

Автор SHA1 Сообщение Дата
Ting-Yu Lin bc5a26efde Bug 1307252 - Hide the carets when the selection is made by select all. r=kanru,kats
The mochitest for clipboard still needs the mozbrowsercaretstatechanged events,
so we disable "layout.accessiblecaret.hide_carets_for_mouse_input".

MozReview-Commit-ID: CD03lmjwUa9

--HG--
extra : rebase_source : 530d241764d55ed6507f993511c74cf820195283
2016-10-05 15:46:36 +08: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
Kartikaya Gupta 435b8ac3fc Bug 1300905 - When long-pressing on a selection, don't dismiss the selection and start a new one. Show the context menu instead. r=TYLin,mats
MozReview-Commit-ID: J0e9DqIDwnC
2016-09-30 09:36:10 -04: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
Ting-Yu Lin ad4f98ca69 Bug 1285273 - Bail out early if ptFrame died in SelectWordOrShortcut(). r=masayuki
Check ptFrame is still alive after calling
ChangeFocusToOrClearOldFocus() and IMEStateManager::NotifyIME().

MozReview-Commit-ID: DtjoxtRIDdK

--HG--
extra : rebase_source : ff6d18eb15d719d4f00dce249e2a33f5a4823203
2016-07-10 14:36:02 +08: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
Ting-Yu Lin e9e4654b4a Bug 1283828 - Ensure output arguments are set in GetFrameForFirstRangeStartOrLastRangeEnd if returned frame isn't nullptr. r=mats
MozReview-Commit-ID: 3sC3HLPrOtF

--HG--
extra : rebase_source : 5acccc8ddee30387c9f113f6b72aa37d14a75db0
extra : amend_source : fbcb6eb5336595446281e755d2558b38c0c23b4c
2016-07-04 17:39:15 +08:00
Masayuki Nakano d960ef26d5 Bug 1278014 part.5 Rename SelectionType::SELECTION_NORMAL to SelectionType::eNormal r=smaug
MozReview-Commit-ID: AAdxTTKEvrk

--HG--
extra : rebase_source : 82e10db6b8b17d4f571625e34bb3c8f1905ef58a
2016-06-09 18:35:22 +09:00
Masayuki Nakano 00591135a4 Bug 1278014 part.2 Define mozilla::SelectionType as an enum class and use it instead of RawSelectionType as far as possible r=smaug
This patch defines mozilla::SelectionType as an enum class.  This is safer than nsISelectionController::SELECTION_* since setting illegal value to its variable is checked at build time.  So, as far as possible, this should be used everywhere (but of course, this isn't available in scriptable interfaces).

And also this implements some useful methods for managing SelectionType and RawSelectionType which are implemented in layout/nsSelection.cpp because nsISelectionController is implemented by both PresShell and nsTextEditorState.  Therefore, implementing one of them may make hard to find them.  On the other hand, nsSelection.cpp is a better file name to look for them.

Note that this patch creates mozilla::Selection::RawType() for binding.  Native code should keep using Selection::Type() but the binding code needs to use RawType() due to impossible to convert from SelectionType to RawSelectionType without explicit cast.

MozReview-Commit-ID: 81vX7A0hHQN

--HG--
extra : rebase_source : d9f88e217c713c60d1c2578ce6421c73ccba8650
2016-06-11 11:06:37 +09:00
Ting-Yu Lin f24a9b7431 Bug 1266782 - Use RefPtr to hold document and selection in ExtendPhoneNumberSelection. r=mats
MozReview-Commit-ID: 3zAgKt7r8TO

--HG--
extra : rebase_source : 1ee468762812a955a41908bd0ce7f4b41aee8859
2016-04-28 13:59:39 +08:00
Ting-Yu Lin b8bf17b6b3 Bug 1267929 - Bail out from ExtendPhoneNumberSelection if GetAnchorFocusRange() is nullptr. r=mats
MozReview-Commit-ID: HvNhZ5o0owh

--HG--
extra : rebase_source : d003f7fc6d065bb439d24e0364fe34086f14ad88
2016-04-27 17:19:51 +08:00
Ting-Yu Lin bcbf8175b8 Bug 1249201 Part 2 - Show carets continuously when panning or zooming. r=mats,sebastian
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
2016-04-21 16:53:40 +08:00
Mark Capella a5dadf5639 Bug 1265750 - Some word cannot be selected via long pressing, r=TYLin, mats 2016-04-21 08:53:13 -04:00
Mark Capella 88cc5b6c9a Bug 1235508 - Re-implement fast Phone number selection on long-press, r=TYLin 2016-04-14 02:14:16 -04:00
Ting-Yu Lin 152cf5d714 Bug 1168891 Part 2 - Allow one caret to be dragged across the other caret. r=mats
This behavior matches the Android convension and the built-in selection
on all desktop platforms.

MozReview-Commit-ID: 2kNm8UZnqH0

--HG--
extra : rebase_source : 097918c7c49e7cd545af52e9b3f3c540475ec589
2016-04-11 17:57:29 +08:00
Ting-Yu Lin 0f764ef889 Bug 1168891 Part 1 - Refine two functions related to caret positioning. r=mats
FindFirstNodeWithFrame() and CompareRangeWithContentOffset() share a lot
of code duplication. I refactor and rename the two functions to improve
the readability.

MozReview-Commit-ID: CyetLHOGT23

--HG--
extra : rebase_source : e026acc87347253bcc795538ea06cbbd68634227
2016-04-11 17:57:29 +08:00
Carsten "Tomcat" Book e070379821 merge mozilla-inbound to mozilla-central a=merge 2016-03-11 16:50:43 +01:00
Mark Capella aa9ca8ef90 Bug 1252802 - Web page scrolls when dragging caret in editable, r=snorp 2016-03-10 18:06:13 -05:00
Ting-Yu Lin b063b0cec5 Bug 1097398 Part 2 - Add preferences to make carets always tilt. r=roc
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
2016-02-16 16:55:28 +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
Ting-Yu Lin 860487f7f6 Bug 1246918 - Fix carets missing after scrolling down in selection mode on Fennec. r=roc
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
2016-02-11 16:22:57 +08:00
Carsten "Tomcat" Book 436f1bf747 Backed out changeset bc3e37b63def (bug 1246918) for fix frequent android c1 test failures 2016-02-17 14:35:10 +01: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 8f500a4074 Bug 1246918 - Fix carets missing after scrolling down in selection mode on Fennec. r=roc
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
2016-02-11 16:22:57 +08:00
Aidin Gharibnavaz 6863090c8a Bug 1235830 - Renaming GetInternalNSEvent to WidgetEvent, in nsIDOMEvent r=smaug
MozReview-Commit-ID: Hm8Owq17KXn

--HG--
extra : transplant_source : 2%82%D5%89%19%94%7C%E7%CA1%99%B5%24%1F5%E1%C0%1F%DE%07
2016-02-12 19:10:07 +03:30
Ting-Yu Lin 276d86f23b Bug 1246064 - Support long press to show AccessibleCaret on empty input for Fennec. r=roc
--HG--
extra : commitid : 54K1eLvKmSr
extra : rebase_source : 76a64e40ec15c6d110a461d5fb9d66d3ac86852e
2016-02-08 16:08:46 +08:00
Ting-Yu Lin 7d02ded5a1 Bug 1240917 - Do not show caret in empty input on Fennec. r=roc
Per request in bug 1240917 comment 15, we decided not to show caret when
single press on an empty input. This effectively reverts the work in Bug
1230582.

--HG--
extra : commitid : IjKGpqAR6zP
extra : rebase_source : d476618b4f419cf2d96bb33264cfd8ccb6e3fa61
2016-02-02 14:32:31 +08:00
Phil Ringnalda a39d6e46e4 Merge m-c to m-i 2016-01-30 09:43:42 -08:00
Kyle Huey 91efc5a86c Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Mark Capella 1cccfbae8e Bug 1240286 - Deleting text with backspace causes the action bar to glitch, r=smaug, TYLin, jchen 2016-01-30 00:08:55 -05:00
Carsten "Tomcat" Book 92b2943e68 Merge mozilla-central to mozilla-inbound 2016-01-27 12:10:56 +01:00
Ting-Yu Lin 62a80ac969 Bug 1121468 - Show carets when long-pressing on selection highlight. r=roc
The blur event will hide the carets and produces a standalone selection
highlight without carets. When a user long-pressing on the highlight, we
should show carets for the original selection highlight instead of
select a new word.

The helper UpdateCaretsWithHapticFeedback() should only be needed when
long-pressing. It should suffice to live within SelectWordOrShortcut()
instead of being a member function.

--HG--
extra : commitid : 789VwIRV03I
extra : rebase_source : ef4e9dd1260cec7fd900f68aacdc405bc018b3ce
2016-01-25 15:50:28 +08:00
Mark Capella ede11d4e28 Bug 1242349 - Provide unique AccessibleCaret pref for JS selection changes, r=TYLin 2016-01-26 09:27:36 -05:00
Ting-Yu Lin 94991d3936 Bug 1241008 - Add preference to show or hide selection bars. r=mtseng
--HG--
extra : rebase_source : 87593ce1fc35e0d99e4a5b68f5fe5b3725cc25b6
2016-01-21 11:11:38 +08:00
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 edffd8287a Bug 1251519 Part 5 - Use union rect of child frames for clamping. r=mats
This patch use the union of all child scrollable overflow frame rects to
clamp the caret dragging point.

MozReview-Commit-ID: GEF9BpQkQNd

--HG--
extra : rebase_source : 3722e8a0f32a45439fed753b7d5f9a76add4553f
2016-03-10 17:38:33 +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