Commit Graph

11716 Commits

Author SHA1 Message Date
Masayuki Nakano
c13abd36f2 Bug 1915057 - Make HTMLEditor::NotifyRootChanged() notifies IMEStateManager of the editor root change r=smaug,m_kato
When `HTMLEditor` handles the design mode, `IMEContentObserver` observes the
`<body>` if there is.  However, web apps may remove it.  Then, we need to
recreate `IMEContentObserver` with emulating a focus move because it's difficult
to compute the difference between the old root and the new root (IME focus
notification sends all content to the parent, it's faster in most cases in this
situation). This was fixed in bug 1911010.  However, there are remaining issues
after that.

When new `<body>` or the original `<body>` is connected again,
`IMEContentObserver` does not restart to observe the new `<body>`.  So,
`IMEContentObserver` working differently after the `<body>` is even temporarily
removed.  This make it harder to reproduce reported bugs.

Additionally, if the document element is removed, `IMEContentObserver` won't
be recreated until the document gets focus again even after new root and/or
`<body>` element is connected.  This makes IME users inconvenient with such
tricky editors.

This patch makes `HTMLEditor::NotifyRootChanged` notifies `IMEStateManager`
of the editor root element change.  Then, the new method of `IMEStateManager`
updates IME enabled state and recreate `IMEContentObserver` with emulating
a focus move.

Differential Revision: https://phabricator.services.mozilla.com/D220362
2024-09-05 00:35:50 +00:00
Norisz Fay
31c9c0f6e5 Backed out changeset 3138300cf7c8 (bug 1916081) for causing Wc failures on replace_documentElement_children_after_window_closed.html CLOSED TREE 2024-09-04 06:58:57 +03:00
Masayuki Nakano
3f1398db93 Bug 1916081 - Make HTMLEditor::FocusedElementOrDocumentBecomesNotEditable stop using aHTMLEditor at adjusting IME state r=m_kato
`aHTMLEditor` may be `nullptr` and there may have been an `HTMLEditor` before
it's called.  Therefore, it may need to adjust IME state even if `aHTMLEditor`
is `nullptr`.  So, it should adjust IME state from `aDocument` which should be
same as `aHTMLEditor->GetDocument()` if `aHTMLEditor` is not `nullptr`.

Note that if `IMEStateManager` thinks another `nsPresContext` has focus, it does
not touch IME state.  Therefore, it's safe to skip checking the focus state of
the `Document`.

Differential Revision: https://phabricator.services.mozilla.com/D220772
2024-09-04 01:57:51 +00:00
Olli Pettay
e1fad67026 Bug 1914513 - Add a pref to disable mutation events, r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D219934
2024-09-02 13:29:57 +00:00
Masayuki Nakano
b546eb7e32 Bug 1911010 - Make IMEContentObserver observe ParentChainChanged and let IMEStateManager know that r=smaug
`mozAutoDocUpdate` does not make it in a document change when container node
of `insertBefore` has already been removed from the tree.  Therefore, once
`IMEContentObserver::mRootElement` is removed from the DOM tree without a
focus move, `IMEContentObserver` is notified mutations not in a document change.

Similar situations are handled in `IMEStateManager::OnRemoveContent` with
emulating a focus change and that will destroy the active `IMEContentObserver`.
Therefore, if `IMEContentObserver::mRootElement` is removed, we should emulate
a focus move when `IMEStateManager` does not have focused element but there
is active `IMEContentObserver` (that means it is/was in the design mode).

However, checking whether the removed node contains the observing node of the
active `IMEContentObserver` may be expensive.  So, doing expensive things in
`IMEStateManager::OnRemoveContent` may make mutations slower.  Therefore, this
patch makes `IMEContentObserver` observe `ParentChainChanged` and it let
`IMEStateManager` know that with calling its
`OnParentChainChangedOfObservingElement`.  Finally, it calls
`IMEStateManager::OnRemoveContent` to emulate "blur" (and refocus if it's
required).

Differential Revision: https://phabricator.services.mozilla.com/D218696
2024-08-27 07:55:26 +00:00
Stanca Serban
ada4e189a4 Backed out changeset 125344f9e446 (bug 1911010) for causing linux bustages in nsINode.cpp. 2024-08-27 07:54:54 +03:00
Masayuki Nakano
b9ef2f71b3 Bug 1911010 - Make IMEContentObserver observe ParentChainChanged and let IMEStateManager know that r=smaug
`mozAutoDocUpdate` does not make it in a document change when container node
of `insertBefore` has already been removed from the tree.  Therefore, once
`IMEContentObserver::mRootElement` is removed from the DOM tree without a
focus move, `IMEContentObserver` is notified mutations not in a document change.

Similar situations are handled in `IMEStateManager::OnRemoveContent` with
emulating a focus change and that will destroy the active `IMEContentObserver`.
Therefore, if `IMEContentObserver::mRootElement` is removed, we should emulate
a focus move when `IMEStateManager` does not have focused element but there
is active `IMEContentObserver` (that means it is/was in the design mode).

However, checking whether the removed node contains the observing node of the
active `IMEContentObserver` may be expensive.  So, doing expensive things in
`IMEStateManager::OnRemoveContent` may make mutations slower.  Therefore, this
patch makes `IMEContentObserver` observe `ParentChainChanged` and it let
`IMEStateManager` know that with calling its
`OnParentChainChangedOfObservingElement`.  Finally, it calls
`IMEStateManager::OnRemoveContent` to emulate "blur" (and refocus if it's
required).

Differential Revision: https://phabricator.services.mozilla.com/D218696
2024-08-27 00:39:49 +00:00
Masayuki Nakano
66d2f119a5 Bug 1906559 - Make AutoInlineStyleSetter::OnHandled() never set point in aContent if it's not a container r=m_kato
When `HTMLEditor::InsertLinkAroundSelectionAsAction()` calls
`HTMLEditor::SetInlinePropertiesAsSubAction()`, it adds 2 elements to the array.
One is for `_moz_dirty` attribute and the other is for `href` attribute because
`InsertTagCommand::DoCommandParam()` uses
`HTMLEditor::CreateElementWithDefaults()`.

Then, `HTMLEditor::SetInlinePropertiesAsSubAction()` wraps the `<img>` into
`<a _moz_dirty="">` with calling `AutoInlineStyleSetter::ApplyStyle()`. Then,
it calls `OnHandle()` with the `<img>` and it collapse the applied range into
the `<img>`.  Therefore, when `SetInlinePropertiesAsSubAction()` handles `href`,
there is only collapsed range and it just puts the style into the cache for
applying the style when the user types new text.

So, first, `OnHandle()` should not set the boundary points of the applied range
into non-container node. And also `InsertLinkAroundSelectionAsAction()` should
ignore `_moz_dirty` attribute because if it's truly required,
`AutoInlineStyleSetter` should set the attribute to every new element.

