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

125 Коммитов

Автор SHA1 Сообщение Дата
Jim Chen e87c3096e6 Bug 1442176 - 1. Remove current pin-on-caret-drag code; r=snorp
Remove the current code that pins the toolbar on caret drag, which only
works for Fennec.

Differential Revision: https://phabricator.services.mozilla.com/D5189
2018-09-17 17:47:21 -04:00
Ryan VanderMeulen 649c54f993 Backed out 4 changesets (bug 1485063) for breaking text selection on Android (bug 1490818).
Backed out changeset 8ad3af468d26 (bug 1485063)
Backed out changeset 8f53e771094d (bug 1485063)
Backed out changeset 99456cff7313 (bug 1485063)
Backed out changeset d43869851540 (bug 1485063)
2018-09-13 10:21:46 -04:00
Ting-Yu Lin 6ab0f8df35 Bug 1485063 Part 4 - Move preferences used in AccessibleCaretManager to StaticPrefList.h. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D5474
2018-09-11 14:21:42 -07:00
Ting-Yu Lin 6f4a25f896 Bug 1347048 - Remove AccessibleCaret's selection bar support. r=mats
This UI feature was used by B2G only.

Differential Revision: https://phabricator.services.mozilla.com/D4040

--HG--
extra : moz-landing-system : lando
2018-08-31 13:51:51 +00:00
Jim Chen 450647e5d2 Bug 1483665 - Only call SetSelectionDragState in parent process; r=snorp
We can't call nsWindow::SetSelectionDragState in the child process so
check for the parent process first.

Differential Revision: https://phabricator.services.mozilla.com/D3561

--HG--
extra : moz-landing-system : lando
2018-08-17 23:05:08 +00:00
Jeff Gilbert 5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Jim Chen 81118778f8 Bug 1463576 - 1. Add layout.accessiblecaret.script_change_update_mode pref; r=bz
Currently, if the "layout.accessiblecaret.allow_script_change_updates"
pref is false, we always hide accessible carets when the selection
changes due to JS calls (e.g. setSelectionRange(0, 1)). If the pref is
true, instead, we update the accessible carets if they are already
visible. In either case, we never show the carets if they're invisible.

However for testing purposes, it's useful to make it so we do try to
show the carets if they're invisible. This patch replaces that pref with
the new integer pref "layout.accessiblecaret.script_change_update_mode",
which can be 0 or 1, which correspond to the old pref, or the value 2,
which introduces this new behavior of always showing the carets.

MozReview-Commit-ID: Bf1gPpIzcyb

--HG--
extra : rebase_source : 5eaba6c18d800da425d5e21f61af880678d7fe3c
2018-06-01 13:39:20 -04:00
Emilio Cobos Álvarez fe09ffd3af Bug 1465478: Introduce Element::FromNode. r=smaug
And use it in a couple places I noticed.

MozReview-Commit-ID: 8baSMrbdEbF
2018-05-31 02:46:10 +02:00
Boris Zbarsky 63c4927445 Bug 1387143 part 26. Remove nsISelection::Modify. r=mats 2018-05-08 13:52:42 -04:00
Boris Zbarsky b23f25078d Bug 1387143 part 1. Stop using nsISelection in nsISelectionListener. r=mats 2018-05-08 13:52:35 -04:00
Boris Zbarsky dd4506eee2 Bug 1457155. Rename various focus manager variables to make it clearer that they're Elements. r=mccr8 2018-04-26 15:28:31 -04:00
shindli af700315a1 Backed out 2 changesets (bug 1457155, bug 1457156) for B failures in builds/worker/workspace/build/src/dom/html/HTMLObjectElement.cpp on a CLOSED TREE
Backed out changeset 8b2a6b54336c (bug 1457155)
Backed out changeset 4e267d999797 (bug 1457156)
2018-04-27 01:34:37 +03:00
Boris Zbarsky 25cec96459 Bug 1457155. Rename various focus manager variables to make it clearer that they're Elements. r=mccr8 2018-04-26 15:28:31 -04:00
Boris Zbarsky 8a0b50bea8 Bug 1456588 part 1. Change nsIFocusManager::SetFocus to take Element. r=enndeakin 2018-04-26 10:37:46 -04:00
Jonathan Watt ef1290712d Bug 1452170 follow-up - Fix Windows unified build bustage by adding missing AutoRestore.h includes. r=me on CLOSED TREE 2018-04-09 10:21:42 +01:00
Ting-Yu Lin b8ed325fb0 Bug 1347049 - Remove the ability to hide AccessibleCaret when scrolling. r=mats
This feature is B2G only. Remove it to make AccessibleCaret simpler to
maintain.

