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
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
This feature is B2G only. Remove it to make AccessibleCaret simpler to
maintain.
MozReview-Commit-ID: 7JZw5XtaUeU
--HG--
extra : rebase_source : aba249d361723feeaf769a3b802564dbcd6ca9ea
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
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
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
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
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
We don't need to check GetFrameSelection() because valid GetSelection()
implies valid GetFrameSelection().
MozReview-Commit-ID: 9WH7HxN27yF
--HG--
extra : rebase_source : 0d97ae57600b239a4beb48580f74bf20d6137be5
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
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
This avoids conflicts with mozilla::dom::FrameType.
MozReview-Commit-ID: 7aEMbHRaTFk
--HG--
extra : rebase_source : 2d01321f5ce0ec8c0e3f70984674f82678034b3c
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
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
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
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
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
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