Note that this causes new failure in `editing/run/fontname.html?1001-200`,
but it was accidentally passed.  The case is, `queryCommandValue("fontname")`
result after calling `execCommand("fontname", false, "sans-serif")` for
`foo<tt>{<br></tt>}bar`.  The result of the DOM tree is
`foo<tt><font face="sans-serif"><br></font></tt>bar` and `Selection` was
collapsed in the `<br>` before, but with this patch, the `<br>` is selected.
Therefore, the result is changed but similar cases in the tests fail too. So I
believe that it accidentally passed with odd `Selection`.

Differential Revision: https://phabricator.services.mozilla.com/D219127
2024-08-19 00:35:33 +00:00
Masayuki Nakano
a895c665da Bug 1910800 - Make HTMLEditor::ComputeEditingHostInternal() stop referring mIsInDesignMode and refer focused element in the window r=m_kato
The method may be called without focus.  Therefore, it shouldn't refer
`mIsInDesignMode` and it should refer focused element in the window (including
shadows) if there is no selection ranges.

Differential Revision: https://phabricator.services.mozilla.com/D218726
2024-08-13 00:08:58 +00:00
Tom Schuster
52ab587ab4 Bug 1809713 - Make DataTransfer use Maybe<ClipboardType>. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D214585
2024-07-29 11:52:34 +00:00
Tom Schuster
fdabe0cf72 Bug 1809713 - Use ClipboardType in editor. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D214584
2024-07-29 11:52:33 +00:00
Makoto Kato
6b14dceb59 Bug 1149826 - Part 1. Add eContentCommandReplaceText. r=masayuki
When using autocorrect, we should use `insertReplacementText` according
to https://github.com/w3c/input-events/issues/152. So I would like to
add eContentCommandReplaceText command for this.

Also, this command has an option that is source string text. When
processing text subsitution, parent process doesn't know whether
target replaced text is modified. So I add this option for check.

Differential Revision: https://phabricator.services.mozilla.com/D213511
2024-07-26 06:38:52 +00:00
Masayuki Nakano
2cd0487511 Bug 1906727 - Make HTMLEditor::SplitAncestorStyledInlineElementsAt check attr value type first r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D215990
2024-07-25 00:41:49 +00:00
Masayuki Nakano
33a24a0600 Bug 1909577 - Make some nsFocusManager::GetFocusedElement() users use its static version instead r=emilio,credential-management-reviewers,issammani
Now, we have `nsFocusManager::GetFocusedElementStatic()` which returns focused
element if the `nsFocusManager` instance is available.  Therefore, if
`nsFocusManager::GetFocusedElement()` users do not use other methods of
`nsFocusManager`, they can use `nsFocusManager::GetFocusedElementStatic()` and
make themselves simpler.

Note that some callers return early if `nsFocusManager` is not available, but
they do not return error and `nsFocusManager` instance is available in most
time of the life time of the process.  Therefore, we can simply stop using the
early return.

Differential Revision: https://phabricator.services.mozilla.com/D217527
2024-07-25 00:33:58 +00:00
Masayuki Nakano
4ec66e983c Bug 1908239 - Make HTMLEditor::FocusedElementOrDocumentBecomesNotEditable set HTMLEditor::mIsInDesignMode r=m_kato
This is a simple mistake, it does not reset `mIsInDesignMode` when it emulates
a "blur".

Additionally, I realized that it does not check whether the focused element is
in the document or not and emulates "focus" of itself it the focused element is
in a different document.  In such case, the editor shouldn't have focus, so,
this is a hidden bug, but "blur" notification may occur asynchronously.
Therefore, this could be a bug only in some edge cases.

Differential Revision: https://phabricator.services.mozilla.com/D216907
2024-07-22 14:09:34 +00:00
Sylvestre Ledru
45030f6970 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,necko-reviewers,geckoview-reviewers,application-update-reviewers,media-playback-reviewers,devtools-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,migration-reviewers,padenot,mconley,nchevobbe,kershaw,gstoll,mstange,bytesized,m_kato
This new version of clang 17 also slightly changed the formatting.

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D215914
2024-07-17 11:15:31 +00:00
Sean Feng
877a44bc34 Bug 1906388 - Ensure dragend uses the same target as dragstart r=masayuki,dom-core
Since this issue is too obvious, I am not even sure I am doing the right
thing. This looks like it should be discovered years ago....

As far as I can tell from the spec, dragstart and dragend use the same node
as the target, but it's not always the same node in Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D215827
2024-07-16 14:53:18 +00:00
Masayuki Nakano
7288d5710c Bug 1798379 - Make HTMLEditor store whether it has/had focus and is/was in the designMode by itself r=m_kato
`HTMLEditor` currently checks whether it's in the `designMode` or not with
checking the `Document` node is in the `designMode`.  I.e., it checks the
real-time state of the `Document` node.  However, if an instance was in the
`designMode`, it needs to finalize `Selection` even after the `Document` node
becomes not in the `designMode`.  Additionally, elements in a shadow DOM in the
`designMode` can have `contenteditable` to make it editable.  Then, the editable
elements should works as in the `contenteditable` mode rather than in the
`designMode`.  Therefore, current `HTMLEditor::IsInDesignMode()` returns
wrong state when the finalization is called asynchronously or when an editing
host in a shadow DOM whose composed document is in the `designMode`.

This patch fixes known cases of these issues with improving the finalization
(and re-initialization with the new editing mode) and the caller side in
`Document`.

Differential Revision: https://phabricator.services.mozilla.com/D216022
2024-07-12 04:45:01 +00:00
Tamas Szentpeteri
09a574aa90 Backed out changeset 71abd7d91e8f (bug 1798379) for causing bustages related to HTMLEditor.cpp. CLOSED TREE 2024-07-12 03:39:33 +03:00
Masayuki Nakano
88ff425989 Bug 1798379 - Make HTMLEditor store whether it has/had focus and is/was in the designMode by itself r=m_kato
`HTMLEditor` currently checks whether it's in the `designMode` or not with
checking the `Document` node is in the `designMode`.  I.e., it checks the
real-time state of the `Document` node.  However, if an instance was in the
`designMode`, it needs to finalize `Selection` even after the `Document` node
becomes not in the `designMode`.  Additionally, elements in a shadow DOM in the
`designMode` can have `contenteditable` to make it editable.  Then, the editable
elements should works as in the `contenteditable` mode rather than in the
`designMode`.  Therefore, current `HTMLEditor::IsInDesignMode()` returns
wrong state when the finalization is called asynchronously or when an editing
host in a shadow DOM whose composed document is in the `designMode`.

This patch fixes known cases of these issues with improving the finalization
(and re-initialization with the new editing mode) and the caller side in
`Document`.

Differential Revision: https://phabricator.services.mozilla.com/D216022
2024-07-12 00:13:51 +00:00
Masayuki Nakano
518f238fa3 Bug 1906015 - part 2: Make the most do_QueryInterface users for nsIFormControl use new getter methods r=smaug,credential-management-reviewers,sessionstore-reviewers,sclements
Unfortunately, the following QIs are still required.
https://searchfox.org/mozilla-central/rev/cbdfa503a87597b20719aae5f6a1efccd6cb3b7b/dom/html/nsIConstraintValidation.cpp#101,121

