Commit Graph

148 Commits

Author SHA1 Message Date
Masayuki Nakano
fc0a220bac Bug 1863759 - Make IMEStateManager recreate IMEContentObserver if the active one is not observing editable content of focused element r=smaug,m_kato
The test case is a special case that changes focused element from a text control
to an editing host.  Therefore, without a focus change, focused editor is
changed from a `TextEditor` to `HTMLEditor`.  At this time, `IMEContentObserver`
needs to switch the observing target from the anonymous content if `<input>` to
children of it.

However, the editable content becomes completely changed without a focus change
in the DOM.  Therefore, `IMEStateManager` needs to synthesize a fake focus move
for IME.  Therefore, this patch make `IMEStateManager` recreate
`IMEContentObserver` if active one is not observing editable content for the
focused element under "current" conditions at checking it.  (When
`IMEContentObserver` is being destroyed, it sends "blur" notification to IME
and the new `IMEContentObserver` instance posts "focus" notification with
all editable content data.  I.e., recreating `IMEContentObserver` generates
a fake focus move from IME point of view.)

Additionally, there is the opposite case, that is, editing host of an `<input>`
whose type is not a text control may become a text control.  Therefore, this
adds new WPTs to check the handler is the text editor for the text control or
the HTML editor.  The tests passed on Firefox and Chrome at least.

FYI: I guess that in this case, we need to kick `focus` event listener of the
`HTMLEditor`, but anyway, users cannot change the content because it's the
case that an atomic content is the editing host.  Therefore, I don't touch
about that in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D193262
2023-12-05 02:33:18 +00:00
Masayuki Nakano
eb247ba054 Bug 1858804 - Make TextControlState::GetIMEContentObserver() return nullptr if it observes for HTMLEditor r=smaug
`<input>` and `<textarea>` can be an editing host.  If so, setting focus to
the elements causes `IMEContentObserver` observing HTML editing under the
text control element instead of observing the native anonymous tree for the
elements.  Therefore, if `IMEContentObserver` observes it with `HTMLEditor`,
it does not need to notify `IMEContentObserver` of the `value` changes.

Differential Revision: https://phabricator.services.mozilla.com/D191163
2023-10-18 07:36:34 +00:00
Masayuki Nakano
c8594cbaac Bug 1850645 - Make TextControlState use nsAutoString r=smaug
Currently, the type of `AutoTextControlHandlingState::mSettingValue` is
`nsString`, but it's a stack only class, and if the string buffer is
refcountable, `nsTAutoStringN(const substring_type&)` avoid copying the
memory anyway.
https://searchfox.org/mozilla-central/rev/fccd8c0ac998c4c624b6c255e621d36f72cabe01/xpcom/string/nsTString.h#295
https://searchfox.org/mozilla-central/rev/fccd8c0ac998c4c624b6c255e621d36f72cabe01/xpcom/string/nsTSubstring.cpp#504,513-514,517

So, it should be `nsAutoString` in any cases.  Therefore, this patch changes the
type and fix similar points in `TextControlState.cpp`.

Differential Revision: https://phabricator.services.mozilla.com/D188682
2023-09-21 01:03:37 +00:00
Emilio Cobos Álvarez
96290c11e1 Bug 1851730 - Pass known value to PrepareEditor() when deferring preparation. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D187981
2023-09-13 09:05:51 +00:00
Emilio Cobos Álvarez
3e9e56e2c8 Bug 1850293 - Make editable states not intrinsic. r=smaug,masayuki
This one is tricky because form controls, though I think I got it right...

This fixes a pre-existing bug where we're not following the spec for readonly
inside content-editable.

I filed this as bug 1850390 but other browsers match the spec so add a test and
fix it while at it. This allows cheaper checks for readonlyness in a couple
places.

Differential Revision: https://phabricator.services.mozilla.com/D186896
2023-08-30 09:18:31 +00:00
Logan Rosen
847ac3aef0 Bug 1091187 - remove unused arguments and check from UpdateCommands r=dom-core,webidl,masayuki,smaug
Differential Revision: https://phabricator.services.mozilla.com/D185385
2023-08-10 04:09:08 +00:00
Jan-Niklas Jaeschke
44a2887100 Bug 1842546 - Removed dom.input_events.beforeinput.enabled pref. r=dom-core,webidl,smaug,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D183578
2023-07-17 08:50:11 +00:00
Emilio Cobos Álvarez
e7d711fad5 Bug 1842027 - Don't localize <input type=number>'s default value unless for display. r=masayuki
This avoids a lot of useless time on things like GetValueAsDecimal(),
where we get the default value as a string, parse it as a number for
sanitization reasons, localize it to a string, just to parse it back to
a number.