MozReview-Commit-ID: 7JZw5XtaUeU

--HG--
extra : rebase_source : aba249d361723feeaf769a3b802564dbcd6ca9ea
2018-04-04 15:45:52 +08:00
Boris Zbarsky 89ea512161 Bug 1446711 part 7. Switch the nsIDOMMouseEvent::MOZ_SOURCE_* constants over to MouseEventBinding. r=qdot
We can't include MouseEventBinding.h in MouseEvents.h because that produces
this include loop:

MouseEventBinding.h -> UIEventBinding.h ->
nsGlobalWindow.h -> nsGlobalWindowInner.h -> nsRefreshDriver.h ->
AnimationEventDispatcher.h -> AnimationComparator.h -> Animation.h ->
EffectCompositor.h -> PseudoElementHashEntry.h -> Element.h ->
PointerEventHandler.h -> MouseEvents.h -> MouseEventBinding.h

MozReview-Commit-ID: 6FNksGil7uD
2018-03-20 00:16:06 -04:00
Emilio Cobos Álvarez a4486328c8 Bug 1433671: Add MOZ_CAN_RUN_SCRIPT annotations to AccessibleCaret and other stuff. r=bz
MozReview-Commit-ID: Js0CF7WQM73
2018-03-14 23:32:22 +01:00
Boris Zbarsky 7a9f022f1a Bug 1434819 part 7. Remove the SHOW_* constants from nsIDOMNodeFilter. r=qdot
MozReview-Commit-ID: 7E2KZkLfbSI
2018-02-01 14:26:12 -05:00
Emilio Cobos Álvarez 1528ebee1c Backout changeset 5ca278d8c1af (Bug 1433671) for not handling all callers in all platforms. r=backout
This reverts commit 795018bb21eb9fa906128d0a15cf773643878585.
2018-01-30 12:17:04 +01:00
Emilio Cobos Álvarez b0b4e4a39a Bug 1433671: Add MOZ_CAN_RUN_SCRIPT annotations to AccessibleCaret. r=bz
MozReview-Commit-ID: Js0CF7WQM73
2018-01-30 11:50:35 +01:00
Emilio Cobos Álvarez 9af8f870d0 Bug 1433671: Make AccessibleCaretManager flushes a bit more sound. r=TYLin
The accessible caret manager is owned by the event hub, that is owned by the
shell.

All the callers of methods that call FlushLayout on the AccessibleCaretManager
should hold an external reference to the event hub.

Flushing pending notifications can run arbitrary script, that can call Destroy()
on the pres shell (and thus tear down the accessible caret event hub, and the
manager with him).

I don't know why before my change this wasn't crashing badly, but the code as it
was just doesn't look sound to me at all either (maybe I'm misunderstanding
something and I should just revert that patch and give up on having nice
invariants during our flushes..., but I don't think it's the case).

This also adds some sanity-checking that we don't die under our flush.

MozReview-Commit-ID: 4s0UT0fD3TI
2018-01-30 11:50:32 +01:00
Emilio Cobos Álvarez a8ea649ff5 Bug 1431474: Make AccessibleCaretManager flush notifications through the document. r=bz
We're crashing because we're trying to flush layout of a shell whose document is
in the bfcache, so when we try to get the shell from the document in the style
set we get null back.