Depends on D215576

Differential Revision: https://phabricator.services.mozilla.com/D215577
2024-07-10 00:46:59 +00:00
Otto Länd
f27ae4577c Bug 1893119: apply code formatting via Lando
# ignore-this-changeset
2024-07-04 07:52:52 +00:00
David P
c0b01c8672 Bug 1893119: Part 10 - Move MaybeEditorDeletedSourceNode from nsIDragService to nsIDragSession r=gstoll,masayuki
MaybeEditorDeletedSourceNode was defined on nsIDragService but is more appropriately defined on nsIDragSession.  This was not an issue previously since those were the same object.

Differential Revision: https://phabricator.services.mozilla.com/D211074
2024-07-04 07:48:06 +00:00
David P
18f01ba217 Bug 1893119: Part 5 - Fix coordinates use in dispatchDOMEventViaPresShellForTesting r=masayuki,mconley,places-reviewers,tabbrowser-reviewers,dao
Since we now add the widget to the event in
dispatchDOMEventViaPresShellForTesting, WidgetGUIEvents that are sent in
mochitests via that method need to transform their screen coordinates by
nsIWidget::WidgetToScreenOffset, to mirror the transformation by
BrowserParent::TransformParentToChild that they don't get because they
skip the parent process.

This exposes a bunch of things that were done to work around this bug.  They
are cleaned up here.

Differential Revision: https://phabricator.services.mozilla.com/D211068
2024-07-04 07:48:04 +00:00
David P
207cb76b2a Bug 1893119: Part 3 - Add widget to nsContentUtils::GetDragSession r=gstoll,rkraesig
Updates each client of the nsContentUtils method to get the right drag session -- the one for the widget that is currently the source or target of the drag session.
The change to nsDOMWindowUtils::DispatchDOMEventViaPresShellForTesting() supports the change to WidgetDragEvent::InitDropEffectForTests() and enabled a
large number of test fixes in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D211067
2024-07-04 07:48:04 +00:00
Masayuki Nakano
a9a18ed278 Bug 1892514 - part 5-3: Enable the assertions in IMEContentObserver::FlatTextCache in some automated tests r=smaug
This patch enables the assertions when running:
* The `nsITextInputProcessor` tests
* The IME composition tests under `widget/`
* Under `editor/libeditor/tests`
* Under `editor/libeditor/crashtests`
* Under testing/web-platform/tests/editing`
* Under testing/web-platform/tests/input-events`

Differential Revision: https://phabricator.services.mozilla.com/D211835
2024-07-03 08:04:28 +00:00
Norisz Fay
a67f926110 Backed out 14 changesets (bug 1892514) for causing bustage on IMEContentObserver.cpp CLOSED TREE
Backed out changeset 56d8807b6c36 (bug 1892514)
Backed out changeset 2b9fecca5d45 (bug 1892514)
Backed out changeset 153feaf168c8 (bug 1892514)
Backed out changeset 6042902c7e2f (bug 1892514)
Backed out changeset eb87fcf58d1a (bug 1892514)
Backed out changeset d9cf5bfd4c34 (bug 1892514)
Backed out changeset e65d0b826f1d (bug 1892514)
Backed out changeset 1686b6177ab0 (bug 1892514)
Backed out changeset 6ed15cfce6df (bug 1892514)
Backed out changeset ae6dd25f6e60 (bug 1892514)
Backed out changeset c514cf8a7e6d (bug 1892514)
Backed out changeset beebf7370041 (bug 1892514)
Backed out changeset dd42ed4c05f9 (bug 1892514)
Backed out changeset 71837d871833 (bug 1892514)
2024-07-03 09:07:23 +03:00
Masayuki Nakano
5fd525bf80 Bug 1892514 - part 5-3: Enable the assertions in IMEContentObserver::FlatTextCache in some automated tests r=smaug
This patch enables the assertions when running:
* The `nsITextInputProcessor` tests
* The IME composition tests under `widget/`
* Under `editor/libeditor/tests`
* Under `editor/libeditor/crashtests`
* Under testing/web-platform/tests/editing`
* Under testing/web-platform/tests/input-events`

Differential Revision: https://phabricator.services.mozilla.com/D211835
2024-07-03 03:54:25 +00:00
Masayuki Nakano
4354450caa Bug 1904192 - Make TextControlState::SetValue suppress TextEditor to dispatch input events even after dispatching input event during composition r=m_kato,geckoview-reviewers
`input` event listeners may be async functions and may set the text control
element value after the editor ends dispatching an `input` event.  Even in this
case, the `input` event listener should not be called recursively by committing
composition which is caused by setting the value because the value is
overwritten by the setting value which was intended by the web app.

Unfortunately, we cannot check whether the value setter is an async `input`
event listener.  Therefore, we need to suppress `input` events even after the
editor ends dispatching `input` event.

On the other hand, we should not suppress `input` event if the value is set
by a `compositionupdate` event listener which runs before the editor starts
handling the latest composition change because once we do that, the app won't
receive `input` event for the composition.  Therefore, we should not suppress
the editor starts handling the composition change (including during
`beforeinput` event dispatching, but the `beforeinput` is not cancelable, so,
the result will be odd, therefore, we have no tests for the cases).

Therefore, this patch adds a new method to `TextComposition` to make
`TextControlState::SetValue` can check whether the editor is handling the
latest composition change or after that.  So, during composition, setting
value should cause `input` events between `TextComposition` starts dispatching a
`compositionupdate` event and `EditorBase` starts handling `eCompositionChange`
event which is dispatched after `compositionupdate`.

Differential Revision: https://phabricator.services.mozilla.com/D214676
2024-06-25 03:52:54 +00:00
Masayuki Nakano
52b0fcc9a1 Bug 1897865 - Make TextEditor stop dispatching beforeinput/input events during committing composition caused by setting its value r=m_kato
As far as testing on Chrome, they don't dispatch any events during setting
text control value (including `compositionupdate` and `compositionend`).
However, we dispatch `compositionupdate`, `compositionend`, `beforeinput` and
`input` synchronously.  Therefore, `input` event listener may run again with
the old value.  This may make web apps confused because they may not expect
the nested `input` event listener call which is not caused by user intention
nor a `Document.execCommand` call.  Therefore, we should stop dispatching
the nested `beforeinput` and `input` events which are caused by committing
composition for setting value since the value will be updated soon, so,
the input caused by committing composition does not occur actually.  However,
`compositionend` event should be fired even in the nested event loop because
the web apps may manage whether they has a composition with a pair of
`compositionstart` and `compositionend` event listeners even though that won't
work on Chrome.

Additionally, the nested `compositionupdate` and `compositionend` event may
cause a `Document.execCommand` call.  However, that must be unexpected behavior
for web apps and anyway the value will be overwritten to the new value.
Therefore, let's make `Document::ExecCommand` do nothing in the situation.