Differential Revision: https://phabricator.services.mozilla.com/D183284
2023-07-12 16:55:36 +00:00
Emilio Cobos Álvarez
35a7e91f1f Bug 1842027 - Make <input type=number> localization faster. r=masayuki
Using the fast unlocalized parser first exposes a subtle difference
between the ICU parser (which uses `double`), and Decimal::fromString
(which has a larger range).

Check for iee754 finiteness explicitly, matching our previous behavior,
and the expectation of this subtest:

  https://searchfox.org/mozilla-central/rev/a3852ea8db25c759bc8b108aeec870d66c95452c/testing/web-platform/tests/html/semantics/forms/the-input-element/number.html#33

That check matches this Blink code:

  https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:third_party/blink/renderer/core/html/parser/html_parser_idioms.cc;l=103;drc=0d1bbe8de137aaae7c956a33249eb840a0191627

This patch avoids a bunch of number->string->number conversions in the
common case where the value comes from the value attribute and thus
parses fine without localization shenanigans.

Differential Revision: https://phabricator.services.mozilla.com/D183254
2023-07-12 15:28:07 +00:00
Emilio Cobos Álvarez
8511de0242 Bug 1842027 - Remove nsTextControlFrame::TextEquals. r=masayuki
It is always called from TextControlState, and always ends up in
TextControlState::ValueEquals, so we can avoid some indirection and just
use that.

Depends on D183282

Differential Revision: https://phabricator.services.mozilla.com/D183283
2023-07-12 08:58:09 +00:00
Masayuki Nakano
c6c4a18798 Bug 1839553 - Move EditorBase::IsInPlaintextMode() to HTMLEditor with renaming to IsPlaintextMailComposer() r=m_kato
Now, most users of `EditorBase::IsInPlaintextMode()` are `HTMLEditor` itself.

There are some exceptions:

`EditorBase::GetDesiredSpellCheckState()` uses it to consider whether the root
(`<body>` if `HTMLEditor`) element's `specllcheck` attribute should be referred
or document's editing state.  I think that this should just check
`IsHTMLEditor()`, but I think it must be okay to keep this as-is for now.

`EditorEventListener::KeyUp()` uses it to consider whether `Ctrl` + left/right
`Shift` switches the text direction of the editing host if and only if user
installed both LTR/RTL keyboard layouts and running in Windows.  I think that
this should keep working in plaintext mail composer because nobody can control
the direction in plaintext editor.  Therefore, this needs to check either
`IsTextEditor()` or `IsPlaintextMailComposer()` returning `true`.

`EditorEventListener::DragEventHasSupportingData()` uses it to consider
whether the editor accepts styled text and files.  Therefore, it needs to check
either `IsTextEditor()` or `IsPlaintextMailComposer()` returning `false`.

Finally, we can stop setting `nsIEditor::eEditorPlaintextMask` to `TextEditor`.

Differential Revision: https://phabricator.services.mozilla.com/D181866
2023-06-28 01:01:12 +00:00
Emilio Cobos Álvarez
529c9ee321 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Masayuki Nakano
df1a0740c5 Bug 1836806 - Make TextControlState::SetValueWithoutTextEditor() notify IMEContentObserver of value changes even if it has a bounding frame r=smaug
This is an edge case which couldn't be fixed in bug 1835353.

In the testcase, `TextControlState` has new frame for the new
`<input type="number">` when its `stepUp()` is called.  However, its
`TextEditor` has not been recreated yet because it's not safe yet.  Therefore,
`SetValueWithoutTextEditor()` is called, but I added the new path notifying
`IMEContentObserver` of the value changes does not run if `mBoundFrame` is not
`nullptr`.  I don't remember why I did so (probably for avoiding performance
regressions as far as possible), but it does not make sense not to notify
`IMEContentObserver` if only `mTextEditor` has not been recreated because
`IMEStateManager` has not been reinitialized `IMEContentObserver` with new
anonymous `<div>`s yet because it requires new `TextEditor` instance.

