This might revive some crashes, but we think the initial targeted blacklisting
was not the appropriate solution for this.
MozReview-Commit-ID: C5uPnIEkMPB
--HG--
extra : rebase_source : bceaca8844dbff996e0286109eb91a22059982ee
PrefsHelper uses Maybe<> as a replacement for a ternary expression, in
order to work around jni::StringParam's lack of copy constructor.
However, we can add a move constructor to StringParam, which lets us use
it in a ternary expression, and avoid the awkwardness of Maybe<>.
This patch replaces all references to |nsAutoPtr| in widget/ by references
to |UniquePtr|. |nsAutoPtr| is deprecated and will go away soon.
MozReview-Commit-ID: 8xAS79wTkPC
PrefsHelper uses Maybe<> as a replacement for a ternary expression, in
order to work around jni::StringParam's lack of copy constructor.
However, we can add a move constructor to StringParam, which lets us use
it in a ternary expression, and avoid the awkwardness of Maybe<>.
Add a loadUri method in GeckoView that replaces the functionality of the
current LOAD_URI event in GeckoEvent, and make GeckoApp and BrowserApp
use the new call.
The implementation for loadUri differs from the previous implementation
of LOAD_URI by directly calling nsIBrowserDOMWindow::OpenURI, instead of
going through the command-line handler. This more direct approach lets
us get rid of the Fennec command-line handler entirely.
Keep a pointer to nsPIDOMWindowOuter in GeckoViewSupport so that
GeckoView native method implementations can access the DOM window. This
also lets us simplify GeckoViewSupport::Close by calling
nsPIDOMWindowOuter::ForceClose directly.
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
Refactor the dispatching code to be more streamlined, and add two
optimizations to the way we dispatch a call:
* avoid a pair of unnecessary calls to add/delete the global class ref,
when dispatching a static call to the Gecko thread without a class ref
parameter.
* avoid an extra allocation when dispatching to a proxy function.
Remove uses of UsesNativeCallProxy and UsesGeckoThreadProxy, now that
they are not needed.
Remove cases where we had to invoke a call in a proxy, because the call
is now specified to be invoked directly in the WrapForJNI annotation,
without the need to go through the proxy.
For SmsManager and AlarmReceiver, we no longer need to manually dispatch
everything to the Gecko thread because that's now handled automatically.
Implement checking the calling thread of a JNI call based on the
calledFrom attribute set in WrapForJNI. Also implement automatic call
dispatching based on the dispatchTo attribute set in WrapForJNI. This
eliminates the use of UsesNativeCallProxy and UsesGeckoThreadProxy.
Update the code generator and related classes in annotation processor to
use the new WrapForJNI flags. Also add some more sanity checking to make
sure the flags are used correctly.
Replace old flags in WrapForJNI usages with new flags. The calledFrom
and dispatchTo flags are set based on whether the method is native or
non-native, and how the method is used.
Also fix testEventDipatcher to respect NativeJSObject's calledFrom =
"gekco" flag, by moving a test to Gecko thread.
We need to register the Java UI thread in native code very early in the
startup process, before libxul registers its JNI entry points. So it
makes sense to register the Java UI thread in mozglue.
This must be able to reproduce with some IMEs which creates 0 length composition string. In such case, mTextRectArray isn't available, but mTextRectArray.GetUnionRectAsFarAsPossible() always assumes that it's valid and has at least one rect. Therefore, it can meet this crash.
Therefore, this patch makes that ContentCacheInParent::GetUnionTextRects() not use mTextRectArray when it's not valid nor doesn't have rects.
MozReview-Commit-ID: 2yLMo4lxI3Z
--HG--
extra : rebase_source : 3ef3f2c6ba6473fd3eefbd5c909c1ef6c51c76af
TargetClauseOffset is the offset from start composition offset. So we should add start composition to calaculate correct rects.
MozReview-Commit-ID: 4qCpKvw2Eb4
--HG--
extra : rebase_source : 1c11d5648987772ee684166ee715340ad90284c0
Because bug 1282866 removed Qt support but missed a bunch of things.
* * *
Bug 1285554 - more
--HG--
extra : rebase_source : c48d2485f1fdf1c961e08d91651bbca41e3a1a53
kVK_RightCommand is already defined in Carbon.framework in 10.12.
MozReview-Commit-ID: 5QWRK4Gokg8
--HG--
extra : amend_source : 14f4059ef2c7cabfc63c33c4cea92b2650b5bc48
This patch also renames:
EditorInputEventDispatcher -> mozilla::EditorInputEventDispatcher
And some variable names are renamed from aEditor or mEditor to aEditorBase or mEditorBase for making their types clearer.
MozReview-Commit-ID: 2FCXWpLMn8e
--HG--
rename : editor/libeditor/nsEditor.cpp => editor/libeditor/EditorBase.cpp
rename : editor/libeditor/nsEditor.h => editor/libeditor/EditorBase.h
Remove SENSOR_EVENT from GeckoEvent and implement it as a native method
in GeckoAppShell that is invoked by the sensor event listener in
GeckoAppShell.
This patch stops the widget code from passing along touch-derived contextmenu
events straight from Windows to Gecko, and instead lets the APZ gesture
detection code handle it. This allows the contextmenu event to be prevented
according to web standards, e.g. if the touchstart event is cancelled.
This changes to browser.js will affect both Linux and Windows, but the behaviour
implemented is in line with native Windows touch behaviour. We may want to
add an alternate codepath for Linux to better simulate "native" Linux behavior,
if there is such a thing for touch-derived contextmenu.
MozReview-Commit-ID: 18qzK15ic8E
I'm still not sure what we should do in this case, though.
If mContentForTSF is initialized and there are some unknown changes in actual contents, i.e., not caused by composition of the active TIP itself, we cannot set selection range properly in some cases.
For example, if TSF tires to set non-empty selection range but the range has been removed by web apps.
For now, let's try to return E_FAIL in such case because that should occur at reconversion or something immediately after previous content change not caused by previous composition. If TIP does nothing in this case, user can retry with same operation after all pending text changes are notified to TSF.
MozReview-Commit-ID: 9unrNVeC1tW
--HG--
extra : rebase_source : 061e48e014a38b2a442bf736031febfe0b1e333d
Same as selection change notification, text change notification shouldn't be notified to TSF while there is cachec content because neither TSF nor TIP may allow to change text by web applications during keeping storing cached content.
This patch makes TSFTextStore stores and merges text changes until MaybeFlushPendingNotifications() is called and there is no cached content.
MozReview-Commit-ID: 9fj0GREbX18
--HG--
extra : rebase_source : 71db6b4b9f0ab979313398a8014bde992183e019
TSFTextStore shouldn't notify TSF of selection change until MaybeFlushPendingNotifications() is called and there is no cached content because while there is cached content, neither TSF nor TIP may allow to change selection by web applications. Therefore, ITextStoreACP::GetSelection() and similar methods need to use mSelection instead of actual selection in the focused editor. Therefore, TSFTextStore should store selection change data during keeping storing content cache and notify it when the cache is cleared. So, when TSFTextStore notifies TSF of selection change, TSFTextStore needs to update mSelection to the actual selection which is stored in mPendingSelectionChangeData.
MozReview-Commit-ID: 8ZWASzu7Znv
--HG--
extra : rebase_source : 0bfaef0bbffd72d661c84992cc8c842215e3407a
This patch stop clearing mContentForTSF at unlocking the document because we should keep it until active composition is committed. If so, TSF/TIP won't be confused by content changes by JS. So, this is important for a11y of TIP users in some complicated websites like GoogleDocs, Facebook, etc.
Note that this patch doesn't work well without following patches. We need to stop notifying TSF of selection changes and text changed while mContentForTSF is valid.
MozReview-Commit-ID: 9QOGZxdYU3I
--HG--
extra : rebase_source : 19a6eeb2357825643497caf5a5298c55f08a0670
The intention is that GeckoView consumers will not use browser.xul,
but instead geckoview.xul; and that they'll provide content URLs from
their assets/ directories. This lets them do things without modifying
the omnijar and in particular without setting Gecko's prefs *before*
Gecko startup.
MozReview-Commit-ID: 2QLQQ5RphFu
--HG--
extra : rebase_source : b80eb1b15a54dac3c19ba9c7bfe4f0ac7dae78c6
Also, changed the other paper size conversion code to be similar, as I think it is easier to follow.
MozReview-Commit-ID: 2PzzxevnQSz
--HG--
extra : rebase_source : 45d20a714a05425b9010b2f390cd417617243682
Here is the patched build's log:
[Main Thread]: I/nsGtkIMModuleWidgets GTKIM: 7fab5a60a2c0 CreateTextRangeArray(aContext=7fab5a7bbbf0, aCompositionString="÷" (Length()=1))
[Main Thread]: W/nsGtkIMModuleWidgets GTKIM: 7fab5a60a2c0 SetTextRange(), FAILED, due to no attr, aTextRange= { mStartOffset=0, mEndOffset=1 }
[Main Thread]: W/nsGtkIMModuleWidgets GTKIM: 7fab5a60a2c0 SetTextRange(), FAILED, due to current clause length is 0
[Main Thread]: E/nsGtkIMModuleWidgets GTKIM: 7fab5a60a2c0 SetTextRange(), FAILED, due to g_utf8_to_utf16() failure (retrieving current clause)
[Main Thread]: W/nsGtkIMModuleWidgets GTKIM: 7fab5a60a2c0 CreateTextRangeArray(), inserting a dummy clause at the beginning of the composition string mStartOffset=0, mEndOffset=1, mRangeType=TextRangeType::eRawClause
iBus Chewing IME has two clauses when user presses Shift+p, one doesn't have pango_attr, the other is empty. These clauses are not useful in Gecko. Additionally, TextRangeArray assumes that there is a clause at beginning of the composition when there is one or more clauses. Therefore, this patch tries to insert dummy clause at the beggining of composition in such case.
MozReview-Commit-ID: 3hVGVmvFrhA
--HG--
extra : rebase_source : edbd3a6a1139cffb0d5bfbe0c92bf6870c9a2608
I think that we can drop nsIMEUpdatePreference::DontNotifyChangesCausedByComposition(), i.e., nsIMEUpdatePreference::NOTIFY_CHANGES_CAUSED_BY_COMPOSITION because it's now used only by TSFTextStore but TSFTextStore ignores if SelectionChangeDataBase::mCausedByComposition or TextChangeDataBase::mCausedOnlyByComposition is true (for supporting async changes in e10s mode). So, only issue is, dropping the flag might cause increasing computing TextChangeData cost during composition in TSF mode. However, now, it's already enough fast and even if it'd cause performance regression, we could add a hack with TextComposition's offset information. Therefore, we don't need to worry about the performance regression so seriously.
MozReview-Commit-ID: HNT3G4isONj
--HG--
extra : rebase_source : 164231023aa2a17ceab94d92fb49ba0a00dab429
Currently, all widgets request selection change notifications to IMEContentObserver. Additionally, IMEContentObserver needs to listen selection changes for caching latest selection for eQuerySelectedText. Therefore, it doesn't make sense to keep defining nsIMEUpdatePreference::NOTIFY_SELECTION_CHANGE.
If widgets didn't need selection change notifications, they could just ignore the unnecessary notifications.
Note that all widgets don't need selection change notifications if a plugin has focus and IMEContentObserver cannot observe selection changes in the plugin. Therefore, if IMEContentObserver is initialized with a plugin, it shouldn't listen selection changes (and doesn't need to notify widgets of selection changes).
MozReview-Commit-ID: FOVFFgA2nOz
--HG--
extra : rebase_source : 3e16d5023835f99f82934e754d2e7db70474f9ee
To optimize copy of text rect array, we should use mozilla::Move. Also, after using it, we should mark is invalid result into SetEventResult
MozReview-Commit-ID: HH9H7DhK12
--HG--
extra : rebase_source : 4e02ece73583306c386597bc92e203fa147cfcbc
extra : histedit_source : 726621cdaf262b9d173ae19d505575f10563cc36
Selection cache might be updated on commit string, so it should be updated correctly. Also, IMContextWrapper::OnSelectionChange() already has the check for composing using IsComposing().
MozReview-Commit-ID: 2n3f3I3aAjg
--HG--
extra : rebase_source : 5bd43d723a3170864dd7ac05c9101aaedd7dfac6