Differential Revision: https://phabricator.services.mozilla.com/D213756
2024-06-18 00:30:49 +00:00
Masayuki Nakano
899c9b469c Bug 1675847 - part 2: Rename some methods which handle "MouseClick" r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D213000
2024-06-14 00:18:46 +00:00
Masayuki Nakano
2fb07300f9 Bug 1675847 - part 1: Rename eMouseClick and eMouseAuxClick r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D212999
2024-06-14 00:18:46 +00:00
Masayuki Nakano
ae22ac0c53 Bug 1728566 - Make the HTMLEditor::InsertParagraphSeparatorAsSubAction callers compute the editing host no limited in the <body> r=m_kato
While handling an "insertParagraph" command, it's closed at least in the editing
host.  Therefore, it's file to use editing host outside `<body>` because it
won't make the tree messy outside the editing host.

Differential Revision: https://phabricator.services.mozilla.com/D213376
2024-06-14 00:16:17 +00:00
Andrew McCreight
1911f0174a Bug 1902344 - Remove outdated data structure references in "Using C++ in Mozilla code" and elsewhere. r=xpcom-reviewers,nika DONTBUILD
nsAutoTArray was renamed to AutoTArray.

nsDataHashtable and nsJSThingHashtable don't exist any more.

nsTHashMap and nsTHashSet now exist.

nsDeque is properly typed now.

Pair is now CompactPair.

Differential Revision: https://phabricator.services.mozilla.com/D213624
2024-06-13 22:41:51 +00:00
Gregory Pappas
82e064164d Bug 1848966 - Remove dom.document.exec_command.nested_calls_allowed pref r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D212578
2024-06-05 02:48:31 +00:00
Mike Hommey
cc3cc60ea9 Bug 1900164 - Add missing empty template argument list in function call. r=masayuki
clang 19 will start complaining about it. See
https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#96

Differential Revision: https://phabricator.services.mozilla.com/D212496
2024-06-04 01:19:41 +00:00
Masayuki Nakano
ed99e91ef8 Bug 1898408 - Make our editor disconnect <br> element temporarily when its type is changed from or to padding one r=m_kato
Currently, the `<br>` element type -- whether normal `<br>` element or padding
`<br>` element for empty editor or last line -- is managed by the flags of
`nsINode`.  Therefore, changing the flag does not cause mutation, so
`IMEContentObserver` cannot observe the type changes.  However,
`ContentEventHandler` treats the padding `<br>` elements as invisible.
Therefore, when a `<br>` element becomes a padding one, `IMEContentObserver`
needs to notify IME of atext removed notification, and also when a `<br>`
element becomes a normal one (i.e., visible), `IMEContentObserver` needs to
notify IME of a text added notification.

Therefore, this patch makes `EditorBase` disconnect the `<br>` element
temporarily to make `IMEContentObserver` observable the type change.

Depends on D211698

Differential Revision: https://phabricator.services.mozilla.com/D211699
2024-05-31 00:42:13 +00:00
Masayuki Nakano
d8f302fe60 Bug 1893351 - part 2: Make HTMLEditor::HandleInsertText stop inserting text into existing text nodes if it's a middle line of inserting text r=m_kato
When 2nd or later line, the method inserts one-line text to start of a `Text`
node following `<br>` which is inserted by the method.  Then, splits the `Text`
node to insert another `<br>`.  This creates a lot of unnecessary
`SplitNodeTransaction`s and that causes a lot of copying memory operation to
set the data of the right `Text` node.

This patch makes the method creates a `Text` node when inserting a middle line
of inserting text.  Therefore, `SplitNodeTransaction` is created at most one
(to split a `Text` node if the caller wants to insert a text middle of it).

Depends on D211697

Differential Revision: https://phabricator.services.mozilla.com/D211698
2024-05-30 00:42:41 +00:00
Masayuki Nakano
08de69e4f7 Bug 1893351 - part 1: Add an option to make EditorBase::InsertTextWithTransaction always create a Text node r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D211697
2024-05-30 00:42:41 +00:00
Olli Pettay
c9f32debe1 Bug 1898343 - Don't fire selectionchange if there is one pending, r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D211263
2024-05-27 12:47:53 +00:00
Masayuki Nakano
398b556e90 Bug 1877513 - Make HTMLEditor deletes only preceding lines of right child block if the range starts from start of a line r=m_kato
Currently, the editor of Gecko always unwraps first line of the right child
block after deleting selected range when the range starts in a parent block
and ends in a child block.  This behavior is almost same as the other browsers,
but the other browsers deletes only preceding lines of the right child block
(i.e., without unwrapping the first line of the right child block) if the range
starts from start of a preceding line, for example, when deleting
`<div>abc<br>[def<p>g]hi<br>jkl`, Gecko moves "hi" to the parent `<div>`,
but the other browsers keeps it in the child `<p>`.

For emulating this special handling, we need to touch 2 paths.

One is `Backspace` when selection is collapsed at start of the child block.  In
this case, only when the preceding line is empty, i.e., there are 2 line breaks
(either `<br>` or `\n` in `white-space: pre-*`), the following break should
be deleted, but the child block should not be touched.

The other is, deleting when selection is not collapsed or `Delete` when
selection is collapsed at immediately before the child block.  In the latter
case, `HTMLEditor::HandleDeleteSelection` extends `Selection` using
`nsFrameSelection`.  Then, handle it with same path as deleting non-collapsed
range.

The former is handled with `HandleDeleteLineBreak` and
`ComputeRangeToDeleteLineBreak`.  The latter is handled with
`HandleDeleteNonCollapsedRange` and `ComputeRangeToDeleteNonCollapsedRange`.
The new handlers use the `ComputeRangeToDelete*`.  Therefore, `beforeinput`
reports exactly same range from `getTargetRanges`.  However, existing paths
do not use same approach and this patch makes `HandleDeleteNonCollapsedRange`
fall it back to `HandleDeleteNonCollapsedRange`.  Therefore, some `if` checks
in `HandleDeleteNonCollapsedRange` are ugly, but I have no better idea to
implement this smarter.

Differential Revision: https://phabricator.services.mozilla.com/D207690
2024-04-27 00:36:26 +00:00
pstanciu
ba931d594f Backed out changeset 67a63b95c31e (bug 1877513) for causing build bustages on HTMLEditorDeleteHandler.cpp CLOSED TREE 2024-04-26 13:49:08 +03:00
Masayuki Nakano
707ea2ca78 Bug 1877513 - Make HTMLEditor deletes only preceding lines of right child block if the range starts from start of a line r=m_kato
Currently, the editor of Gecko always unwraps first line of the right child
block after deleting selected range when the range starts in a parent block
and ends in a child block.  This behavior is almost same as the other browsers,
but the other browsers deletes only preceding lines of the right child block
(i.e., without unwrapping the first line of the right child block) if the range
starts from start of a preceding line, for example, when deleting
`<div>abc<br>[def<p>g]hi<br>jkl`, Gecko moves "hi" to the parent `<div>`,
but the other browsers keeps it in the child `<p>`.