Differential Revision: https://phabricator.services.mozilla.com/D180767
2023-06-14 01:26:33 +00:00
Masayuki Nakano
0315ba415c Bug 1835353 - Make TextControlState notify IMEContentObserver of setting new value during no frame r=smaug
`IMEContentObserver` can observe the value changes only while the text control
has anonymous `<div>` element because it observers the DOM mutation.  The
anonymous `<div>` is alive (connected) only while the text control element
has a frame (recreated at each reframe).  Therefore, `IMEContentObserver`
cannot observe the value changed during reframing.

This patch makes `TextControlState` notify `IMEContentObserver` of setting
new value directly only when it does not have `mBoundFrame`.

Differential Revision: https://phabricator.services.mozilla.com/D179358
2023-05-31 12:11:44 +00:00
Masayuki Nakano
43b4d25d74 Bug 1833264 - Enable undo/redo in password fields r=m_kato
It was intentionally disabled in bug 271154 in 2004 for protecting users use
PC in public spaces.  However, in these days, only protecting from undo
transactions is not enough and most users must use smart phones instead.
Therefore, let's revert the change for compatibility with the other browsers.

Differential Revision: https://phabricator.services.mozilla.com/D178904
2023-05-26 00:13:35 +00:00
Emilio Cobos Álvarez
aa1abbe381 Bug 1833181 - Avoid attr lookups to check whether input value is empty. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D178078
2023-05-15 17:16:41 +00:00
Emilio Cobos Álvarez
c18930d41f Bug 1833181 - Make SetValueChanged return void. r=smaug
Just a drive-by clean-up.

Differential Revision: https://phabricator.services.mozilla.com/D178077
2023-05-15 16:07:30 +00:00
Masayuki Nakano
f916198a3e Bug 1826272 - Make the content process crash if TextControlState becomes odd state r=m_kato
If `TextControlState:mTextListener` is set to `nullptr`, at least one of
`TextControlState::mBoundFrame` or `TextControlFrame::mTextEditor` must be
set to `nullptr`.  Therefore, when `TextControlState` realizes the odd state,
it should crash immediately.  Then, we can investigate how to reproduce the
situation from crash reports.

Differential Revision: https://phabricator.services.mozilla.com/D174944
2023-04-10 23:59:09 +00:00
Daniel Holbert
dbc431214c Bug 1797148: Simplify checkVisibility API (on nsISelectionController and nsIFrame) into a single nsTextFrame::HasVisibleText method. r=masayuki
Before this patch, we had two `checkVisibilty` methods on the
nsISelectionController interface, backed by several layers of implementation,
ultimately backed by a single function on nsTextFrame (which didn't actually
do anything meaningful with any of the parameters).

As it turns out, this API only had one caller, in HTMLEditUtils.cpp.