This shouldn't generally happen, and all flushes should go through the document
instead to avoid bugs like this and also other bugs related to subdocuments, and
all the stuff that nsIDocument::FlushPendingNotifications handles but the
presshell version doesn't. That's bug 1431852.

MozReview-Commit-ID: 1IJ4DBa3DCO
2018-01-24 10:32:53 +01:00
Ting-Yu Lin c02ec1e455 Bug 1417796 - Pass UpdateCaretsHintSet by const references instead of values. r=mtseng
Fix warning: the parameter 'aHints' is copied for each invocation but only
used as a const reference; consider making it a const reference

MozReview-Commit-ID: 6CyT6gxVgES

--HG--
extra : rebase_source : e93f4eee24a2ef1e27dcfc43725fb5600f1b2d5b
2017-11-16 13:49:40 +08:00
Ting-Yu Lin 5eb302904c Bug 1417796 - Refactor AccessibleCaretManager::GetFrameSelection() to eliminate a warning. r=mtseng
Fix warning: do not use 'else' after 'return'

MozReview-Commit-ID: 1jebzioHvph

--HG--
extra : rebase_source : 2dda2495c996eeb37e8421e0a96e97bb8e966905
2017-11-16 13:48:20 +08:00
Ting-Yu Lin a8daccc87e Bug 1417796 - Make empty destructors implemented by 'default'. r=mtseng
Fix warning: use '= default' to define a trivial destructor

I added #include "nsDocShell.h" because I got an error "incomplete type
'nsDocShell' used in nested name specifier." After that, some files like
nsCanvasFrame.cpp fails to compile because they include
AccessibleCaretEventHub.h. Hence the moz.build changes.

MozReview-Commit-ID: BYZx7txvkSn

--HG--
extra : rebase_source : 2a4e8c25eb1c596486d540f2a5a34a00dc675881
2017-11-16 13:46:54 +08:00
Ting-Yu Lin fd26fb0032 Bug 1404854 Part 3 - Fix page cannot be scrolled automatically when dragging caret. r=mtseng
The issue is: when we hit some failure conditions in DragCaretInternal()
such as the frame is not selectable, or no frame is under the point, etc.,
we'll early return so that the auto scroll code is not being executed.

The logic in StartSelectionAutoScrollTimer() is similar to how
nsFrame::HandleDrag() handles the auto scrolling.

MozReview-Commit-ID: FtXZ8BWp3BX

--HG--
extra : rebase_source : 9526c10987286316ac76c536cc9086de65931797
2017-10-06 15:54:23 +08:00
Ting-Yu Lin 6a312878b3 Bug 1404854 Part 2 - Move adding mOffsetYToCaretLogicalPosition into DragCaretInternal(). r=mtseng
MozReview-Commit-ID: 1hKB7V4JSZo

--HG--
extra : rebase_source : 20cbd21ce12f60c47e16d2bbeac47e2038a3a207
2017-10-06 17:39:56 +08:00
Ting-Yu Lin 2c85997e86 Bug 1404854 Part 1 - Move null pointers checking from DragCaretInternal() to DragCaret(). r=mtseng
We don't need to check GetFrameSelection() because valid GetSelection()
implies valid GetFrameSelection().

MozReview-Commit-ID: 9WH7HxN27yF

--HG--
extra : rebase_source : 0d97ae57600b239a4beb48580f74bf20d6137be5
2017-10-06 15:45:32 +08:00
Masayuki Nakano 4ee17d1b8c Bug 1377989 - part2: Rename nsRange::GetEndParent() to nsRange::GetEndContainer() r=smaug
MozReview-Commit-ID: K4qPjtZ62yO