For emulating this special handling, we need to touch 2 paths.

One is `Backspace` when selection is collapsed at start of the child block.  In
this case, only when the preceding line is empty, i.e., there are 2 line breaks
(either `<br>` or `\n` in `white-space: pre-*`), the following break should
be deleted, but the child block should not be touched.

The other is, deleting when selection is not collapsed or `Delete` when
selection is collapsed at immediately before the child block.  In the latter
case, `HTMLEditor::HandleDeleteSelection` extends `Selection` using
`nsFrameSelection`.  Then, handle it with same path as deleting non-collapsed
range.

The former is handled with `HandleDeleteLineBreak` and
`ComputeRangeToDeleteLineBreak`.  The latter is handled with
`HandleDeleteNonCollapsedRange` and `ComputeRangeToDeleteNonCollapsedRange`.
The new handlers use the `ComputeRangeToDelete*`.  Therefore, `beforeinput`
reports exactly same range from `getTargetRanges`.  However, existing paths
do not use same approach and this patch makes `HandleDeleteNonCollapsedRange`
fall it back to `HandleDeleteNonCollapsedRange`.  Therefore, some `if` checks
in `HandleDeleteNonCollapsedRange` are ugly, but I have no better idea to
implement this smarter.

Differential Revision: https://phabricator.services.mozilla.com/D207690
2024-04-26 10:07:18 +00:00
Masayuki Nakano
af2207ae5b Bug 1892376 - Make EditorBase and HTMLEditor not use nsDOMAttributeMap r=peterv,dom-core
`nsDOMAttributeMap::GetAttribute` creates `dom::Attr` so that it's not cheap.
Instead it should access `Element::mAttrs` with the accessors or
`BorrowedAttrInfo`.

Differential Revision: https://phabricator.services.mozilla.com/D208087
2024-04-25 03:49:01 +00:00
Masayuki Nakano
ad9ca596ef Bug 1891659 - Make AutoBlockElementsJoiner::DeleteTextAtStartAndEndOfRange() handle the case when the range in a text node r=m_kato
It assumes that the range is always starts and ends in different node.  This
is true for now, but this will be called with a text node to delete only
preformatted line break.  Note that the only caller of it does not need the
text node(s) if it becomes empty.  Therefore, this patch makes it remove the
text node in such case.

Note that the test changed in
`input-events-get-target-ranges-deleting-in-list-items.tentative.html` was
wrong and only Firefox passed it because the range description was
`(#text "", 0) - (#text "", 10)` since the text nodes are removed after
deleting the text data of them.  Now, they become
`(#text "list-item1", 0) - (#text "list-item2", 10)`.

Depends on D207688

Differential Revision: https://phabricator.services.mozilla.com/D207689
2024-04-25 03:47:41 +00:00
Masayuki Nakano
83e260a726 Bug 1891656 - Make HTMLEditUtils::GetMostDistantAncestorEditableEmptyInlineElement() use Element::FromNode() r=m_kato
It uses `AsElement()` which always casts itself to `Element*`, however, the
instance may be non-element node if there is no empty parent of `aEmptyContent`.

Fortunately, all callers of this method uses the result as `nsIContent*` to
call `DeleteNodeWithTransaction()`.  Therefore, we don't have crash bugs caused
by this.

Depends on D207687

Differential Revision: https://phabricator.services.mozilla.com/D207688
2024-04-25 03:47:41 +00:00
Masayuki Nakano
57b8ddc17c Bug 1891408 - part 3: Make some callers of WSScanResult::Point_Deprecated() use new methods r=m_kato
`Point_Deprecated()` is really error-prone since its result meaning is different
whether the scan direction is backward or forward.  Therefore, if a caller wants
a point in a text node and the direction is only one of them, we can change it
to use `WSScanResult::PointAtReachedContent()` or
`WSScanResult::PointAfterReachedContent()`.

Depends on D207686

Differential Revision: https://phabricator.services.mozilla.com/D207687
2024-04-24 06:12:10 +00:00
Masayuki Nakano
31cdc09f52 Bug 1891408 - part 2: Make WSScanResult::PointAtContent() return a point in a text node r=m_kato
When it's called, it just returns at the reached content node.  However, this
does not make sense when it reached a character in the text node.

Depends on D207685

Differential Revision: https://phabricator.services.mozilla.com/D207686
2024-04-24 06:12:09 +00:00
Masayuki Nakano
49d46d78d6 Bug 1891408 - part 1: Rename WSScanResult::Offset() and WSScanResult::Point() r=m_kato
They point the found character point if scanning forward.  However, they point
the next character point if scanning backward.  Therefore, I don't have any
good idea to name them.  Therefore, I rename them to `*_Deprecated()` and the
callers should use better name method later.

Depends on D207684

Differential Revision: https://phabricator.services.mozilla.com/D207685
2024-04-24 06:12:08 +00:00
Masayuki Nakano
4bd29cb1f5 Bug 1885822 - part 4: Add WSType::InlineEditingHostBoundary r=m_kato
When `WSScanResult::ReachedCurrentBlockBoundary()` returns `true`, it may have
reached inline editing host rather than editable block.  Therefore, the
method name is definitely error-prone.  This patch adds new state and all
users of `WSType::CurrentBlockBoundary` keeps checking the new type too for
keeping current behavior.

I think that we should make `WSRunScanner` aware of inline editing host next
to block boundary before removing odd check of
`ReachedInlineEditingHostBoundary()`, `StartsFromInlineEditingHostBoundary()`
and `EndsByInlineEditingHostBoundary()` to avoid unexpected regressions in the
wild.

Depends on D207683

Differential Revision: https://phabricator.services.mozilla.com/D207684
2024-04-22 06:31:11 +00:00
Masayuki Nakano
a4a70a4e32 Bug 1885822 - part 3: Make WSScanResult always have editable element with mContent if it reached current block boundary r=m_kato
Different from the comment around setter of `WSType::CurrentBlockBoundary`,
neither `HTMLEditUtils::GetNextLeafContentOrNextBlockElement` nor
`HTMLEditUtils::GetPreviousLeafContentOrPreviousBlockElement` returns
`nullptr` when it reaches non-editable element, and the setters always set
`mContent` to `aEditableBlockParentOrTopmostEditableInlineElement`.  Therefore,
`mContent` is always an editable element when `ReachedCurrentBlockBoundary()`
returns `true`.

Depends on D207682

Differential Revision: https://phabricator.services.mozilla.com/D207683
2024-04-22 06:31:10 +00:00
Masayuki Nakano
7edcf9c3ee Bug 1885822 - part 2: Make WSScanResult always have non-null mContent if it reached something r=m_kato
Currently, it checks whether `mContent` is `nullptr` or not even if the scanner
reached something.  However, this makes the users of this object check whether
it has reasonable content or not and that makes the users messy.  Therefore,
the scanning method should guarantee that it's always error if it does not reach
any content.

