searching for reviewer(m_kato)
2b253a5c9821: Bug 1491032 - Make TISInputSourceWrapper::WillDispatchKeyboardEvent() decide charCode value with keypress event index. r=m_kato a=pascalc
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 18 Sep 2018 01:46:29 +0000 - rev 492566
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1491032 - Make TISInputSourceWrapper::WillDispatchKeyboardEvent() decide charCode value with keypress event index. r=m_kato a=pascalc If a key inputs multiple characters, we dispatch same number eKeyPress events to input each character. However, TISInputSourceWrapper::WillDispatchKeyboardEvent() always sets charCode of all eKeyPress events to first character of inserting. Instead, it should set charCode value to nth character of the inserting string. Differential Revision: https://phabricator.services.mozilla.com/D5884
504e97de9d59: Bug 1484131 - part 0: Add automated tests for nsITableEditor.getFirstSelectedCellInTable() and fixes a crash bug of it r=m_kato a=pascalc
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 14 Sep 2018 12:49:46 +0000 - rev 492507
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484131 - part 0: Add automated tests for nsITableEditor.getFirstSelectedCellInTable() and fixes a crash bug of it r=m_kato a=pascalc This adds automated tests for nsITableEditor.getFirstSelectedCellInTable(). However, this test crashes due to regression of bug 1484128. So, we need to uplift only this fix into the Beta. Differential Revision: https://phabricator.services.mozilla.com/D5663
270504f95e58: Bug 1488333 - Enable some mochitests for editor which were disabled on debug build of Android due to bug 1480702 r=m_kato a=test-only
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 05 Sep 2018 09:27:01 +0000 - rev 492406
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1488333 - Enable some mochitests for editor which were disabled on debug build of Android due to bug 1480702 r=m_kato a=test-only Because of the rewrite of test_request.html, now, we can enable the mochitests for editor which were disabled on debug build of Android due to bug 1480702. Differential Revision: https://phabricator.services.mozilla.com/D4904
12a3fa1ec069: Bug 1485253 - fix crashes due to dead windows' taskbar preview objects sticking around, r=m_kato,florian
Gijs Kruitbosch <gijskruitbosch@gmail.com> - Thu, 30 Aug 2018 00:58:19 +0000 - rev 491783
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1485253 - fix crashes due to dead windows' taskbar preview objects sticking around, r=m_kato,florian The fix in bug 1418793 accidentally removed the onCloseWindow call, which meant we were setting `.enabled` on taskbar window objects whose windows were already dead, which was causing crashes. I've reverted the removal, and also added some nullchecking, because the C++ component shouldn't make it this easy for consumers to cause crashes. Differential Revision: https://phabricator.services.mozilla.com/D4559
71525c253ed0: Bug 1485935 - Use NS_IMETHODIMP for implementation of HTMLEditor::GetIsCSSEnabled() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 28 Aug 2018 09:46:53 +0000 - rev 491418
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1485935 - Use NS_IMETHODIMP for implementation of HTMLEditor::GetIsCSSEnabled() r=m_kato Even though HTMLEditor::GetIsCSSEnabled() is an implementation of an XPCOM method, it uses nsresult as its return type. We should change it to NS_IMETHODIMP. Additionally, SetDocumentStateCommand::GetCommandStateParams() calls this, but HTMLEditor can expose non-virtual method, HTMLEditor::IsCSSEnabled(). Therefore, this patch makes it public and makes SetDocumentStateCommand use HTMLEditor::IsCSSEnabled(). Differential Revision: https://phabricator.services.mozilla.com/D4304
5e3078b8f344: Bug 1485934 - Get rid of nsIHTMLEditor.getFontColorState() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 27 Aug 2018 06:52:35 +0000 - rev 491203
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1485934 - Get rid of nsIHTMLEditor.getFontColorState() r=m_kato Neither comm-central nor BlueGriffon uses nsIHTMLEditor.getFontColorSetate(). So, we can get rid of this from nsIHTMLEditor. However, we need to keep it as a non-virtual public method since it's used by FontColorStateCommand. Differential Revision: https://phabricator.services.mozilla.com/D4303
9da197304355: Bug 1484129 - part 1: Create HTMLEditor::GetNextSelectedTableCellElement() for internal use of nsITableEditor::GetNextCellElement() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 27 Aug 2018 06:50:12 +0000 - rev 491199
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484129 - part 1: Create HTMLEditor::GetNextSelectedTableCellElement() for internal use of nsITableEditor::GetNextCellElement() r=m_kato nsITableEditor::GetNextCellElement() is an XPCOM method but it's used internally a lot. So, HTMLEditor should implement it with non-virtual method and internal users should use the non-virtual method. Therefore, this patch creates HTMLEditor::GetNextSelectedTableCellElement(). Differential Revision: https://phabricator.services.mozilla.com/D4194
bfbee4aff230: Bug 1484129 - part 0: Add automated tests for nsITableEditor::GetNextSelectedCell() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 27 Aug 2018 06:50:41 +0000 - rev 491198
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484129 - part 0: Add automated tests for nsITableEditor::GetNextSelectedCell() r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D4193
90f962c6f3df: Bug 1484128 - part 1: Create HTMLEditor::GetFirstSelectedTableCellElement() for internal use of HTMLEditor::GetFirstSelectedCell() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 24 Aug 2018 08:29:12 +0000 - rev 491044
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484128 - part 1: Create HTMLEditor::GetFirstSelectedTableCellElement() for internal use of HTMLEditor::GetFirstSelectedCell() r=m_kato HTMLEditor::GetFirstSelectedCell() is an XPCOM method, but used internally a lot. Therefore, we should create a non-virtual method for internal use. This patch creates HTMLEditor::GetFirstSelectedTableCellElement(), and it won't return NS_SUCCESS_EDITOR_ELEMENT_NOT_FOUND since nobody needs the value. It's enough to check whether the result is nullptr without error for any callers. Differential Revision: https://phabricator.services.mozilla.com/D4060
7f45ff1131eb: Bug 1484128 - part 0: Add automated tests for nsITableEditor::GetFirstSelectedCell() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 24 Aug 2018 08:28:06 +0000 - rev 491043
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484128 - part 0: Add automated tests for nsITableEditor::GetFirstSelectedCell() r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D4059
33d24ba5659c: Bug 1485293 - Make test_resizers_resizing_elements.html allow 2px difference of the result r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 24 Aug 2018 08:13:07 +0000 - rev 491042
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1485293 - Make test_resizers_resizing_elements.html allow 2px difference of the result r=m_kato Oddly, on Android, size of resized objects may be 2px different from ideal value. I don't know the reason, could be zoom level or something is affected. However, fortunately, this difference is not important for this test because this test checks whether resizers actually works with specific elements. So, even if the result is 2px smaller or bigger than ideal value, we succeeded to check the resizer makes the element bigger or smaller as expected. Therefore, this patch makes the test allow 2px differences of the result. Additionally, on Android, this test is always timed out if TV (even opt build). So, this patch disables TV on Android. Differential Revision: https://phabricator.services.mozilla.com/D4058
043aff7fda61: Bug 1485369 - part 1: HTMLEditor::HideResizers() should not stop cleaning up even if there is no window r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 24 Aug 2018 06:27:48 +0000 - rev 490933
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1485369 - part 1: HTMLEditor::HideResizers() should not stop cleaning up even if there is no window r=m_kato Oddly, on 63 Beta simulation, nsIDocument::GetWindow() may return nullptr when HTMLEditor is being destroyed by unload of the page. I'm not sure if this is an expected change. However, HTMLEditor::HideResizers() should not stop cleaning up even if it meets unexpected situation. Additionally, this patch moves all HTMLEditor members related to resizers to local variables since while HideResizers() is cleaning up old resizers, the members may be overwritten by ShowResizers() if mutation event listener or something does something. Differential Revision: https://phabricator.services.mozilla.com/D4057
4ca06c8731d3: Bug 1485369 - part 0: Clean up HTMLEditor::HideResizers() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 24 Aug 2018 03:46:18 +0000 - rev 490931
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1485369 - part 0: Clean up HTMLEditor::HideResizers() r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D4056
3d27e4213ccc: Bug 1484127 - part 1: Create HTMLEditor::GetTableCellElementAt() for internal use of nsITableEditor::GetCellAt() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 23 Aug 2018 06:39:30 +0000 - rev 490739
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484127 - part 1: Create HTMLEditor::GetTableCellElementAt() for internal use of nsITableEditor::GetCellAt() r=m_kato nsITableEditor::GetCellAt() is an XPCOM method, but this is called internally a lot. So, we should create non-virtual method for internal use. The XPCOM method retrieves a <table> element if given element is nullptr. However, no internal user needs this feature. So, we can create GetTableCellElementAt() simply. Then, we can get rid of nsresult and ErrorResult from it. Differential Revision: https://phabricator.services.mozilla.com/D3956
b95c3522fa1e: Bug 1484127 - part 0: Add automated tests for nsITableEditor::GetCellAt() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 23 Aug 2018 06:13:22 +0000 - rev 490738
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484127 - part 0: Add automated tests for nsITableEditor::GetCellAt() r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D3955
3cf8d56c3f33: Bug 1484125 - part 1: Create TableSize struct to compute and store number of rows and columns of a <table> element r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 23 Aug 2018 07:32:16 +0000 - rev 490737
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484125 - part 1: Create TableSize struct to compute and store number of rows and columns of a <table> element r=m_kato HTMLEditor::GetTableSize() is an XPCOM method but used internally a lot. Therefore, it shouldn't be called for internal use. Additionally, the callers need to declare two int32_t variables, but this causes the code messy. Therefore, this patch creates TableSize struct and it implements HTMLEditor::GetTableSize(). Then, all callers of it is replaced with TableSize struct. New TableSize struct does not support computes <table> element from anchor of Selection since there is no user of this in C++ code. Differential Revision: https://phabricator.services.mozilla.com/D3953
5c0edfef06dd: Bug 1484125 - part 0: Add automated tests for nsITableEditor::GetTableSize() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 23 Aug 2018 06:42:11 +0000 - rev 490736
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484125 - part 0: Add automated tests for nsITableEditor::GetTableSize() r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D3951
2dcfee19716d: Bug 1484124 - part 1: Create HTMLEditor::GetCellIndexes() class to get and store indexes of a table cell r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Aug 2018 03:34:40 +0000 - rev 490522
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484124 - part 1: Create HTMLEditor::GetCellIndexes() class to get and store indexes of a table cell r=m_kato HTMLEditor::GetCellIndexes() is an XPCOM method and used a lot internally. So, we need alternative way to retrieve indexes of a cell without virtual calls. In a lot of places, receiving indexes with 2 int32_t variables causes the code messy and that causes making it harder to understand which are index for same cell and where they come from. So, making both of them stored one variable makes the callers simpler. Therefore, this patch creates CellIndexes stack class to get and store the result simply. Then, this makes all callers of GetCellIndexes() use this new class and makes GetCellIndexes() also use this new class. FYI: This patch does NOT put ErrorResult instances in small block scope as far as possible. The reason is, I see its destructor in profile sometimes. I don't think that we should use nsresult& instead of ErrorResult& only for this performance reason, but I think that creating each instance in loops does not make sense. Differential Revision: https://phabricator.services.mozilla.com/D3849
325f0f4b0f11: Bug 1484124 - part 0: Add automated tests for nsITableEditor::GetCellIndexes() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Aug 2018 03:35:05 +0000 - rev 490521
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484124 - part 0: Add automated tests for nsITableEditor::GetCellIndexes() r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D3848
357d549504fb: Bug 1484115 - part 2: Get rid of nsITableEditor.getNextRow() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Aug 2018 06:52:16 +0000 - rev 490497
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484115 - part 2: Get rid of nsITableEditor.getNextRow() r=m_kato Nobody uses nsITableEditor.getNextRow(). Therefore, this patch removes this XPCOM API. Differential Revision: https://phabricator.services.mozilla.com/D3949
05f438b601b5: Bug 1484115 - part 1: Create HTMLEditor::GetNextTableRowElement() for internal use of nsITableEditor::GetNextRow() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Aug 2018 06:52:07 +0000 - rev 490496
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484115 - part 1: Create HTMLEditor::GetNextTableRowElement() for internal use of nsITableEditor::GetNextRow() r=m_kato nsITableEditor::GetNextRow() is an XPCOM method. Therefore, we should have a non-virtual method for internal use of it. This changes the definition in nsITableEditor. First, it allows only <tr> element as what HTMLEditor::GetNextRow() has actually done. Then, changes the return type to Element since it always returns an element node. Differential Revision: https://phabricator.services.mozilla.com/D3948
2dd1517113c3: Bug 1484693 - Fix some nits of test_resizers_resizing_elements.html r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Aug 2018 06:44:51 +0000 - rev 490494
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484693 - Fix some nits of test_resizers_resizing_elements.html r=m_kato There are 2 bugs: One is a simple mistake. kTest is each item of the tests, kTests is array of all tests. When it needs to refer kTest.isAbsolutePosition, it referred kTests.isAbsolutePosiiton. Therefore, the test always failed to enable editing UI for absolute positioned element. The other is, this test requires to disable inline-table-editing UI (which is add or remove rows and columns). Note that even if the UI is disabled, resizers is available for <table> elements. Differential Revision: https://phabricator.services.mozilla.com/D3954
090edc3b798b: Bug 1484113 - part 1: Create HTMLEditor::GetFirstTableRowElement() for internal use of nsITableEditor::GetFirstRow() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Aug 2018 01:20:23 +0000 - rev 490477
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484113 - part 1: Create HTMLEditor::GetFirstTableRowElement() for internal use of nsITableEditor::GetFirstRow() r=m_kato nsITableEditor::GetFirstRow() is an XPCOM method, so, for internal use, we should create non-virtual method, that is GetFirstTableRowElement(). This patch makes it never return NS_SUCCESS_EDITOR_ELEMENT_NOT_FOUND since nobody refers it and it's detectable. If the method returns nullptr without error, it's the case of NS_SUCCESS_EDITOR_ELEMENT_NOT_FOUND. Additionally, this patch changes the return type of GetFirstRow() from Node to Element since it always return an Element node if not null. Differential Revision: https://phabricator.services.mozilla.com/D3780
af33be3aee82: Bug 1484113 - part 0: Create automated tests for nsITableEditor::GetFirstRow() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Aug 2018 02:16:36 +0000 - rev 490476
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484113 - part 0: Create automated tests for nsITableEditor::GetFirstRow() r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D3779
4f0a12bcb401: Bug 1484110 - part 3: HTMLEditor::RefereshEditingUI() should refresh UIs when one of them is changed to enabled or disabled r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 17 Aug 2018 19:03:02 +0900 - rev 490312
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484110 - part 3: HTMLEditor::RefereshEditingUI() should refresh UIs when one of them is changed to enabled or disabled r=m_kato HTMLEditor::RefereshEditingUI() works only with enabled UIs. Therefore, if UI is disabled while it's visible, it keeps shown. This is too bad if web apps tries to disable the Gecko specific UIs after we show some of them. This patch adds HTMLEditor::HideAnonymousEditingUIsIfUnnecessary() to hide unnecessary UIs and makes RefereshEditingUI() call it always.
6a6a79e2c19b: Bug 1484110 - part 2: Rewrite HTMLEditor::HideInlineTableEditingUI() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 17 Aug 2018 18:23:13 +0900 - rev 490311
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484110 - part 2: Rewrite HTMLEditor::HideInlineTableEditingUI() r=m_kato First, HTMLEditor::HideInlineTableEditingUI() always returns NS_OK. So, we can change its return type to void. Additionally, it removes each UI from the DOM tree one by one. However, each mutation could cause showing same UI again. In such case, ShowInlineTableEditingUI() overwrites each UI with newly created element. Then, HTMLEditor cannot remove the old UI anymore. Therefore, this patch moves all members of the UI into local variables first.
08d0e0c32a53: Bug 1484110 - part 1: Create HTMLEditor::RefereshEditingUI() for internal use of nsIHTMLEditor::CheckSelectionStateForAnonymousButtons() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 17 Aug 2018 17:56:28 +0900 - rev 490310
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484110 - part 1: Create HTMLEditor::RefereshEditingUI() for internal use of nsIHTMLEditor::CheckSelectionStateForAnonymousButtons() r=m_kato HTMLEditor::CheckSelectionStateForAnonymousButtons() is called a lot internally. Especially, its virtual call cost may make damage to our performance since it's called from a selection listener. So, we should create non-virtual method, RefereshEditingUI() for internal use.
dcdd7d0adcc0: Bug 1484094 - Don't allow the caret to be placed within a ligated emoji sequence. r=m_kato
Jonathan Kew <jkew@mozilla.com> - Mon, 20 Aug 2018 09:07:40 +0100 - rev 490077
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484094 - Don't allow the caret to be placed within a ligated emoji sequence. r=m_kato
541fbb29f21d: Bug 1449564 - part 4: Make users can show Gecko specific editing UIs with new prefs r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 16 Aug 2018 13:51:36 +0900 - rev 490049
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1449564 - part 4: Make users can show Gecko specific editing UIs with new prefs r=m_kato Even after we disable Gecko specific editing UIs by default, web apps can enable them with execCommand. However, until such web apps change their behavior, users cannot use Gecko specific UIs. At least for now, we should make users can enable them by default. MozReview-Commit-ID: AuAdw4FQ4He
e93a23a4741c: Bug 1449564 - part 3: Make absolute position editor listen to mouse events at the system event group r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 05 Apr 2018 00:32:32 +0900 - rev 490048
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1449564 - part 3: Make absolute position editor listen to mouse events at the system event group r=m_kato Currently, absolute position editor listens to mouse events at the default event group to handle dragging of positioner. However, this is blocked by a call of Event.stopPropagation() in web apps unexpectedly. Therefore, we should make it listen to the events at the system event group instead. MozReview-Commit-ID: Hoa8c9QvMuG
ccb713187e45: Bug 1449564 - part 2: Make absolute positioned element editor disabled in default and make it possible to enable it with new command r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 04 Apr 2018 22:27:49 +0900 - rev 490047
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1449564 - part 2: Make absolute positioned element editor disabled in default and make it possible to enable it with new command r=m_kato We have another built-in UI of editor which is not implemented by any other browsers. That is a draggable handler to move absolute positioned elements. So, we should disable it in default for compatibility with the other browsers. However, different from resizers and inline table editor, we don't have command to enable/disable this feature but for backward compatibility, we should have it. Therefore, this patch adds new command "enableAbsolutePositionEditor". Note that whether resizing UI is available only with enableObjectResizing state is different from enableInlineTableEditing command. Resizers for absolute positioned elements are NOT available both enableObjectResizing and enableAbsolutePositionEditor are enabled. Additionally, this adds automated tests to check basic functions of absolute positioned editor. MozReview-Commit-ID: 9ZSGB8tLpFw
4e0960a6ffb6: Bug 1449564 - part 1: Disable object resizer and inline table editor in default r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 02 Apr 2018 17:26:46 +0900 - rev 490046
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1449564 - part 1: Disable object resizer and inline table editor in default r=m_kato Gecko supports resizers of <img> elements and <table>, <td>, <th> elements and has UI to remove existing table row or column in default. However, the other browsers don't have such UI and web apps need to disable this feature with calling both: document.execCommand("enableObjectResizing", false, false); document.execCommand("enableInlineTableEditing", false, false); for avoiding conflicting with their own features to edit such elements. Therefore, it doesn't make sense to keep enabling them in default only on Gecko. If web apps want to keep using these features, they should call: document.execCommand("enableObjectResizing", false, true); document.execCommand("enableInlineTableEditing", false, true); at initializing the editor. And also this patch fixes bugs of document.queryCommandState("enableObjectResizing") and document.queryCommandState("enableInlineTableEditing"). They always return false even after calling document.execCommand(..., false, true) since nsSetDocumentStateCommand::GetCommandStateParams() sets bool value as STATE_ATTRIBUTE. However, nsHTMLDocument::QueryCommandValue() which is the caller referring STATE_ATTRIBUTE doesn't treat it as bool value. And also those commands are related to state of document. Therefore, they should be return as bool value of STATE_ALL instead. Then, nsHTMLDocument::QueryCommandState() returns the state as expected. Note that those commands are supported only by Gecko. So, we don't need to worry about the compatibility. Finally, this patch rewrites 2 existing tests to check basic behavior of resizers and appearance of resizers. Note that this patch does not add new tests to test inline table editor since it's difficult to test the behavior with current API. Perhaps, we should add an API to nsIHTMLEditor to retrieve each anonymous elements in another bug since it requires to add wrapping API of SpecialPowers. MozReview-Commit-ID: 1FhYo5vcV60
4b5906a29b0c: Bug 1484092 - part 3: IsLinkTag() and IsNamedAnchorTag() should compare with nsGkAtoms r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 17 Aug 2018 14:51:40 +0000 - rev 489857
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484092 - part 3: IsLinkTag() and IsNamedAnchorTag() should compare with nsGkAtoms r=m_kato The methods compared with const characters since we've supported "namedanchor" which is not in nsGkAtoms. Now, it's dropped so that we can compare given atom with nsGkAtoms. Differential Revision: https://phabricator.services.mozilla.com/D3586
a2a95c8855db: Bug 1484092 - part 2: Drop supporting "namedanchor" special element name from nsIHTMLEditor::GetSelectedElement(), nsIHTMLEditor::GetElementOrParentByTagName() and nsIHTMLEditor::CreateElementWithDefaults() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 17 Aug 2018 14:50:56 +0000 - rev 489856
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484092 - part 2: Drop supporting "namedanchor" special element name from nsIHTMLEditor::GetSelectedElement(), nsIHTMLEditor::GetElementOrParentByTagName() and nsIHTMLEditor::CreateElementWithDefaults() r=m_kato Nobody (including comm-central and BlueGriffon) does not use "namedanchor" special element name with those XPCOMs. Of course, our internal callers too. Therefore, we can drop. Note that there is no static Atom for this, so, keeping it makes unnecessary runtime cost for Firefox users. This could cause breaking some legacy add-ons for Thunderbird. However, they can use "anchor" special element name for same purpose. Differential Revision: https://phabricator.services.mozilla.com/D3585
717fb8632016: Bug 1484092 - part 1: Make HTMLEditor::GetElementOrParentByTagName() use nsAtom for the tag name r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 17 Aug 2018 14:06:18 +0000 - rev 489853
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484092 - part 1: Make HTMLEditor::GetElementOrParentByTagName() use nsAtom for the tag name r=m_kato HTMLElementOrParentByTagName() is the last user of IsLinkTag(const nsAString&) and IsNamedAnchorTag(const nsAString&). For making their maintenance easier, let's make GetElementOrParentByTagName() take const nsAtom& for tag name. GetElementOrParentByTagName() has two functions, one is looking for an element starting from a node. The other is, if the start node is nullptr, it retrieves anchor node of Selection as start node. Therefore, this patch splits the first part to GetElementOrParentByTagNameInternal(). Then, creates its wrapper which retrieves anchor of Selection automatically, GetElementOrParentByTagNameAtSelection(). Additionally, this patch makes all internal callers of HTMLEditor use GetElementOrParentByTagNameInternal() or GetElementOrParentByTagNameAtSelection() directly. Then, public method, GetElementOrParentByTagName() is called only by outer classes. Note that some callers use both GetElementOrParentByTagNameInternal() and GetElementOrParentByTagNameAtSelection() since they don't check whether setting node is nullptr. They may be bug of them. We should investigate the API callers later. Differential Revision: https://phabricator.services.mozilla.com/D3584
10fdd041f1b5: Bug 1484092 - part 2: Drop supporting "namedanchor" special element name from nsIHTMLEditor::GetSelectedElement(), nsIHTMLEditor::GetElementOrParentByTagName() and nsIHTMLEditor::CreateElementWithDefaults() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 17 Aug 2018 07:41:55 +0000 - rev 489841
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484092 - part 2: Drop supporting "namedanchor" special element name from nsIHTMLEditor::GetSelectedElement(), nsIHTMLEditor::GetElementOrParentByTagName() and nsIHTMLEditor::CreateElementWithDefaults() r=m_kato Nobody (including comm-central and BlueGriffon) does not use "namedanchor" special element name with those XPCOMs. Of course, our internal callers too. Therefore, we can drop. Note that there is no static Atom for this, so, keeping it makes unnecessary runtime cost for Firefox users. This could cause breaking some legacy add-ons for Thunderbird. However, they can use "anchor" special element name for same purpose. Differential Revision: https://phabricator.services.mozilla.com/D3585
d0b14e8711df: Bug 1484092 - part 1: Make HTMLEditor::GetElementOrParentByTagName() use nsAtom for the tag name r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 17 Aug 2018 10:04:42 +0000 - rev 489840
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1484092 - part 1: Make HTMLEditor::GetElementOrParentByTagName() use nsAtom for the tag name r=m_kato HTMLElementOrParentByTagName() is the last user of IsLinkTag(const nsAString&) and IsNamedAnchorTag(const nsAString&). For making their maintenance easier, let's make GetElementOrParentByTagName() take const nsAtom& for tag name. GetElementOrParentByTagName() has two functions, one is looking for an element starting from a node. The other is, if the start node is nullptr, it retrieves anchor node of Selection as start node. Therefore, this patch splits the first part to GetElementOrParentByTagNameInternal(). Then, creates its wrapper which retrieves anchor of Selection automatically, GetElementOrParentByTagNameAtSelection(). Additionally, this patch makes all internal callers of HTMLEditor use GetElementOrParentByTagNameInternal() or GetElementOrParentByTagNameAtSelection() directly. Then, public method, GetElementOrParentByTagName() is called only by outer classes. Note that some callers use both GetElementOrParentByTagNameInternal() and GetElementOrParentByTagNameAtSelection() since they don't check whether setting node is nullptr. They may be bug of them. We should investigate the API callers later. Differential Revision: https://phabricator.services.mozilla.com/D3584
a28cf4300f12: Bug 1483144 - Make HTMLEditor::GetSelectionContainer() protected r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 16 Aug 2018 15:12:51 +0000 - rev 489785
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1483144 - Make HTMLEditor::GetSelectionContainer() protected r=m_kato HTMLEditor::GetSelectionContainer() is a public method, but it's not used by outer classes. So, we can make it a protected member. Additionally, this patch cleans up the method. - Renames to GetSelectionContainerElement() for making clearer what will be returned. - Makes it const. - Makes it take Selection reference since most callers already have Selection. - Makes it use RangeBoundary to access start point and end point of range since nsRange::StartOffset() and nsRange::EndOffset() may be slow. - Makes it not use GetSelectedElement() since it requires unnecessary additional cost and the condition to call it means it uses only the first path in GetSelectedElement() which just returns start node of the range. - Makes it output warning when it returns nullptr since it reaches nullptr only when illegal cases, e.g., Selection is in orphan node. Differential Revision: https://phabricator.services.mozilla.com/D3461
fd90e385d65b: Bug 1483132 - Make EditorBase::AreNodesSameType() non-virtual r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 16 Aug 2018 10:29:20 +0000 - rev 489784
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1483132 - Make EditorBase::AreNodesSameType() non-virtual r=m_kato EditorBase::AreNodesSameType() is overridden only by HTMLEditor and the implementation is enough simple to re-implement in EditorBase. Additionally, this is called from condition of a loop in JoinNodesDeepWithTransaction(). So, the virtual call cost may make damage to the performance. Differential Revision: https://phabricator.services.mozilla.com/D3460
ef882e3e4b6b: Bug 1483127 - Use NS_IMETHODIMP at definition of HTMLEditor::SetIsCSSEnabled() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 16 Aug 2018 10:05:06 +0000 - rev 489783
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1483127 - Use NS_IMETHODIMP at definition of HTMLEditor::SetIsCSSEnabled() r=m_kato HTMLEditor::SetIsCSSEnabled() is an XPCOM but it's defined with nsresult. Differential Revision: https://phabricator.services.mozilla.com/D3459
c7cba947e504: Bug 1483119 - Get rid of HTMLEditor::GetURLForStyleSheet() since unused r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 16 Aug 2018 10:03:49 +0000 - rev 489782
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1483119 - Get rid of HTMLEditor::GetURLForStyleSheet() since unused r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D3458
f3e7a7dd30a5: Bug 1482023 - Create HTMLEditor::EnableStyleSheetInternal() for internal use r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 16 Aug 2018 10:03:46 +0000 - rev 489781
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1482023 - Create HTMLEditor::EnableStyleSheetInternal() for internal use r=m_kato HTMLEditor::EnableStyleSheet() is an XPCOM method but it's used internally. Therefore, we should create non-virtual method for internal use. Differential Revision: https://phabricator.services.mozilla.com/D3456
4c023e0cd20f: Bug 1482022 - Create HTMLEditor::RemoveOverrideStyleSheetInternal() for internal use r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 16 Aug 2018 10:01:23 +0000 - rev 489780
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1482022 - Create HTMLEditor::RemoveOverrideStyleSheetInternal() for internal use r=m_kato HTMLEditor::RemoveOverrideStyleSheet() is an XPCOM method but used internally. So, we should create non-virtual method for this. Additionally, it calls GetStyleSheetForURL() and RemoveStyleSheetFromList(), but they search index of internal override style sheet array redundantly. Moreover, RemoveStyleSheetFromList() returns error only when given URL is not found, but RemoveOverrideStyleSheet() which is the only one caller, ignores the error. Therefore, for saving the redundant cost, this patch makes RemoveStyleSheetFromList() return removing StyleSheet which is retrieved with the call of GetStyleSheetForURL(). So, RemoveOverrideStyleSheetInternal() stops calling GetStyleSheetForURL(). Differential Revision: https://phabricator.services.mozilla.com/D3455
2d5b4c59078e: Bug 1482021 - Create HTMLEditor::AddOverrideStyleSheetInternal() for internal use r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 16 Aug 2018 09:26:09 +0000 - rev 489776
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1482021 - Create HTMLEditor::AddOverrideStyleSheetInternal() for internal use r=m_kato HTMLEditor::AddOverrideStyleSheet() is an XPCOM method but it's called internally. So, we should create non-virtual method for it and call it for internal use. Differential Revision: https://phabricator.services.mozilla.com/D3454
417967cf69de: Bug 1482020 - Make all callers of CreateElementWithDefaults() use non-virtual method r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 10 Aug 2018 19:36:24 +0900 - rev 489679
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1482020 - Make all callers of CreateElementWithDefaults() use non-virtual method r=m_kato Fortunately, despite of becoming public method, HTMLEditor::CreateElementWithDefaults() can be used by internal methods too since it does not touch undo transactions nor the DOM tree, and does not refer mRules nor GetSelection(). So, we can make it public and make any C++ callers use it.
57e568a7f933: Bug 1482019 - part 5: Make HTMLEditor::GetSelectedNode() never return non-element node and change its name to GetSelectedElement() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 10 Aug 2018 18:01:42 +0900 - rev 489616
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1482019 - part 5: Make HTMLEditor::GetSelectedNode() never return non-element node and change its name to GetSelectedElement() r=m_kato If HTMLEditor::GetSelectedNode() is called with nullptr for aTagName, the first block may return non-element node. In such case, we should return nullptr without error for now (since I have no idea which element node is a good node to return). Then, we can rename it to GetSelectedElement() and can replace existing GetSelectedElement() with the new one.
66e9a30a6b1a: Bug 1482019 - part 4: Reduce the indent level of the last block in HTMLEditor::GetSelectedNode() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 10 Aug 2018 17:46:33 +0900 - rev 489615
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1482019 - part 4: Reduce the indent level of the last block in HTMLEditor::GetSelectedNode() r=m_kato The first check of the last block of HTMLEditor::GetSelectedNode() can use early-return style. Additionally, |current| is not necessary since Selection is not changed since the method retrieved first range. So, we can get rid of |current| and the |nullptr| case of it.
f6053ad1d49a: Bug 1482019 - part 3: Minimize some scope of auto varaiables in HTMLEditor::GetSelectedNode() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 10 Aug 2018 17:41:58 +0900 - rev 489614
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1482019 - part 3: Minimize some scope of auto varaiables in HTMLEditor::GetSelectedNode() r=m_kato Some variables in HTMLEditor::GetSelectedNode() are declared very large block they are not used and/or referred. So, we can get rid of some variables or move smaller block.
40fbaeccbd89: Bug 1482019 - part 2: Make HTMLEditor::GetSelectedNode() take nsAtom* for element name r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 10 Aug 2018 17:30:04 +0900 - rev 489613
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1482019 - part 2: Make HTMLEditor::GetSelectedNode() take nsAtom* for element name r=m_kato Using nsAtom makes the method faster and simpler, although the caller needs to atomize lower-cased string.
9b46ca68f3b0: Bug 1482019 - part 1: Create non-virtual method HTMLEditor::GetSelectedNode() for implementing nsIHTMLEditor::GetSelectedElement() r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 10 Aug 2018 16:51:52 +0900 - rev 489612
Push 1815 by ffxbld-merge at 2018-10-15 10:40 +0000
Bug 1482019 - part 1: Create non-virtual method HTMLEditor::GetSelectedNode() for implementing nsIHTMLEditor::GetSelectedElement() r=m_kato For making each diff compact, this bug needs some patches. First of all, this patch moves implementation of nsIHTMLEditor::GetSelectedElement() to new non-virtual method HTMLEditor::GetSelectedNode().