This patch converts that caller to directly query nsTextFrame (if the given
node's primary frame is indeed a nsTextFrame).  The direct function-call is
renamed to HasVisibleText(), to be a bit clearer about it being text-specific
and also to avoid confusion with the (unrelated) recently-specified HTML
checkVisibility() API.

With these changes, we can remove the API from the nsISelectionController
interface and its implementations.

This patch also updates the HTMLEditUtils::IsInVisibleTextFrames documentation
(with s/all/any/) to reflect the reality of what the nsTextFrame impl actually
does.

Differential Revision: https://phabricator.services.mozilla.com/D160563
2022-10-28 17:56:04 +00:00
Kagami Sascha Rosylight
512d527cf6 Bug 1785739 - Ensure the editor is initialized in RestoreSelectionState r=masayuki
Before D99291	the initialization was always done via SetSelectionRange because IsDirty was always true after input construction (because SetValue always set the flag regardless of whether actual change happened). Now the flag is always false initially, so we need to explicitly initialize the editor.

Differential Revision: https://phabricator.services.mozilla.com/D154995
2022-08-19 18:42:39 +00:00
Emilio Cobos Álvarez
e91e250f89 Bug 1776909 - Simplify TextControlState reuse. r=smaug
Bug 1776896 happened because we have manual code to cleanup every member
for reuse. Instead, reuse the individual block of memory and use the
destructor to clean up.

Differential Revision: https://phabricator.services.mozilla.com/D150489
2022-06-28 20:34:44 +00:00
Emilio Cobos Álvarez
79db059f04 Bug 1776896 - Clear mLastInteractiveValue when releasing TextControlState objects.
Differential Revision: https://phabricator.services.mozilla.com/D150487
2022-06-28 17:20:10 +00:00
Emilio Cobos Álvarez
35e57869d6 Bug 1771806 - Record last interactive value in TextControlState. r=masayuki
One unfortunate-ish thing of storing it in TextControlState is that we
can't preserve it across type changes, but that seems ok for now
according to my conversations with Serg.

In the future we might want to move the value to HTMLInputElement itself
or something, we'll see, but this should help folks fix some
long-standing quality issues in the password manager / autofill
implementation.

Differential Revision: https://phabricator.services.mozilla.com/D150148
2022-06-28 08:49:12 +00:00
Emilio Cobos Álvarez
e9fdb811f2 Bug 1776238 - Pack TextControlState a bit better. r=masayuki
I've confirmed that with this we can add a new string without going over
the current limit of 128 bytes here:

  https://searchfox.org/mozilla-central/rev/6d0ba065e3d41822337c708c8c0aca334ddd9218/dom/html/TextControlState.cpp#1426

Differential Revision: https://phabricator.services.mozilla.com/D150145
2022-06-24 05:41:01 +00:00
Masayuki Nakano
22aa786ab3 Bug 1753508 - Add logger of selection batch r=smaug
This was required for debugging the bug.

Differential Revision: https://phabricator.services.mozilla.com/D139350
2022-03-11 02:24:24 +00:00
Masayuki Nakano
a8c2bbc3f0 Bug 1191862 - part 1: Make nsIWidget::NativeKeyBindingsType independent from nsIWidget and defined in an independent header file r=smaug
I'd like to use it in `IMEData.h`.  However, adding new include into it may
cause bustage with MinGW, and it's included by `nsIWidget.h` because `nsIWidget`
requires some classes defined in `IMEData.h`.  Therefore, I'd like to make a
new header file for avoiding the include hell.

Differential Revision: https://phabricator.services.mozilla.com/D138007
2022-02-15 08:00:05 +00:00
Masayuki Nakano
1ebfc35bf2 Bug 1743346 - Make TextInputHandler::HandleEvent handle native key bindings first, then, our shortcut keys r=smaug
Oddly, `TextInputHandler` which is keyboard event handler for
`<input type="text">` and `<textarea>` handles our shortcut keys
first, then, refer native key bindings.  So if a key combination
matches in both definitions, our shortcut key wins.

On the other hand, if `HTMLEditor` has focus, `keypress` event
listener on the `Document` node hanldes native key bindings:
https://searchfox.org/mozilla-central/rev/70b32246fce5ca1f53af573a21c1939df58cb969/editor/libeditor/EditorEventListener.cpp#641-644

Then, global key listener will be run later:
https://searchfox.org/mozilla-central/rev/70b32246fce5ca1f53af573a21c1939df58cb969/dom/events/GlobalKeyListener.cpp#163-164

Perhaps, it's better to refer native key bindings first because
unusual shortcut key definition must be caused by customization
by the user in the system level.

Therefore, this patch makes the order switchable with the new
pref for making it easier to back it out.

Differential Revision: https://phabricator.services.mozilla.com/D132451
2021-12-03 11:57:29 +00:00
Masayuki Nakano
2ae66680b2 Bug 1735745 - Make SelectionChangeEventDispatcher dispatch select event and selectchange event only when there may be corresponding event listeners r=smaug
`select` event on text controls now dispatched immediately before
`selectionchange`.  However, it needs to create `AsyncEventDispatcher` for
each.  This cost may not be expensive, but they are called really a lot even
if there is no corresponding event listener.

Therefore, this patch makes `nsPIDOMWindow` and `EventListenerManager` have
`MayHave*EventListeners` flag separately for each, and makes
`SelectionChangeEventDispatcher` does not try to do create
`AsyncEventDispatcher` when there is no corresponding event listener.

Differential Revision: https://phabricator.services.mozilla.com/D131750
2021-11-25 07:09:23 +00:00
Edgar Chen
92a1fc095f Bug 1556351 - Part 3: Rename nsGenericHTMLFormElementWithState to nsGenericHTMLFormControlElementWithState; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124786
2021-10-04 20:51:26 +00:00
Edgar Chen
cd1f327b86 Bug 1729358 - Part 1: Move FocusState to TextControlElement; r=smaug
And convert FocusTristate to enum class.

Differential Revision: https://phabricator.services.mozilla.com/D124693
2021-09-07 09:47:09 +00:00
Kagami Sascha Rosylight
bda51c1d58 Bug 1648944 - Part 2: Fire selectionchange at document from text controls r=masayuki,smaug
Differential Revision: https://phabricator.services.mozilla.com/D86701
2021-07-20 13:46:44 +00:00
Kagami Sascha Rosylight
c13d219483 Bug 1648944 - Part 1: Split select event flags into each event name r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D86700
2021-07-20 13:46:44 +00:00
Brindusan Cristian
0c4fbf4b49 Backed out 5 changesets (bug 1648944) for causing wpt failures in idlharness.window.html.
CLOSED TREE

Backed out changeset 598789cabb9f (bug 1648944)
Backed out changeset f464507bef57 (bug 1648944)
Backed out changeset fb2b9ceb7c69 (bug 1648944)
Backed out changeset a73cfada74cf (bug 1648944)
Backed out changeset 3f41877ffd14 (bug 1648944)
2021-07-20 13:29:49 +03:00
Kagami Sascha Rosylight
3dc848256c Bug 1648944 - Part 2: Fire selectionchange at document from text controls r=masayuki,smaug
Differential Revision: https://phabricator.services.mozilla.com/D86701
2021-07-20 08:59:47 +00:00
Kagami Sascha Rosylight
dff494f1a7 Bug 1648944 - Part 1: Split select event flags into each event name r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D86700
2021-07-20 08:59:47 +00:00
Masayuki Nakano
2eac55a01e Bug 1676702 - part 3: Make TextControlState store unmasked range while it does not have TextEditor r=m_kato
`TextControlState` is alive during reframing, but `TextEditor` is not so.
Therefore, `TextControlState` should take the `PasswordMaskData` before
`TextEditor` is destroyed.  And if `TextEditor` is recreated, and the value
hasn't been modified, unmasked range should be restored in the new editor.

Depends on D118757

Differential Revision: https://phabricator.services.mozilla.com/D118758
2021-06-28 04:37:54 +00:00
Masayuki Nakano
b224f9cb5b Bug 1676702 - part 2: Make TextControlState initialize TextEditor with PasswordMaskData r=m_kato
During a `TextControlState` alive, `PasswordMaskData` should be alive too.
Otherwise, we cannot keep unmasked range at reframing.

Depends on D118756

Differential Revision: https://phabricator.services.mozilla.com/D118757
2021-06-28 04:37:54 +00:00
Masayuki Nakano
569104c02d Bug 1717156 - part 6: Get rid of nsIEditor::eEditorDontEchoPassword r=m_kato
It's used only by password field, i.e., only by `TextEditor`, and used
temporarily.  Additionally, there is some space in `TextEditor`.  So, we
can get rid of it, and make `TextEditor` store it directly.

Note that this allows to skip expensive `nsIEditor::SetFlags()` calls by
`AutoRestoreEditorState`.  This may improve setting `<input>.value` performance.

Differential Revision: https://phabricator.services.mozilla.com/D118266
2021-06-22 00:18:08 +00:00
Masayuki Nakano
d6c4790121 Bug 1717156 - part 2: Get rid of nsIEditor::eEditorWidgetMask and its accessor r=m_kato
With the previous patch, we know `nsIEditor::eEditorWidgetMask` always
matches with `EditorBase::IsTextEditor()`.  And it's not referred from JS
(including comm-central and BlueGriffon).  So, we can get rid of it.

Differential Revision: https://phabricator.services.mozilla.com/D118262
2021-06-22 00:18:06 +00:00
Kagami Sascha Rosylight
7fe1ff4e91 Bug 1677253 - Part 1: Fire select event from SelectionChangeEventDispatcher r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D101245
2021-06-21 00:58:35 +00:00
Ryan VanderMeulen
4c53d4eb06 Backed out 3 changesets (bug 1677253) because it depends on bug 1713334 which was backed out.
Backed out changeset 3d30a54409a7 (bug 1677253)
Backed out changeset 1c385b21e0e5 (bug 1677253)
Backed out changeset eb6001404a57 (bug 1677253)
2021-06-17 11:38:53 -04:00
Kagami Sascha Rosylight
362dd7af5e Bug 1677253 - Part 1: Fire select event from SelectionChangeEventDispatcher r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D101245
2021-06-16 11:13:14 +00:00
Kartikaya Gupta
7c375a1189 Bug 1694847 - Remove the expired SCROLL_INPUT_METHODS telemetry probe. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D116320
2021-05-31 21:36:35 +00:00
Masayuki Nakano
9566ff5659 Bug 1540037 - part 18: Move ReplaceTextAsAction() and ReplaceSelectionAsSubAction() to EditorBase r=m_kato
They are used by setting text value of `TextEditor` or replacing a misspelled
word with a new word in both `TextEditor` and `HTMLEditor`.  Therefore,
they should be in the `EditorBase` rather than `TextEditor`.

Note that the path of the former case may be in a hot path.  Therefore, we need
to keep redirecting to `TextEditor` for keeping the performance only in the
case.

Depends on D115785

Differential Revision: https://phabricator.services.mozilla.com/D115786
2021-05-25 04:26:14 +00:00
Kagami Sascha Rosylight
55be2e6e45 Bug 1712255 - Defer SetMaxLength in SetValueFromSetRangeText r=masayuki
Capping selection range in SetValue early makes the subsequent SetSelectionRange call unable to detect actual selection range change. This patch defers it so that select events can be consistently fired.

Differential Revision: https://phabricator.services.mozilla.com/D115729
2021-05-24 03:11:27 +00:00
Emilio Cobos Álvarez
e1e13fa181 Bug 1698315 - Manage placeholder and autofill preview visibility using CSS rather than custom code. r=masayuki
Should be much simpler and doesn't need to deal with the different
stuff. We already have pseudo-classes for this, :autofill and
:placeholder-shown.

I initially wrote this because this is the only limitation that forces
us to have the placeholder text as a direct child of the text control
frame. In the end I kept that as-is, but this simplification is still
worth it.

We remove dom.placeholder.show_on_focus because it doesn't behave
correctly (it doesn't match the :placeholder-shown pseudo-class and it
should). It was introduced in bug 807613 and never turned to false by
default. I suspect nobody will miss this, but if somebody complains
about it we can reintroduce it properly (handling the pref in DOM
instead, changing the right state bits).

Differential Revision: https://phabricator.services.mozilla.com/D108304
2021-03-15 08:52:43 +00:00
Chris Peterson
5ac4034b03 Bug 1691889 - Replace MOZ_MUST_USE with [[nodiscard]] in dom/. r=peterv
The MOZ_MUST_USE macro is defined as clang's and gcc's nonstandard __attribute__((warn_unused_result)). Now that we compile as C++17 by default (bug 1560664), we can replace MOZ_MUST_USE with C++17's standard [[nodiscard]] attribute.

The [[nodiscard]] attribute must precede a function declaration's declaration specifiers (like static, extern, inline, or virtual). The __attribute__((warn_unused_result)) attribute does not have this order restriction.

Differential Revision: https://phabricator.services.mozilla.com/D107355
2021-03-10 08:19:25 +00:00
Kagami Sascha Rosylight
7057dbdc56 Bug 1671768 - Part 4: Use MOZ_CAN_RUN_SCRIPT for Selection::RemoveAllRanges r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D103780
2021-02-03 21:52:48 +00:00
Masayuki Nakano
71edddfad2 Bug 1685491 - part 5: Move the code remapping arrow keys in vertical content to NativeKeyBindings r=smaug,jfkthame
Currently, this feature is implemented only on Linux and macOS (see also
bug 1077515 and bug 1301497), and the code is really similar each other.
Additionally, it always tries to query selection to check whether the caret is
in vertical content or not if arrow keys are pressed.  For avoiding a lot of
query, this patch makes `TextEventDispatcher` cache writing mode at every
selection change notification.  However, unfortunately, it's not available when
non-editable content has focus, but it should be out of scope of this bug since
it requires a lot of changes.

Anyway, with this patch, we can write a mochitest only on Linux and macOS.
The following patch adds a test for this as a fix of bug 1103374.

Differential Revision: https://phabricator.services.mozilla.com/D102881
2021-02-02 03:29:31 +00:00
Mirko Brodesser
3cef08a463 Bug 1685303: part 10) Annotate nsFrameSelection::HandleClick with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101598
2021-01-14 13:24:36 +00:00