Depends on D207681

Differential Revision: https://phabricator.services.mozilla.com/D207682
2024-04-22 06:31:10 +00:00
Masayuki Nakano
83e6cf0743 Bug 1885822 - part 1: Make WSScanResult created with WSType::InUncomposedDoc if the scan is tried in uncomposed tree r=m_kato
This case should never happen because nobody can check proper editable state
in uncomposed tree unless the uncomposed tree has its own editing host.
Therefore, this patch adds assertions into the scanning methods too.

Differential Revision: https://phabricator.services.mozilla.com/D207681
2024-04-22 06:31:10 +00:00
Masayuki Nakano
f8501ee2d8 Bug 1890915 - Make EditorBase::CloneAttributesWithTransaction() collect all attributes before updating the DOM tree r=m_kato
`while (RefPtr<Attr> attr = attributes->Item(0))` causes a warning in
`nsDOMAttributeMap::IndexedGetter()` because of out of bounds.  Additionally,
we should not make a loop with live DOM tree information if the loop updates
the DOM tree.  Therefore, this patch makes it collect all attributes first
before touching the DOM tree.

Depends on D207240

Differential Revision: https://phabricator.services.mozilla.com/D207241
2024-04-15 05:49:02 +00:00
Masayuki Nakano
2e9ae03568 Bug 1890912 - Fix warning spam in HTMLEditor::SplitAncestorStyledInlineElementsAtRangeEdges() r=m_kato
The cause is an expected case.  Therefore, using `NS_WARN_IF` is wrong.

Differential Revision: https://phabricator.services.mozilla.com/D207240
2024-04-15 02:45:42 +00:00
Masayuki Nakano
7cdc773578 Bug 903746 - part 2: Add textInput event and make EditorBase dispatch it as a default action of beforeinput r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D200121
2024-04-08 12:30:00 +00:00
Cosmin Sabou
783470433c Backed out 2 changesets (bug 903746) for causing non-unified build bustages on nsIPrincipal.h. CLOSED TREE
Backed out changeset c80afc8b7c2a (bug 903746)
Backed out changeset 0ac710612d09 (bug 903746)
2024-04-08 09:47:04 +03:00
Masayuki Nakano
c1fc3d961a Bug 903746 - part 2: Add textInput event and make EditorBase dispatch it as a default action of beforeinput r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D200121
2024-04-08 05:23:25 +00:00
Emilio Cobos Álvarez
e4ddf24147 Bug 1887719 - More consistently use UTF8String/nsCString for URLs. r=necko-reviewers,webidl,anti-tracking-reviewers,places-reviewers,jari,kershaw,janv,smaug,hsivonen
Sorry for the massive patch but I found it hard to split without
introducing a bunch of copies around...

This mostly makes necko and DOM agree on which strings to use, which
should result on less copies and conversions.

Differential Revision: https://phabricator.services.mozilla.com/D205601
2024-04-04 11:49:57 +00:00
Gijs Kruitbosch
999878b497 Bug 1705440 - remove old modal prompt implementation, r=mconley,webdriver-reviewers,extension-reviewers,desktop-theme-reviewers,tabbrowser-reviewers,whimboo,rpl
Differential Revision: https://phabricator.services.mozilla.com/D204759
2024-03-20 17:47:47 +00:00
Butkovits Atila
8fd100bae7 Backed out 2 changesets (bug 1883557, bug 1705440) for causing failures at browser_ext_sidebarAction_contextMenu.js. CLOSED TREE
Backed out changeset 89f62e190e69 (bug 1705440)
Backed out changeset 79dfddac72f9 (bug 1883557)
2024-03-20 14:17:11 +02:00
Gijs Kruitbosch
a3568826b0 Bug 1705440 - remove old modal prompt implementation, r=mconley,webdriver-reviewers,extension-reviewers,desktop-theme-reviewers,tabbrowser-reviewers,whimboo,rpl
Differential Revision: https://phabricator.services.mozilla.com/D204759
2024-03-20 10:10:26 +00:00
Masayuki Nakano
900d40dd31 Bug 1883562 - part 2: Make EditorBase::DeleteRangesWithTransaction and the fallback path of AutoDeleteRangesHandler work with single range r=m_kato
Although from the maintenance cost point of view, we should not duplicate
`EditorBase::DeleteRangesWithTransaction`, but let's add a wrapper for it
for making the callers simpler.

Differential Revision: https://phabricator.services.mozilla.com/D203854
2024-03-11 08:01:51 +00:00
Masayuki Nakano
4099ab71e0 Bug 1883562 - part 1: Make AutoBlockElementsJoiner work with one range r=m_kato
It and its helper class, `AutoInclusiveAncestorBlockElementsJoiner` work with
multiple ranges, but they handle special cases only with the first range.
That means that deleting content will be different if same structure is selected
with multiple ranges and that must be not expected by the users.

Differential Revision: https://phabricator.services.mozilla.com/D203853
2024-03-11 08:01:50 +00:00
Natalia Csoregi
2cb7fdd031 Backed out changeset 18dde41563b1 (bug 1882818) for causing Bug 1884613. CLOSED TREE 2024-03-11 09:45:35 +02:00
John Bieling
89637d1080 Bug 1883367 - Disable editor commands for read-only editors. r=masayuki
The purpose of this patch is to prevent users to make changes to
read-only editors.

This patch forces `IsCommandEnabled()` to return false for read-only
editors for "standard" editor commands that could have an associated
icon or menu entry and are therefore user-accessible.

This patch does not modify/test any paste commands or any of the
advanced internal editor commands.

Differential Revision: https://phabricator.services.mozilla.com/D203754
2024-03-08 17:55:57 +00:00
Cristian Tuns
104d7a4015 Backed out changeset dd6b961d3b69 (bug 1883367) for causing mochitest failures in test_command_state_when_readonly_in_chrome.html CLOSED TREE 2024-03-08 05:55:01 -05:00
John Bieling
c7152644f3 Bug 1883367 - Disable editor commands for read-only editors. r=masayuki
The purpose of this patch is to prevent users to make changes to
read-only editors.

This patch forces `IsCommandEnabled()` to return false for read-only
editors for "standard" editor commands that could have an associated
icon or menu entry and are therefore user-accessible.

Advanced internal editor commands are not touched.

Differential Revision: https://phabricator.services.mozilla.com/D203754
2024-03-08 10:24:21 +00:00
Masayuki Nakano
37ef2fd403 Bug 1882818 - Make HTMLEditor paste ancestors under the closest common ancestor in the range r=m_kato
When copying paragraphs in Gecko, some private type data is copied into the
clipboard and our editor refers the private data at pasting such data.  In
this case, `text/_moz_htmlinfo` has 2 integers to specify the range at the
copy.  If selection range ends at end of text followed by an invisible `<br>`
and a block boundary, this is set to the depth of the text node.  Then,
`HTMLWithContextInserter::CollectTopMostChildContentsCompletelyInRange` collects
top most children of the last paragraph in `HTMLWithContextInserter::Run` [1].
Therefore, the last `<div>` in the clipboard is unwrapped at pasting in the
test case.  This patch makes
`FragmentFromPasteCreator::MoveStartAndEndAccordingToHTMLInfo` re-climb up the
tree under the common ancestor of found start/last nodes.

