`nsTextFragment` is a storage of data node and DOM offset is `uint32_t`, but
some methods of `nsTextFragment` takes `int32_t` for the offset/length in
its text. Therefore, callers need to cast from `uint32_t` to `int32_t` if
the offset value is offset in a DOM node. Therefore, all methods of it should
take `uint32_t` values as offset/length in its text.
Differential Revision: https://phabricator.services.mozilla.com/D127923
By default nsIPermissionManager will not persist data in private browsing.
There are cases however, like private-only-browser Firefox Focus, where we
would want to be able to persist tracking protection exceptions permanently.
This patch adds a new method called
`addFromPrincipalAndPersistInPrivateBrowsing` which allows setting permanent
permissions in private browsing..
Differential Revision: https://phabricator.services.mozilla.com/D126544
extensions/permissions/PermissionManager.cpp:2468:12: error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
return NS_OK;
^~~~~
Differential Revision: https://phabricator.services.mozilla.com/D126875
Currently, `mozInlineSpellChecker` handles events in the default group. This
means that the listener may not run if web app stops the propagation. For
keeping the event listener order as far as possible, this patch changes to
listen to the event at capturing phase in the system group (editor handles
the events at bubbling phase in the system group).
Additionally, it listens to `keypress` events for handling caret/selection
changes. However, they should be handled at `keydown` because those keys
are not printable. Therefore, this patch changes to listen to `keydown`
events, but this could change the race between running the scheduled spellcheck
and following `keypress` event which is dispatched only for chrome code and
C++ event listeners. However, this may not change it actually because the
race is changed only when the following `keypress` event delays too much.
https://searchfox.org/mozilla-central/rev/2eebd6e256fa0355e08421265e57ee1307836d92/extensions/spellcheck/src/mozInlineSpellChecker.cpp#503-504
Differential Revision: https://phabricator.services.mozilla.com/D126635
`TextServicesDocument::LastSelectedBlock()` may return `NS_OK` with
`UINT32_MAX` for both offset and length of the block. The assertions causes
the new test not runnable in debug build. So, we should make the situation
as an error case if they are required.
Ideally, we should fix the odd behavior, but it's not safe for uplift.
Therefore, this patch just adds the wallpapers.
Depends on D123282
Differential Revision: https://phabricator.services.mozilla.com/D123283
By bug 1719110, we replace sync IPC's spell checker suggestion with async
version. So we should remove this sync IPC call.
Differential Revision: https://phabricator.services.mozilla.com/D122579
CheckCurrentWord on content process causes sync IPC, so I would like to remove
this call on content process. New nsIEditorSpellChecker.suggest method can
avoid it.
Differential Revision: https://phabricator.services.mozilla.com/D119937
When getting suggestions from spellchecker's result, we use sync IPC
(`PRemoteSpellcheckEngine.CheckAndSuggest`). This is used by showing context
menu only on Gecko. So I think that we can remove this IPC if we add async API
to get spellchecker suggestions.
And in comm-central's code, `CheckCurrentWord` and `GetSuggestedWord` seems to
use on spellchecker dialog (content/dialogs/EdSpellCheck.js in mail and suite)
that runs on parent process. So c-c won't use this IPC method.
So I would like to add the promise version of getting spellchecker's
suggestion.
Differential Revision: https://phabricator.services.mozilla.com/D119936
For every cookie permission check CookieJarSettings::CookiePermission has to create a new principal.
This is slow. It uses a cloned principal so it can strip the origin attributes which should not be
used for the permission check.
With this patch we no longer need to clone the principal. We pass in the original principal and perform
the OA stripping on an OA copy in BasePrincipal::EqualsForPermission.
Before, EqualsForPermission was guaranteed to get a content principal, because ClonePrincipalForPermission
enforced it. BasePrincipal::EqualsForPermission was refactored to account for non content principals.
Differential Revision: https://phabricator.services.mozilla.com/D120834
Removing ranges is expensive. This reduces flickering of the spelling
mistakes and prevents 100% CPU usage of 1 core on slower machines.
The essence of this patch is, that when text doesn't change, all
existing spellchecking ranges are reused.
Before this patch, removing ranges was done as part of the time slice in
`mozInlineSpellChecker::SpellCheckSlice`. That is, slow removals of
ranges contributed to the amount of words to be spellchecked
asynchronously.
Therefore, the amount of words to be spellchecked in one chunk could
increase from the minimum, `INLINESPELL_MINIMUM_WORDS_BEFORE_TIMEOUT` to
the maxium `INLINESPELL_MAXIMUM_CHUNKED_WORDS_PER_TASK`.
Consequently, the asynchronous checking might take longer. If that turns
out to be problematic, reducing
`INLINESPELL_MAXIMUM_CHUNKED_WORDS_PER_TASK` could be a fix.
Differential Revision: https://phabricator.services.mozilla.com/D116096
This might lead to increased exceeding of the time slice, because the
ranges are removed after the time limit was checked. Therefore, this
change should only be landed together with the following review which
will remove unnecessary remove- and add-operations for ranges. It's a
separate review only to simplify reviewing and potential debugging.
Differential Revision: https://phabricator.services.mozilla.com/D116095
The fix of bug 1687263 will require determining which `nsRange`s of a
previous time slice to keep and for which `NodeOffsetRange`s to create
new `nsRange`s. The operator will be used in a following review.
Differential Revision: https://phabricator.services.mozilla.com/D116094