searching for reviewer(m_kato)
9d6ef6164ec1cdc79d1420def6f40ad28d5bd7eb: Bug 1557996 - Make `HTMLEditor::GetSelectedElement()` not treat an element as selected when it's followed by a <br> element r=m_kato a=jcristau
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 11 Jun 2019 07:59:07 +0000 - rev 533857
Push 11441 by opoprus@mozilla.com at Thu, 13 Jun 2019 13:39:01 +0000
Bug 1557996 - Make `HTMLEditor::GetSelectedElement()` not treat an element as selected when it's followed by a <br> element r=m_kato a=jcristau Currently, `HTMLEditor::GetSelectedElement()` is not used in mozilla-central and mainly used for handling double clicks in the editor with its complicated path. In most cases, users don't want double clicks to cause showing property dialog in mail composer. Therefore, we must be able to stricter in the complicated path. This patch adds new check whether the selected range ends immediately before a `<br>` element. If it's end at a `<br>` element, we shouldn't treat found element as selected. Note that when `<a href="...">` element is double-clicked, the element itself is selected like `<img>` element. So, we don't need to worry about the case which is that users probably want to update a link with double-clicking since such case is handled by the first optimized path in the method. Differential Revision: https://phabricator.services.mozilla.com/D34335
72e634f9360acbc01148c18bad4fbbb4defb3238: Bug 1555640 - Check if `aPointAfterInsertedString` is nullptr when `WSRunObject::InsertText()` sets its value r=m_kato a=jcristau
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 30 May 2019 10:32:44 +0000 - rev 533536
Push 11346 by malexandru@mozilla.com at Fri, 31 May 2019 16:15:31 +0000
Bug 1555640 - Check if `aPointAfterInsertedString` is nullptr when `WSRunObject::InsertText()` sets its value r=m_kato a=jcristau `aPointAfterInsertedString` of `WSRunObject::InsertText()` is optional (i.e., may be nullptr). However, the fix for bug 1534394 makes it always set to original insertion point when `InsertTextWithTransaction()` is failed. This patch just make it check if `aPointAfterInsertedString` is nullptr before setting its value. Differential Revision: https://phabricator.services.mozilla.com/D33144
54ff09f869d8e81bda1bf1c76816e8c6792ccf66: Bug 1534394 - Make WSRunObject::InsertText() set aPointAfterInsertedString by itself when HTMLEditor::InsertTextWithTransaction() returns error r=m_kato a=jcristau
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 23 May 2019 06:06:18 +0000 - rev 533373
Push 11303 by opoprus@mozilla.com at Fri, 24 May 2019 14:49:19 +0000
Bug 1534394 - Make WSRunObject::InsertText() set aPointAfterInsertedString by itself when HTMLEditor::InsertTextWithTransaction() returns error r=m_kato a=jcristau Oddly, `WSRunObject::InsertText()` returns `NS_OK` even when `HTMLEditor::InsertTextWithTransaction()` returns error. However, it fails if insertion point is not editable like `<noscript>` element. In such case, `aPointAfterInsertedString` isn't modified and its caller, `HTMLEditRules::WillInsertText()` keep handling inserting remaining text with non-positioned `EditorDOMPoint`. Therefore, at the next time, `WSRunObject` fails to do anything since it requires positioned `EditorDOMPoint`. For making uplift safer, this patch makes `WSRunObject::InsertText()` set `aPointAfterInsertedString` by itself when `HTMLEditor::InsertTextWithTransaction()` returns error. Differential Revision: https://phabricator.services.mozilla.com/D32131
c7feffe40029e833241baa952cec89346d649a06: Bug 1252310 - Don't mistakenly suppress key-up event when not required. r=geckoview-reviewers,m_kato
Jan Henning <jh+bitbucket@buttercookie.de> - Mon, 13 May 2019 06:48:30 +0000 - rev 532399
Push 11268 by csabou@mozilla.com at Tue, 14 May 2019 15:24:22 +0000
Bug 1252310 - Don't mistakenly suppress key-up event when not required. r=geckoview-reviewers,m_kato The problem from bug 1278581 was that hiding the URL bar in response to a key-down event (for the Enter key) would then lead to the corresponding key-up event then ending up in GeckoView, thereby confusing the "last user activity" tracking. It appears that this only happens with key events received through the regular OnKeyListener, but not with events coming from the OnKeyPreImeListener. On devices where pressing Enter in the URL bar would transmit the key event through the latter mechanism, this means that because the key-up event we wanted to suppress in BrowserApp never arrived, we would instead suppress whatever other key event would arrive next, e.g. possibly a press of the back button. This would lead to the observed behaviour where after entering an URL, the first subsequent press of the back button might then be ignored. Differential Revision: https://phabricator.services.mozilla.com/D30573
182cddeb1d5c3da2ad98d614dca215acc362eed5: Bug 1549925 - Mark all methods of nsIDocumentStateListener as can_run_script r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 09 May 2019 07:37:51 +0000 - rev 531999
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1549925 - Mark all methods of nsIDocumentStateListener as can_run_script r=m_kato `nsIDocumentStateListener` is a scriptable interface and each method may run any script. So, we should mark them as `can_run_script`. Then, we need to mark a lot of editing methods because we need to mark `EditorBase::EndTransactionInternal()` and `EditorBase::DoTransactionInternal()` as `MOZ_CAN_RUN_SCRIPT`. Differential Revision: https://phabricator.services.mozilla.com/D30360
80c8ca102b81ddccf720129381d8669b88f61a17: Bug 1549319 - Make template methods marked as MOZ_CAN_RUN_SCRIPT take only EditorDOMPoint (i.e., not allow EditorRawDOMPoint) r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 08 May 2019 09:40:17 +0000 - rev 531854
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1549319 - Make template methods marked as MOZ_CAN_RUN_SCRIPT take only EditorDOMPoint (i.e., not allow EditorRawDOMPoint) r=m_kato It'd be better to change copy constructor of `EditorDOMPointBase` to explicit, but it'd require too many changes in editor code. So, this patch just changes each method callers only. Differential Revision: https://phabricator.services.mozilla.com/D30054
676e672cabe55841b8ec22fd12983a104e00bb9d: Bug 1549306 - Mark EditorBase::CreateNodeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 08 May 2019 07:00:45 +0000 - rev 531853
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1549306 - Mark EditorBase::CreateNodeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D30052
9fcabe77196c1e35abbe19f7e3dd37abb351d25e: Bug 1549302 - Mark EditorBase::DeleteTextWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 08 May 2019 06:31:48 +0000 - rev 531852
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1549302 - Mark EditorBase::DeleteTextWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D30049
8b9baadda0a72a67b359b2cbfad5de61565a4517: Bug 1549270 - part 3: Mark EditorBase::SetAttributeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 08 May 2019 06:26:25 +0000 - rev 531824
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1549270 - part 3: Mark EditorBase::SetAttributeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D30047
7755efc24f6d991b81598fca36a126f0fb1f565d: Bug 1549270 - part 2: Mark EditorBase::RemoveAttributeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 08 May 2019 05:09:56 +0000 - rev 531823
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1549270 - part 2: Mark EditorBase::RemoveAttributeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D30044
e9e1b9c2cab6cfa713c6119c5b32b1a928faa4f9: Bug 1549270 - part 1: Mark EditorBase::CloneAttributeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 08 May 2019 04:46:56 +0000 - rev 531822
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1549270 - part 1: Mark EditorBase::CloneAttributeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D30043
efc64ba2b311e18d16820a00e98572807ee724a0: Bug 1549268 - Mark EditorBase::JoinNodesWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 08 May 2019 02:29:43 +0000 - rev 531812
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1549268 - Mark EditorBase::JoinNodesWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D30041
93efde688b8c6869c30e2e50c9b755989d4e6e57: Bug 1549264 - Mark EditorBase::SplitNodeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 07 May 2019 22:34:28 +0000 - rev 531810
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1549264 - Mark EditorBase::SplitNodeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D30039
36ab55f6cd91191eb913d95049996094789297d7: Bug 1549155 - Mark EditorBase::DeleteNodeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 07 May 2019 22:27:29 +0000 - rev 531809
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1549155 - Mark EditorBase::DeleteNodeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D30038
0f42a24f44036244c0b5afc442529d88f5125c16: Bug 1549148 - Mark EditorBase::InsertTextIntoTextNodeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 07 May 2019 10:58:08 +0000 - rev 531709
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1549148 - Mark EditorBase::InsertTextIntoTextNodeWithTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D30036
b103cb0209658d6cfc248502606520fd140de56c: Bug 1547898 - part 2: Make HTMLEditRules::NormalizeSelection() use EditorDOMPoint r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 07 May 2019 10:21:43 +0000 - rev 531689
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1547898 - part 2: Make HTMLEditRules::NormalizeSelection() use EditorDOMPoint r=m_kato For guaranteeing the sets of container node, offset in it, and the node referred by the offset, the method should use `EditorDOMPoint` instead of managing them separately. Differential Revision: https://phabricator.services.mozilla.com/D30015
aea4f15b4cf2ef39ef4ca7b4377eb2961fd57b36: Bug 1547898 - part 1: The constructor of EditorDOMPointBase which takes all information should allow non-end point of text node r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 07 May 2019 07:44:04 +0000 - rev 531688
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1547898 - part 1: The constructor of EditorDOMPointBase which takes all information should allow non-end point of text node r=m_kato This is a simple mistake of `MOZ_ASSERTION()` in it. When `mParent` is a node which can have children, `mChild` should be non-`nullptr` or `mOffset` should / be set to the end of `mParent`. But when `mParent` is not a container, any `mOffset` value should be allowed. Differential Revision: https://phabricator.services.mozilla.com/D30014
88ce0c2df4d2e3cd324ce99a48e43a55bb695051: Bug 1548751 - Make TextEditRules::WillSetText() use fast path even if it's for <textarea> element r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 07 May 2019 05:07:14 +0000 - rev 531662
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1548751 - Make TextEditRules::WillSetText() use fast path even if it's for <textarea> element r=m_kato As far as I've tested, `TextEditor` has the following structure patterns: 1. If it's for a non-empty `<input>` element, it has only one text node. 2. If it's for an empty `<input>` element, it has only bogus node. 3. If it's for a non-empty `<textarea>` element, it has a text node and `moz-<br>` element. Additionally they are followed by `<scrollbar>` and `<resizer>` elements. 4. If it's for an empty `<textarea>` element, it has a `moz-<br>` element followed by `<scrollbar>` and `<resizer>` elements. Additionally, `TextEditRules::WillInsert()` always removes bogus node if there is. So, in the case #2, there is no children. Fortunately, we don't support XUL addons anymore on Firefox. However, in other products like Thunderbird, the tree may be changed as unexpected. Therefore, we still need to keep checking the tree, but we can use the fast path for `<textarea>` element too. Differential Revision: https://phabricator.services.mozilla.com/D30012
4e509c724417f6ed43df0f3a5a4f9dcefef5fd52: Bug 1546888 - Make editor public methods which may be canceled by clipboard event listener return NS_SUCCESS_DOM_NO_OPERATION when it's canceled r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 02 May 2019 08:39:53 +0000 - rev 531244
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1546888 - Make editor public methods which may be canceled by clipboard event listener return NS_SUCCESS_DOM_NO_OPERATION when it's canceled r=m_kato This patch makes editors return new error code internally when clipboard event is dispatched and canceled by script. This is for making each caller stop handling the edit action. However, it's not actual failure. Therefore, making public methods return `NS_SUCCESS_DOM_NO_OPERATION` instead via `EditorBase::ToGenericNSResult()`. Differential Revision: https://phabricator.services.mozilla.com/D28935
a0c695448d6e69bfd315a233cef61147d9b75bdb: Bug 1546578 - part 10: Mark methods of editor command classes as far as possible r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Sat, 27 Apr 2019 07:37:19 +0000 - rev 530503
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1546578 - part 10: Mark methods of editor command classes as far as possible r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D28698
7c45189445aab81ca8032e963fd66ecf394157c2: Bug 1546578 - part 9: Make GetCurrentState() of editor command classes take nsCommandParams& instead of nsICommandParams* r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Sat, 27 Apr 2019 07:36:30 +0000 - rev 530502
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1546578 - part 9: Make GetCurrentState() of editor command classes take nsCommandParams& instead of nsICommandParams* r=m_kato Now, all callers of `GetCurrentState()` have reference or pointer to `nsCommandParam`. So, taking the concrete class makes sense. Differential Revision: https://phabricator.services.mozilla.com/D28697
a90af6c1b7d1bf34cc34928da7cf5169f37837b0: Bug 1546578 - part 8: Make EditorCommand implement nsIControllerCommand::GetCommandStateParams() and call internal GetCommandStateParams() method which take TextEditor directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Sat, 27 Apr 2019 07:35:56 +0000 - rev 530501
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1546578 - part 8: Make EditorCommand implement nsIControllerCommand::GetCommandStateParams() and call internal GetCommandStateParams() method which take TextEditor directly r=m_kato This patch makes `EditorCommand` implement `nsIControllerCommand::GetCommandStateParams()` and then, makes it call internal `GetCommandStateParams()` method which takes `TextEditor` or `nsIEditingSession` instead. This makes each implementation really simpler. Differential Revision: https://phabricator.services.mozilla.com/D28696
4e5609da308736145af7e211d3048a45df5c289b: Bug 1546578 - part 7: Make EditorCommand implement nsIControllerCommand::DoCommandParams() and call internal DoCommandParams() method which take TextEditor directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 26 Apr 2019 15:32:06 +0000 - rev 530500
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1546578 - part 7: Make EditorCommand implement nsIControllerCommand::DoCommandParams() and call internal DoCommandParams() method which take TextEditor directly r=m_kato This patch makes `EditorCommand` implement `nsIControllerCommand::DoCommandParams()` and then, makes it call internal `DoCommandParams()` method which takes `TextEditor` instead. This makes each implementation really simpler. Differential Revision: https://phabricator.services.mozilla.com/D28694
93f5bf3c98074111ce1a1246b89d636f4f48b491: Bug 1546578 - part 6: Make EditorCommand implement nsIControllerCommand::DoCommand() and call internal DoCommand() method which take TextEditor directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 26 Apr 2019 14:00:47 +0000 - rev 530499
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1546578 - part 6: Make EditorCommand implement nsIControllerCommand::DoCommand() and call internal DoCommand() method which take TextEditor directly r=m_kato This patch makes `EditorCommand` implement `nsIControllerCommand::DoCommand()` and then, makes it call internal `DoCommand()` method which takes `TextEditor` instead. Note that `DoCommand()` of some command classes have not returned error when given context is not editor. However, it does not make sense to do that only for some commands. Therefore, this patch makes `EditorCommand::DoCommand()` return error when given context is not an editor. This makes each implementation really simpler. Differential Revision: https://phabricator.services.mozilla.com/D28691
409044e9dbbdcc622a42ea9da9d9ee88ea5d4e20: Bug 1546578 - part 5: Make EditorCommand implement nsIControllerCommand::IsCommandEnabled() and call internal IsCommandEnabled() method which return bool directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 26 Apr 2019 13:11:24 +0000 - rev 530498
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1546578 - part 5: Make EditorCommand implement nsIControllerCommand::IsCommandEnabled() and call internal IsCommandEnabled() method which return bool directly r=m_kato This patch makes `EditorCommand` implement `nsIControllerCommand::IsCommandEnabled()` and then, makes it call internal `IsCommandEnabled()` method which returns `bool` directly and takes `TextEditor` instead. This makes each implementation really simpler. Differential Revision: https://phabricator.services.mozilla.com/D28687
6f718d253d8d01518b70fd56f78941882474f3b5: Bug 1546578 - part 4: Merge AbsolutePositioningCommand::IsCommandEnabled() with StateUpdatingCommandBase::IsCommandEnabled() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 26 Apr 2019 11:06:45 +0000 - rev 530497
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1546578 - part 4: Merge AbsolutePositioningCommand::IsCommandEnabled() with StateUpdatingCommandBase::IsCommandEnabled() r=m_kato [`AbsolutePositioningCommand::IsCommandEnabled()`](https://searchfox.org/mozilla-central/rev/f46e2bf881d522a440b30cbf5cf8d76fc212eaf4/editor/libeditor/HTMLEditorCommands.cpp#1038-1056) overrides [`StateUpdatingCommandBase::IsCommandEnabled()`](https://searchfox.org/mozilla-central/rev/f46e2bf881d522a440b30cbf5cf8d76fc212eaf4/editor/libeditor/HTMLEditorCommands.cpp#65-77). There are only 2 differences between them: 1. `AbsolutePositioningCommand::IsCommandEnabled()` never returns true if given context is not an HTMLEditor instance. 2. `AbsolutePositioningCommand::IsCommandEnabled()` checks `HTMLEditor::IsAbsolutePositionEditorEnabled()` additionally. So, we can get rid of it if we make `StateUpdatingCommandBase::IsCommandEnabled()` check given command name is "cmd_absPos" or not. The mapping is here: https://searchfox.org/mozilla-central/rev/ec489aa170b6486891cf3625717d6fa12bcd11c1/editor/libeditor/HTMLEditorController.cpp#102 Differential Revision: https://phabricator.services.mozilla.com/D28685
bc7f7e832c4e8635df5b267e3c0a534ccc11424c: Bug 1546578 - part 3: Get rid of HighlightColorStateCommand::IsCommandEnabled() because of it's exactly same as its superclass's definition r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 26 Apr 2019 03:20:45 +0000 - rev 530496
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1546578 - part 3: Get rid of HighlightColorStateCommand::IsCommandEnabled() because of it's exactly same as its superclass's definition r=m_kato [`HighlightColorStateCommand::IsCommandEnabled()`](https://searchfox.org/mozilla-central/rev/f46e2bf881d522a440b30cbf5cf8d76fc212eaf4/editor/libeditor/HTMLEditorCommands.cpp#930-942) is exactly same as [its superclass's implementation](https://searchfox.org/mozilla-central/rev/f46e2bf881d522a440b30cbf5cf8d76fc212eaf4/editor/libeditor/HTMLEditorCommands.cpp#586-599). So, we can get rid of it. Differential Revision: https://phabricator.services.mozilla.com/D28684
fa8572b81eaac032bafe2b38028746f7491dbffe: Bug 1546578 - part 2: Make all editor command classes derived from `EditorCommand` class r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 26 Apr 2019 03:20:02 +0000 - rev 530495
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1546578 - part 2: Make all editor command classes derived from `EditorCommand` class r=m_kato This patch makes all editor command classes derived from `EditorCommand` class. So, this allows `nsHTMLEditor::ExecCommand()` to access them directly in the future. Differential Revision: https://phabricator.services.mozilla.com/D28683
adbd46962f21820f20a236c66fe1f3bdb57e52b4: Bug 1546578 - part 1: Get rid of HTMLEditorCommands.h r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 26 Apr 2019 02:20:22 +0000 - rev 530494
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1546578 - part 1: Get rid of HTMLEditorCommands.h r=m_kato When declaring a common base class of all editor command classes in EditorCommands.h, we need to declare some useful macro to declare its subclasses. However, such macro should be `#undef`ed in the header file. Therefore, this patch moves all contents in HTMLEditorCommands.h to EditorCommands.h and removes it from the tree. Differential Revision: https://phabricator.services.mozilla.com/D28682
feb8846c6602b5fb4a2580ee1f9155d2fb509585: Bug 1546577 - Make overloads of CanCut(), CanCopy(), CanDelete() and CanPaste() which return bool instead of nsresult r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 25 Apr 2019 07:14:39 +0000 - rev 530063
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1546577 - Make overloads of CanCut(), CanCopy(), CanDelete() and CanPaste() which return bool instead of nsresult r=m_kato `CanCut()`, `CanCopy()` and `CanPaste()` return error only when the editor has already been destroyed or not been initialized yet, or when failed to access clipboard when the document is not HTML/XHTML. `CanDelete()` returns error only when the editor has already been destroyed or not been initialized yet. So, these error result won't be exposed to the web in most cases and such exception shouldn't stop any content script because Chrome basically does not throw exception in such situation as far as I know. Therefore, there should be overloads of them to return `bool` result directly for making their callers simpler. Differential Revision: https://phabricator.services.mozilla.com/D28608
b742fcff4f2bd93c8bce4923ca206f1c945d1823: Bug 1543966 - part 2: Make "HTML editor commands" and "document state commands" singleton classes r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 15 Apr 2019 07:29:17 +0000 - rev 528294
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1543966 - part 2: Make "HTML editor commands" and "document state commands" singleton classes r=m_kato Some "HTML editor commands" are stateful due to storing tag name to handle it with specific command. However, we can make it stateless with retrieving tag name from command name once per command only when it's necessary. The runtime cost must be really cheap since we can map it with hash table. This patch makes them stateless and singleton classes. So, we can save footprint and allocation runtime cost with this change. Differential Revision: https://phabricator.services.mozilla.com/D27407
47b6254afb9a7c7c7db27f277050176baaf87e3c: Bug 1543966 - part 1: Make "editing commands" and "editor commands" singleton classes r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 15 Apr 2019 07:49:46 +0000 - rev 528293
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1543966 - part 1: Make "editing commands" and "editor commands" singleton classes r=m_kato Different from the comment in `EditorCommands.h`, editing commands and editor commands are instantiated for each editable document or each `HTMLInputElement` or `HTMLTextareaElement`. Therefore, even though they are stateless, we allocate too many instances of them. We should make them singleton classes to reduce the footprint and save runtime allocation cost. Differential Revision: https://phabricator.services.mozilla.com/D27406
fb6392410d8cbc2296c1810ee6105311d9e270cc: Bug 1539110 - Make HTMLEditor::RemoveStyleInside() and HTMLEditor::SplitStyleAbovePoint() check tag names with whitelist r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 12 Apr 2019 01:17:50 +0000 - rev 528021
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1539110 - Make HTMLEditor::RemoveStyleInside() and HTMLEditor::SplitStyleAbovePoint() check tag names with whitelist r=m_kato `document.execCommand("removeformat")` removes any elements in the range which are editable, not `<a>`, not block and a container. https://searchfox.org/mozilla-central/rev/dd7e27f4a805e4115d0dbee70e1220b23b23c567/editor/libeditor/HTMLStyleEditor.cpp#760-763 This means that it removes hidden elements like `<script>` and `<style>`, or non-HTML elements like SVG elements. However, the unofficial document of `execCommand()` lists up elements which should be handled by the command. https://w3c.github.io/editing/execCommand.html#removeformat-candidate Additionally, Chrome respects this list since not including `<del>` element into the list does not make sense but Chrome ignores it. So, we should respect the list. Differential Revision: https://phabricator.services.mozilla.com/D27018
70d5e0b1c0f874fe3845489c0a721ef143e53e6e: Bug 1530649 - Improve composition string handling which ends with whitespaces r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 09 Apr 2019 05:28:38 +0000 - rev 527288
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1530649 - Improve composition string handling which ends with whitespaces r=m_kato If insertion string ends with ASCII whitespace and there is no following content in the block, `HTMLEditRules::AdjustWhitespaces()` needs to insert `<br>` element. It's called only by `HTMLEditRules::AfterEditInner()` and that does only simple things with `WSRunObject`. Therefore, this moves the code into `AfterEditInner()`. For making it adjust the whitespaces, `HTMLEditRules::WillInsertText()` needs to notify `AfterEditInner()` of dirty range with `mDocChangeRange`. Therefore, this patch makes it set `mDocChangeRange` manually after inserting composition string. On the other hand, there is another bug. `WSRunObject` was designed to treat only inserting text for `WSRunObject::InsertText()`. I.e., not designed to treat replacing existing composition string with new string. Therefore, `WSRunObject::InsertText()` adjusts whitespaces only around start of composition string. Therefore, if composition string ends with an ASCII whitespace, it's not replaced with NBSP and that causes: - failing `WSRunObject::AdjustWhitespaces()` inserts `<br>` element at `AfterEditInner()` of committing composition. - then, next composition's first `WSRunObject::InsertText()` removes the last whitespace due to not followed by `<br>` nor any other content. Therefore, this patch makes `WSRunObject` takes 2 DOM points to be able to treat replaced range. In strictly speaking, the latter change require more changes and tests for supporting replacement with any other methods. However, it's risky and out of scope of this bug. Differential Revision: https://phabricator.services.mozilla.com/D26423
c7ec5a12950618af4257d9c0a512a3acff1dced1: Bug 1539356 - Mark EditorBase::InsertNodeTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Sat, 30 Mar 2019 11:55:29 +0000 - rev 525770
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1539356 - Mark EditorBase::InsertNodeTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato This patch marks `EditorBase::InsertNodeTransaction()` **and** its callers as `MOZ_CAN_RUN_SCRIPT`. Unfortunately, this patch tells us that some `GetSomething()` methods may destroy the editor since `HTMLEditRules::GetNodesForOperation()`, `HTMLEditRules::GetNodesFromPoint()` and `HTMLEditRules::GetNodesFromSelection()` may change the DOM tree. Additionally, initialization methods may destroy the editor since it may insert a bogus `<br>` node. Note that this patch also removes some unused methods. I.e., they are not result of some cleaning up the code. This patch just avoids marking unused methods as `MOZ_CAN_RUN_SCRIPT`. Differential Revision: https://phabricator.services.mozilla.com/D25027
447c87c2d1396aa1d0980d023067f1629d972c25: Bug 1539356 - Mark EditorBase::InsertNodeTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 29 Mar 2019 10:55:31 +0000 - rev 525557
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1539356 - Mark EditorBase::InsertNodeTransaction() as MOZ_CAN_RUN_SCRIPT r=m_kato This patch marks `EditorBase::InsertNodeTransaction()` **and** its callers as `MOZ_CAN_RUN_SCRIPT`. Unfortunately, this patch tells us that some `GetSomething()` methods may destroy the editor since `HTMLEditRules::GetNodesForOperation()`, `HTMLEditRules::GetNodesFromPoint()` and `HTMLEditRules::GetNodesFromSelection()` may change the DOM tree. Additionally, initialization methods may destroy the editor since it may insert a bogus `<br>` node. Note that this patch also removes some unused methods. I.e., they are not result of some cleaning up the code. This patch just avoids marking unused methods as `MOZ_CAN_RUN_SCRIPT`. Differential Revision: https://phabricator.services.mozilla.com/D25027
f40a5097cc74cfe618db8e5bf924cd96277ef3bc: Bug 1529241 - Add WPT test for line-breaking of various emoji clusters. r=m_kato
Jonathan Kew <jkew@mozilla.com> - Thu, 28 Mar 2019 09:35:17 +0000 - rev 525373
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1529241 - Add WPT test for line-breaking of various emoji clusters. r=m_kato (The tests currently fail on macOS using mozilla CI because of the old version of macOS present there, which has an emoji font that doesn't support some of these sequences. On macOS 10.13, the tests pass as expected, so the failure annotations are temporary until the test environment is updated in bug https://bugzilla.mozilla.org/show_bug.cgi?id=1530474.) Depends on D25101 Differential Revision: https://phabricator.services.mozilla.com/D25102
a20ab6d47774bc92a076a769ccdbb8bf3c959294: Bug 1529241 - Handle emoji-zwj sequences in unicode::ClusterIterator so that we avoid breaking them across lines or during selection. r=m_kato
Jonathan Kew <jkew@mozilla.com> - Thu, 28 Mar 2019 09:57:40 +0000 - rev 525372
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1529241 - Handle emoji-zwj sequences in unicode::ClusterIterator so that we avoid breaking them across lines or during selection. r=m_kato Depends on D25100 Differential Revision: https://phabricator.services.mozilla.com/D25101
10850a60571a2de046a3909dd3ab1f26ff38051a: Bug 1529241 - Preliminary cleanup - remove gfxPlatform::SetupClusterBoundaries, as it doesn't have any callers. r=m_kato
Jonathan Kew <jkew@mozilla.com> - Thu, 28 Mar 2019 08:59:10 +0000 - rev 525371
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1529241 - Preliminary cleanup - remove gfxPlatform::SetupClusterBoundaries, as it doesn't have any callers. r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D25100
1b38317f4237a11d18276e39567819b3f493c547: Bug 1533293 - part 3: Make editor and ContentEventHandler not use Selection::Extend() due to too slow r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 26 Mar 2019 10:09:47 +0000 - rev 524883
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1533293 - part 3: Make editor and ContentEventHandler not use Selection::Extend() due to too slow r=m_kato `Selection::Extend()` is too slow but editor and ContentEventHandler use it in some places. We should make them use `Selection::SetStartAndEndInLimiter()` or `Selection::SetBaseAndExtentInLimiter()`. The former is usable only when caller guarantees the start point is prior to the end point in the DOM tree. Otherwise, we need to use the latter even though it's slower than the former. Differential Revision: https://phabricator.services.mozilla.com/D23462
889784eb39fac9ad684e128613da91f184d28076: Bug 1533293 - part 2: Rewrite EditorBase::SelectEntireDocument() and its overrides r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 26 Mar 2019 10:06:43 +0000 - rev 524882
Push 11265 by ffxbld-merge at Mon, 13 May 2019 10:53:39 +0000
Bug 1533293 - part 2: Rewrite EditorBase::SelectEntireDocument() and its overrides r=m_kato `EditorBase::SelectEntierDocument()` uses `Selection::Extend()` but it's too slow. It should use `Selection::SetStartAndEndInLimiter()` instead. Additionally, `TextEditor::SelectEntierDocument()` shrink the result of `EditorBase::SelectEntierDocument()` with `Selection::Extend()` if there is a `moz-<br>` element. So, `TextEditor::SelectEntinerDocument()` should set its expected selection with a call for saving the runtime cost. Then, we don't need to make `EditorBase::SelectEntierDocument()` as non-pure virtual method. So, this patch makes each its callers call `Selection->SelectAllChildren()` directly. Differential Revision: https://phabricator.services.mozilla.com/D23461
075d0e6434cc74054eeefb2a768d7629e9f2de95: Bug 1525867 - Make IMContextWrapper::SetTextRange() not ignore composition clause even if no visual styles are specified r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 18 Mar 2019 03:00:23 +0000 - rev 522621
Push 10871 by cbrindusan@mozilla.com at Mon, 18 Mar 2019 15:49:32 +0000
Bug 1525867 - Make IMContextWrapper::SetTextRange() not ignore composition clause even if no visual styles are specified r=m_kato We've ignored clauses whose visual styles are not specified. However, kinput2 with XIM protocol does not specify any styles to non-selected clauses. Therefore, we fail to dispatch eCompositionChange events if there is 2 or more clauses. Note that the log in the bug indicates that we may set selected clause type to`TextRangeType::eConvertedClause` and last clause type to `TextRangeType::eSelectedClause` because caret is always put at end of composition string. However, this should not problem for now because nobody except plugins on Windows refer this information. Differential Revision: https://phabricator.services.mozilla.com/D23464
d011dfe8368374923cb69a0ab510d6814cbf3ab1: Bug 1533293 - part 3: Make editor and ContentEventHandler not use Selection::Extend() due to too slow r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 18 Mar 2019 01:52:36 +0000 - rev 522614
Push 10871 by cbrindusan@mozilla.com at Mon, 18 Mar 2019 15:49:32 +0000
Bug 1533293 - part 3: Make editor and ContentEventHandler not use Selection::Extend() due to too slow r=m_kato `Selection::Extend()` is too slow but editor and ContentEventHandler use it in some places. We should make them use `Selection::SetStartAndEndInLimiter()` or `Selection::SetBaseAndExtentInLimiter()`. The former is usable only when caller guarantees the start point is prior to the end point in the DOM tree. Otherwise, we need to use the latter even though it's slower than the former. Differential Revision: https://phabricator.services.mozilla.com/D23462
e536f6e123d8f54d5bf165e5e78da13c71a901af: Bug 1533293 - part 2: Rewrite EditorBase::SelectEntireDocument() and its overrides r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 18 Mar 2019 01:51:53 +0000 - rev 522613
Push 10871 by cbrindusan@mozilla.com at Mon, 18 Mar 2019 15:49:32 +0000
Bug 1533293 - part 2: Rewrite EditorBase::SelectEntireDocument() and its overrides r=m_kato `EditorBase::SelectEntierDocument()` uses `Selection::Extend()` but it's too slow. It should use `Selection::SetStartAndEndInLimiter()` instead. Additionally, `TextEditor::SelectEntierDocument()` shrink the result of `EditorBase::SelectEntierDocument()` with `Selection::Extend()` if there is a `moz-<br>` element. So, `TextEditor::SelectEntinerDocument()` should set its expected selection with a call for saving the runtime cost. Then, we don't need to make `EditorBase::SelectEntierDocument()` as non-pure virtual method. So, this patch makes each its callers call `Selection->SelectAllChildren()` directly. Differential Revision: https://phabricator.services.mozilla.com/D23461
781fba7bac687ef83bc40bfa4f8e7f7800eaff27: Bug 1508302 - Make IMContextWrapper::GetIMEName() refer XMODIFIERS env when gtk_im_multicontext_get_context_id() returns "wayland" r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 15 Mar 2019 06:37:59 +0000 - rev 522021
Push 10871 by cbrindusan@mozilla.com at Mon, 18 Mar 2019 15:49:32 +0000
Bug 1508302 - Make IMContextWrapper::GetIMEName() refer XMODIFIERS env when gtk_im_multicontext_get_context_id() returns "wayland" r=m_kato On Wayland, `gtk_im_multicontext_get_context_id()` returns `"wayland"`. However, we need to know actual IM which works behind Wayland. Fortunately, `XMODIFIERS` env includes IME name like "xim" case. Therefore, we can refer it instead. Differential Revision: https://phabricator.services.mozilla.com/D23469
dd95011124a522d76265e0cd3382bf7ada44b750: Bug 1534561 - Make editor use PresShell directly rather than nsIPresShell r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 15 Mar 2019 05:01:10 +0000 - rev 522019
Push 10871 by cbrindusan@mozilla.com at Mon, 18 Mar 2019 15:49:32 +0000
Bug 1534561 - Make editor use PresShell directly rather than nsIPresShell r=m_kato `PresShell.h` is exposed as `mozilla/PresShell.h` and `PresShell` is the only concrete class of `nsIPresShell`. Therefore, we have no reason to access `PresShell` via `nsIPresShell`. Differential Revision: https://phabricator.services.mozilla.com/D23277
ecbfad744a66ee47428dff7992aa6604391844e6: Bug 1532890 - Get rid of CachedWeakPtr due to unused r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 07 Mar 2019 04:25:40 +0000 - rev 520700
Push 10862 by ffxbld-merge at Mon, 11 Mar 2019 13:01:11 +0000
Bug 1532890 - Get rid of CachedWeakPtr due to unused r=m_kato The class was created for Quantum Flow, but now, nobody uses it. Differential Revision: https://phabricator.services.mozilla.com/D22266
f7677d79738b9117c8cc8ad2e9a4efce7f7dd935: Bug 1524610: Add a document for building GeckoView Example. r=jdescottes,m_kato
Daisuke Akatsuka <dakatsuka@mozilla.com> - Fri, 22 Feb 2019 04:00:29 +0000 - rev 520671
Push 10862 by ffxbld-merge at Mon, 11 Mar 2019 13:01:11 +0000
Bug 1524610: Add a document for building GeckoView Example. r=jdescottes,m_kato Differential Revision: https://phabricator.services.mozilla.com/D19106
cd0319771873a7a0acd613d4e6ee38d0eb3ce174: Bug 1524731 - Fix ADB tests in aarch64;r=m_kato
Julian Descottes <jdescottes@mozilla.com> - Thu, 28 Feb 2019 07:07:55 +0000 - rev 519478
Push 10862 by ffxbld-merge at Mon, 11 Mar 2019 13:01:11 +0000
Bug 1524731 - Fix ADB tests in aarch64;r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D21424
d954c8365626fc7dac127fd9c464f1008b9b06ba: Bug 1530250 - Make InsertTagCommand::DoCommandParams() check result of nsCommandParams::GetString() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 27 Feb 2019 00:44:18 +0000 - rev 519276
Push 10862 by ffxbld-merge at Mon, 11 Mar 2019 13:01:11 +0000
Bug 1530250 - Make InsertTagCommand::DoCommandParams() check result of nsCommandParams::GetString() r=m_kato Accidentally, I removed the check in the previous landing (bug 1529190). This patch restores it. Differential Revision: https://phabricator.services.mozilla.com/D20970