--HG--
extra : rebase_source : 8653db98b9bd70c77a6aac8d906f401f0222c58a
2017-07-11 21:11:37 +09:00
Masayuki Nakano 2f2ce53be5 Bug 1377989 - part1: Rename nsRange::GetStartParent() to nsRange::GetStartContainer() r=smaug
Web standards use "Container" instead of "Parent".  So, nsRange shouldn't use "Parent" for its members and methods.

MozReview-Commit-ID: Ho6N0diuWtE

--HG--
extra : rebase_source : ee4eb7068a68b118c7fe98e9e9e7fa9c9e7f13e2
2017-07-11 20:53:04 +09:00
Ting-Yu Lin 0dbc15d1bd Bug 1370762 - Null check GetSelection() before calling Stringify(). r=mtseng
MozReview-Commit-ID: 9sNaXwzbqUw

--HG--
extra : rebase_source : 3f9b88368a27a38e01fab3d97a228cdda1c55dfa
2017-06-08 12:49:05 +08:00
Ting-Yu Lin 60af6a6d49 Bug 1361072 - Change caller of RestrictCaretDraggingOffsets() to use getter_AddRefs. r=dholbert
Per description in bug 1361072, this is the standard idiom to assign
outparam pointers of refcounted types.

MozReview-Commit-ID: 6kmDslMs94j

--HG--
extra : rebase_source : c151f0e6050cfd3ce1cf914eeb350166c539d160
2017-05-02 14:24:54 +08:00
Emilio Cobos Álvarez 23bce99ae1 Bug 1361051: rename mozilla::FrameType to mozilla::LayoutFrameType. r=xidorn
This avoids conflicts with mozilla::dom::FrameType.

MozReview-Commit-ID: 7aEMbHRaTFk

--HG--
extra : rebase_source : 2d01321f5ce0ec8c0e3f70984674f82678034b3c
2017-05-01 19:32:52 +02:00
Emilio Cobos Álvarez e44543aad4 Bug 1360241: Devirtualize nsIFrame::GetType. r=heycam
MozReview-Commit-ID: 5Nzhyta5Hle

--HG--
extra : rebase_source : c2e9d4bfb9239f5e851d110cd7dff98c1e1a8d8b
2017-04-30 17:30:08 +02:00
Astley Chen 785a31d171 Bug 1347047 Part 2 - Remove caret timeout control from AccessibleCaretManager. r=TYLin
The feature is controlled by pref layout.accessiblecaret.timeout_ms, and has been disabled in bug 1268410.
It's time to remove relevant code from the tree.

MozReview-Commit-ID: LLu8RiQcTpm

--HG--
extra : rebase_source : 906299afe9fbcb4bad2c74c83f19eb98b8815882
2017-03-17 08:50:30 +08:00
Ting-Yu Lin 7bd47fa30a Bug 1273045 Part 2 - Update carets when scrolling in subframes without APZ. r=mtseng
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
2017-03-14 17:50:03 +08:00
Ting-Yu Lin fb0e5cae3e Bug 1273045 Part 1 - Convert UpdateCaretsHint to use EnumSet. r=mtseng
Part 2 is going to add a new hint which will use with RespectOldAppearance.
Hence this patch.

Remove #include "mozilla/WeakPtr.h" and "nsWeakReference.h" because they're
not used in the header.

MozReview-Commit-ID: KiNv0M0v8iO

--HG--
extra : rebase_source : 0969fc5accf11ac69bc97e3a51569b063172ffe3
2017-03-14 15:25:16 +08:00
Ting-Yu Lin 88865e6258 Bug 1341588 Part 3 - Extend phone number selection only if it is already a phone number. r=mtseng
MozReview-Commit-ID: D25xl0oAD4o

--HG--
extra : rebase_source : 0ca3ffe41bbf5f5e9b353b3455fbd88b63417262
2017-03-07 17:21:26 +08:00
Ting-Yu Lin 8ccfd5c8a6 Bug 1341588 Part 2 - Add StringifiedSelection() to simplify code. r=mtseng
MozReview-Commit-ID: 1tRG8WY13ok