1. https://searchfox.org/mozilla-central/rev/6b1e306175c2284958fb185bab388021e2890ed0/editor/libeditor/HTMLEditorDataTransfer.cpp#646-651

Differential Revision: https://phabricator.services.mozilla.com/D203574
2024-03-07 09:37:50 +00:00
Gregory Pappas
9a182a662f Bug 1878629 - part 4: Use EventTarget.addEventListener to add system group event listeners instead of nsIEventListenerService (editor/) r=masayuki
Depends on D201045

Differential Revision: https://phabricator.services.mozilla.com/D201046
2024-03-06 19:27:11 +00:00
Masayuki Nakano
e970224f24 Bug 1881906 - Make HTMLEditUtils treat <br> elements always inline r=m_kato
As far as I've tested, `<br>` element is always treated as usual even if its
`display` is set to anything except `none`.  Therefore, preceding collapsible
white-spaces and `<br>` element should be treated as visible even if the
following `<br>` element is `display:block` or something.

Note that if `display:none` is specified, we should not treat it as a line
break, but our editor cannot work properly in the case and `HTMLEditUtils`
currently uses the default style of HTML elements if `display:none` is
specified.  Therefore, this patch makes `HTMLEditUtils` always treat `<br>`
as inline.

Differential Revision: https://phabricator.services.mozilla.com/D203403
2024-03-05 11:47:04 +00:00
Gregory Pappas
3ea20569e6 Bug 1881845 - Remove nsContentCID.h r=smaug,media-playback-reviewers,karlt
All of these components have been converted to static registration, making this
file unneeded.

Differential Revision: https://phabricator.services.mozilla.com/D202633
2024-03-04 23:41:05 +00:00
Dave Townsend
c4fe5f4e8d Bug 1864896: Autofix unused function arguments (editor). r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D202964
2024-03-01 18:28:33 +00:00
Iulian Moraru
97fd2dad96 Backed out 5 changesets (bug 1864896) for causing newtab failures related to bundles. CLOSED TREE
Backed out changeset 2cd1cc279f99 (bug 1864896)
Backed out changeset e48d6928bdcb (bug 1864896)
Backed out changeset 1abbcaf91693 (bug 1864896)
Backed out changeset 06a05e5257d5 (bug 1864896)
Backed out changeset b1955ae3e9e2 (bug 1864896)
2024-03-01 12:58:03 +02:00
Dave Townsend
92b98769fe Bug 1864896: Autofix unused function arguments (editor). r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D202964
2024-03-01 10:10:09 +00:00
Emilio Cobos Álvarez
fb89acd3b5 Bug 1362907 - Make select use nsHTMLButtonControlFrame for layout. r=jfkthame,dholbert
This simplifies our combobox code a bit more:

 * Reflow() is only needed to compute the label isize.
 * Frame construction uses a setup more similar to <input type=file> to
   get the right frame tree, removing a bunch of special code.
 * Lots of special code removed all over the place.

Differential Revision: https://phabricator.services.mozilla.com/D203010
2024-02-29 11:15:52 +00:00
Masayuki Nakano
b4501d1622 Bug 1881989 - Make AutoDeleteRangesHandler::ExtendOrShrinkRangeToDelete handle it with the closest editable ancestor block or inline editing host r=m_kato
It's currently handling its job with the closest ancestor block which may be
non-editable and editing host which is either inline or block.  However, the
closest block is required for check whether the range won't be extended outside
the closest block of the common ancestor of the range and the range is
guaranteed that they are in an editing host.  Therefore, it's not required if
it's outside the editing host.  So, comparisons which check whether a node is
either/neither editing host or/nor ancestor block can get same result with
comparing with the closest one of the editing host or the closest editable
block.

Differential Revision: https://phabricator.services.mozilla.com/D202697
2024-02-27 23:15:36 +00:00
Makoto Kato
2fddc3b3c8 Bug 1872863 - Part 2. IME focus should be updated when focused element becomes editable. r=masayuki
When focused element becomes editable by `contentedtiable=true`, IME
content observer isn't created on some situations. Then IME focus isn't
set.

At first, when focused element becomes non-editable,
`FocusedElementOrDocumentBecomesNotEditable` will destroy IME content
observer, but editor might not be destroyed completely since HTML content
has multiple `contenteditable` and has focus.

Then, when focused element becomes editable again,
`FocusedElementOrDocumentBecomesEditable` will check selection ancestor
limit, but since editor isn't destroyed by previous `contenteditable`
change, we already have this limit. Then we don't create IME content
observer.

So we should set current IME state and create IME content observer when
becoming editable.

Differential Revision: https://phabricator.services.mozilla.com/D202409
2024-02-27 15:00:33 +00:00
Joel Maher
eaf8b887ab Bug 1879538 - cleanup unnecessary and redundant reftest conditions. r=aryx,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D201794
2024-02-22 23:04:45 +00:00
Masayuki Nakano
3719643bde Bug 1880710 - Make HTMLEditor::IsEmpty check whether the editing host is empty r=m_kato
It checks whether the document body itself is empty or not.  However, if there
is only a shadow DOM hosts, it considers the content is empty.  Therefore,
`HTMLEditor::HandleDeleteSelection` does nothing.

I think that it should check whether current editing host is empty or not.
That does not work without selection ranges, but I think it's fine in most
cases.

Differential Revision: https://phabricator.services.mozilla.com/D202274
2024-02-22 07:32:18 +00:00
Greg Stoll
6b9e711a99 Bug 1871135 - Add content analysis support to clipboard operations r=edgar,nika,masayuki,devtools-reviewers
When content analysis is on, pastes will be checked by the CA
agent while tab input is blocked. The synchronous nsIClipboard.getData()
method must block until the analysis result is received, so this
requires doing a SpinEventLoopUntil.

Differential Revision: https://phabricator.services.mozilla.com/D196997
2024-02-13 11:26:48 +00:00
Cristian Tuns
2b828fa42e Backed out changeset 9dfe3fe4ccc5 (bug 1871135) for causing mochitest failures in nsClipboardProxy.cpp CLOSED TREE 2024-02-12 12:04:41 -05:00
Greg Stoll
cbb35c98d7 Bug 1871135 - Add content analysis support to clipboard operations r=edgar,nika,masayuki,devtools-reviewers
When content analysis is on, pastes will be checked by the CA
agent while tab input is blocked. The synchronous nsIClipboard.getData()
method must block until the analysis result is received, so this
requires doing a SpinEventLoopUntil.

Differential Revision: https://phabricator.services.mozilla.com/D196997
2024-02-12 16:05:06 +00:00
Cristian Tuns
ea5dd880a4 Backed out changeset 3caca1d10dcc (bug 1871135) for causing build bustages in nsBaseClipboard.cpp CLOSED TREE 2024-02-12 09:59:09 -05:00
Greg Stoll
5a2f92686a Bug 1871135 - Add content analysis support to clipboard operations r=edgar,nika,masayuki,devtools-reviewers
When content analysis is on, pastes will be checked by the CA
agent while tab input is blocked. The synchronous nsIClipboard.getData()
method must block until the analysis result is received, so this
requires doing a SpinEventLoopUntil.

Differential Revision: https://phabricator.services.mozilla.com/D196997
2024-02-12 00:49:39 +00:00
Tom Schuster
d9047629b5 Bug 1876276 - Remove dead nsIDocShell allowPlugins code. r=emilio,sessionstore-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D199491
2024-01-31 13:23:52 +00:00
Iulian Moraru
448769c125 Backed out changeset 4871c819b21e (bug 1876276) for causing multiple bc failures. CLOSED TREE 2024-01-31 14:25:42 +02:00
Tom Schuster
ab34543442 Bug 1876276 - Remove dead nsIDocShell allowPlugins code. r=emilio,sessionstore-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D199491
2024-01-31 09:36:36 +00:00
Masayuki Nakano
c326234099 Bug 1876913 - part 2: Make HTMLEditor::FormatBlockContainerWithTransaction refer the computed style when considering the wrapping part r=m_kato
In bug 1851951, I considered that the method should keep the traditional
behavior for the backward compatibility because of mainly used by handling
a block level command, `formatBlock`, but I think that computing the replacing
part should be considered with the computed style of the elements.  That's
compatible with the other browsers.

Depends on D199844

Differential Revision: https://phabricator.services.mozilla.com/D199845
2024-01-30 13:02:37 +00:00
Tom Marble
3c78905f47 Bug 1868866 - adds ManifestParser TOML linter r=jmaher,linter-reviewers,ahal,webdriver-reviewers,settings-reviewers,search-reviewers,devtools-reviewers,fxview-reviewers,cookie-reviewers,sessionstore-reviewers,places-reviewers,dom-storage-reviewers,translations-reviewers,valentin,whimboo,Standard8,sclements,jesup
Differential Revision: https://phabricator.services.mozilla.com/D199054
2024-01-29 17:30:48 +00:00
Makoto Kato
3f4dbbf027 Bug 1586471 - Part 4. Fix drag threshold for mochitests. r=masayuki
GeckoView's drag threshold is large and mochitest runs on mobile
viewport.

So I would like to adjust this value to run drag and drop tests on
GeckoView.

Differential Revision: https://phabricator.services.mozilla.com/D197332
2024-01-28 07:49:54 +00:00
Sandor Molnar
51bb77759a Backed out changeset 2be67d91cf16 (bug 1868866) for causing Mn failures at toolkit/xre/test/marionette/test_exitcode.py CLOSED TREE 2024-01-27 00:15:22 +02:00
Tom Marble
2434015dc5 Bug 1868866 - adds ManifestParser TOML linter r=jmaher,linter-reviewers,ahal,webdriver-reviewers,settings-reviewers,search-reviewers,devtools-reviewers,fxview-reviewers,cookie-reviewers,sessionstore-reviewers,places-reviewers,dom-storage-reviewers,translations-reviewers,valentin,whimboo,Standard8,sclements,jesup
Differential Revision: https://phabricator.services.mozilla.com/D199054
2024-01-26 20:06:56 +00:00
Jonathan Kew
5741b2b190 Bug 1852478 - Convert CSS white-space into a shorthand that expands to white-space-collapse and text-wrap-mode longhands. r=firefox-style-system-reviewers,emilio
Note that although this builds, it would (by itself) result in some test breakage;
this is resolved in the following patches that build on this.

Differential Revision: https://phabricator.services.mozilla.com/D198790
2024-01-26 09:40:02 +00:00
Cristian Tuns
f0be219b00 Backed out 4 changesets (bug 1758391, bug 1852478) for causing build bustages in UseCounterMetrics.cpp CLOSED TREE
Backed out changeset fe673f87d86a (bug 1852478)
Backed out changeset d466ccbd1aad (bug 1852478)
Backed out changeset c0fa98fec39a (bug 1758391)
Backed out changeset 04d322f23fd0 (bug 1852478)
2024-01-25 18:29:39 -05:00
Jonathan Kew
2cd3b24544 Bug 1852478 - Convert CSS white-space into a shorthand that expands to white-space-collapse and text-wrap-mode longhands. r=firefox-style-system-reviewers,emilio
Note that although this builds, it would (by itself) result in some test breakage;
this is resolved in the following patches that build on this.

Differential Revision: https://phabricator.services.mozilla.com/D198790
2024-01-25 22:20:05 +00:00
Joel Maher
3ad5072cf1 Bug 1873732 - remove outdated manifest conditions and use consistent conditions. r=aryx,necko-reviewers,jgilbert,settings-reviewers,credential-management-reviewers,devtools-reviewers,sessionstore-reviewers,dom-storage-reviewers,sgalich,kershaw,nchevobbe,janv,dao
Differential Revision: https://phabricator.services.mozilla.com/D198082
2024-01-25 00:27:05 +00:00
Masayuki Nakano
5852493523 Bug 1870958 - Make TextControlState notify IMEContentObserver of default value change if TextEditor is being initialized r=smaug,m_kato
The default value of `<textarea>` may be changed during reframes of the
corresponding `nsTextControlFrame`.  Then, the `TextEditor` and the anonymous
subtree is recreated.  In this moment, `IMEContentObserver` will restart to
observer the anonymous subtree after the editor is completely initialized,
but new default value which is caused by a mutation under `<textarea>` is
copied at recreating the anonymous subtree.  Therefore, `IMEContentObserver`
fails to notify the text change before a further selection change.

For solving this issue, this patch makes `TextControlState` notifies
`IMEContentObserver` of default value change at recreating a new `TextEditor`.
Therefore, this patch may cause redundant text change notifications for IME.
Currently, I have a plan to fix bug 854272 to carry `TextEditor` instance and
the anonymous subtree over to new `nsTextControlFrame`.  So, I believe that
this approach is reasonable for now (It'd be easier if we could add new
`nsString` to `TextControlState` without increasing the instance size, though).

Differential Revision: https://phabricator.services.mozilla.com/D197261
2024-01-24 22:50:27 +00:00
Stanca Serban
221d7acc5b Backed out changeset 54462970f797 (bug 1873732) for causing web platform tests failures. 2024-01-24 21:08:19 +02:00
Joel Maher
807575f8e1 Bug 1873732 - remove outdated manifest conditions and use consistent conditions. r=aryx,necko-reviewers,jgilbert,settings-reviewers,credential-management-reviewers,devtools-reviewers,sessionstore-reviewers,dom-storage-reviewers,sgalich,kershaw,nchevobbe,janv,dao
Differential Revision: https://phabricator.services.mozilla.com/D198082
2024-01-24 16:35:54 +00:00