--HG--
extra : rebase_source : 97cd124299059b082583d503bcbf56da15db08e3
2017-03-07 17:09:39 +08:00
Ting-Yu Lin 5ee24f0a0a Bug 1341588 Part 1 - Add spaces to the static comments for aesthetic reason. r=mtseng
MozReview-Commit-ID: IMZQ1v2KsI0

--HG--
extra : rebase_source : 4bb53124bd7333e22e803ec6851820682569ec2a
2017-03-07 16:19:31 +08:00
Mats Palmgren d13aaf9ce0 Bug 1340771 part 1 - Rename nsWeakFrame to AutoWeakFrame (automated change). r=tn
MozReview-Commit-ID: 8pl4nyeGEkr
2017-03-01 18:03:14 +01:00
Ting-Yu Lin 1578a6f939 Bug 1338445 - Restrict whitespace match in phone number regex for AccessibleCaret. r=mtseng
In phoneRegex, replace '\\s ' (matching a whitespace character) with ' '
since phone number won't contain something like new line or tab.

Also, consider it done if selected text is not changed after calling
Modify().

MozReview-Commit-ID: 2lB9w2gYCOD

--HG--
extra : rebase_source : f2ea498bbd17c1876a9b7f769cbe93cef84520bb
2017-02-17 22:38:08 +08:00
Tom Tromey 5f8f360823 Bug 1060419 - make log_print use Printf.h, r=froydnj
MozReview-Commit-ID: BIZ1GQEZ1vs

--HG--
extra : rebase_source : 2f1f0aa12493c44f352d9a7e8683e7bb72d2d75b
2016-12-15 20:16:31 -07:00
Ting-Yu Lin eaa14d29dc Bug 1339797 - Fix select-all events fired by touch incorrectly hide the carets. r=mtseng
sHideCaretsForMouseInput is default to true on all platforms. When clicking
"SELECT ALL" on Fennec toolbar in <input>, AccessibleCaretManager will
receive SELECTALL_REASON with MOZ_SOURCE_TOUCH.

We should hide the carets only if the select-all reason is fired by
keyboard, not by touch.

MozReview-Commit-ID: D7FYIH5ZGS0

--HG--
extra : rebase_source : 4cbd741b6f4b58830c1bd5cb3ac2e3a43782f02c
2017-02-17 14:08:48 +08:00
Ting-Yu Lin 723732ff7f Bug 1336388 - Use overlapping tilt mechanism in always tilt mode. r=mtseng
MozReview-Commit-ID: LwWnAbHiTBH

--HG--
extra : rebase_source : fb71526b2205edcaa40c5f6d2ace863ad7831a2a
2017-02-08 15:51:28 +08:00
Cameron McCormack babad063ff Bug 1328832 - Part 2: Rename mozFlushType to mozilla::FlushType and make it an enum class. r=bzbarsky
MozReview-Commit-ID: D3fIngSHSsl
2017-01-05 15:31:56 +08:00
Phil Ringnalda 702d0d5527 Backed out changeset 079ee7b41c3a (bug 1156160) for selection reftest failures
CLOSED TREE
2016-11-30 21:34:42 -08:00
Ting-Yu Lin 678e94aa9a Bug 1156160 - Update carets when document becomes visible. r=mtseng
When the user switches back to a tab which has the selection highlight on
the document, call UpdateCarets() to bring the carets back.

MozReview-Commit-ID: LxNoNRl4FHZ

--HG--
extra : rebase_source : f6fdc9b5c646b064bbe1e27456bbeaac063bd04c
2016-11-25 17:51:40 +08:00
L. David Baron 03d6962a30 Bug 1320815 - DeCOMtaminate nsIFrame::IsSelectable by returning boolean instead of nsresult. r=xidorn
MozReview-Commit-ID: EBxBcEgIvp7

--HG--
extra : rebase_source : 49e5a370df86baec014e99be56b05d451d5ee78c
2016-11-28 15:31:29 -08:00