searching for reviewer(m_kato)
f03d4374f8a644a397667e62cdcac1a307c1374e: Bug 1783244 - Ensure JNI is ready before calling isSurfaceAbandoned. r=geckoview-reviewers,m_kato, a=dsmith
Jamie Nicol <jnicol@mozilla.com> - Mon, 08 Aug 2022 15:09:26 +0000 - rev 696156
Push 16948 by dsmith@mozilla.com at Tue, 09 Aug 2022 14:31:58 +0000
Bug 1783244 - Ensure JNI is ready before calling isSurfaceAbandoned. r=geckoview-reviewers,m_kato, a=dsmith In bug 1772839 we added a check for whether a Surface is in an abandoned state prior to resuming the compositor. This check requires calling a native function via JNI, however, this may be called before gecko has reached the JNI_READY state. Calling this function then results in crashes due to UnsatisfiedLinkError exceptions. To fix this, check whether the gecko state is at least JNI_READY prior to calling the native function. If JNI is not yet ready, we just have to assume that the Surface is in a valid state, which may cause us to crash if that is not actually the case. But that should be a rare occurrence, and is certainly preferable to always crashing due to the UnsatisfiedLinkError. Differential Revision: https://phabricator.services.mozilla.com/D153935
7e38dbf3b1c5f878b12a74713e717ad1d51bf53f: Bug 1777905 - Add tentative WPT to check if builtin editor does not join nor delete special elements which are typically invisible r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 25 Jul 2022 07:02:30 +0000 - rev 696036
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1777905 - Add tentative WPT to check if builtin editor does not join nor delete special elements which are typically invisible r=m_kato Deleting or joining some elements may affect various things to entire the document, e.g., deleting `<style>` element changes various element visual. Additionally, this may not be safe, may cause apps unstable, may create edge cases. Therefore, even if they are different from traditional behavior of browsers, the behavior should be changed. However, for the normal elements which usually appear in `<body>` and visible, we should allow builtin editor join the element with another element even outside `<body>` element. This avoids to break the web since some browsers behave so. Differential Revision: https://phabricator.services.mozilla.com/D152382
0c0cf642957c1d5947ab5bf3d1df63ef5d0488b8: Bug 1777904 - Add tentative WPT for checking the handling of `insertParagraph` in elements outside <body> r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 25 Jul 2022 07:02:29 +0000 - rev 696035
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1777904 - Add tentative WPT for checking the handling of `insertParagraph` in elements outside <body> r=m_kato I think that these edge cases are not reasonable for any web apps, but browsers need to take care for avoiding odd result including crash. I believe that the simplest approach is, elements which are children of `<html>` or `<head>` should be treated like as `<body>` which is never unwrapped nor joined with the other elements. However, the behavior is incompatible with browsers, so doing it may break existing web apps. Therefore, I think that the reasonable approach is, browsers should split normal elements which is usually visible and appear in `<body>` should be split even if they are outside the `<body>`. However, some special elements such as `<style>` and `<script>` which may be appear in `<head>` but usually invisible and affects entire the document should not be split. The following patch adds delete/join cases. Differential Revision: https://phabricator.services.mozilla.com/D152381
ff0b0ef9b33022c8f5c621806d2d07bcbae27987: Bug 1756530 : Removed Workaround of Bug1707959. r=m_kato,geckoview-reviewers
Pranshu Agrawal <pranshukumar1999@gmail.com> - Thu, 21 Jul 2022 07:59:48 +0000 - rev 695761
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1756530 : Removed Workaround of Bug1707959. r=m_kato,geckoview-reviewers Differential Revision: https://phabricator.services.mozilla.com/D151991
5f4c6d247cd1d132a809919d587fb24b46166bde: Bug 1779269 - Fix AccessibleCaret's display on disabled form controls. r=emilio,webdriver-reviewers,whimboo,geckoview-reviewers,m_kato
Ting-Yu Lin <tlin@mozilla.com> - Thu, 21 Jul 2022 05:44:30 +0000 - rev 695754
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1779269 - Fix AccessibleCaret's display on disabled form controls. r=emilio,webdriver-reviewers,whimboo,geckoview-reviewers,m_kato A disabled form controls cannot be focused, and its frame selection is different from the one for not-editable content. Use GetLastFocusedFrameSelection() (added in Bug 253870) to get the correct frame selection that is visible to the user. Add some basic tests for disabled <textarea> such as long pressing to select, dragging, etc. They should behave the same as normal <textarea>. Differential Revision: https://phabricator.services.mozilla.com/D151800
de748a382c4a29c5002054c6ba1c8dbbd039d0a4: Bug 1773848 - Make the for-loop in the lambda in `HTMLEditor::InsertTableRowsWithTransaction` refer only `cellDataInLastRow` r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 20 Jul 2022 04:24:52 +0000 - rev 695490
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1773848 - Make the for-loop in the lambda in `HTMLEditor::InsertTableRowsWithTransaction` refer only `cellDataInLastRow` r=m_kato It's renamed from `CellData`, but `cellData` still exists in the wider scope. https://searchfox.org/mozilla-central/rev/f6a2ef2f028b8f1eb82fa5dc5cb1e39a3baa8feb/editor/libeditor/HTMLTableEditor.cpp#923-924 Therefore, these lines are wrong: https://searchfox.org/mozilla-central/rev/f6a2ef2f028b8f1eb82fa5dc5cb1e39a3baa8feb/editor/libeditor/HTMLTableEditor.cpp#1049,1053 because `cellData` was in the for-loop: https://searchfox.org/mozilla-central/rev/bc4493c72442ad55aecf6b575edb0df4ed18b113/editor/libeditor/HTMLTableEditor.cpp#1008-1009,1020,1022,1026 Differential Revision: https://phabricator.services.mozilla.com/D152144
1b8d623937fc747bc0926cf6b741790a757fff2c: Bug 1510647 Lint Warning: Missing @IntDef in Switch. r=m_kato,geckoview-reviewers
Pranshu Agrawal <pranshukumar1999@gmail.com> - Fri, 15 Jul 2022 01:20:26 +0000 - rev 695132
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1510647 Lint Warning: Missing @IntDef in Switch. r=m_kato,geckoview-reviewers Differential Revision: https://phabricator.services.mozilla.com/D151653
cdaef3be8f9b840a7a4cad58967d0e411839b845: Bug 1667455 - Part 9: Stop importing Services.jsm from chrome-priv HTML code, single-line cases. r=kmag,necko-reviewers,geckoview-reviewers,extension-reviewers,m_kato,dragana
Tooru Fujisawa <arai_a@mac.com> - Mon, 11 Jul 2022 12:41:52 +0000 - rev 694511
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1667455 - Part 9: Stop importing Services.jsm from chrome-priv HTML code, single-line cases. r=kmag,necko-reviewers,geckoview-reviewers,extension-reviewers,m_kato,dragana Differential Revision: https://phabricator.services.mozilla.com/D150898
ae74e5acc07a10f50df6c0a91eb1a9fdeb997d8a: Bug 1667455 - Part 5: Stop importing Services.jsm from chrome-priv JS code, top-level single-line cases. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,extension-reviewers,application-update-reviewers,pip-reviewers,twisniewski,m_kato,jdescottes,mconley,AlexandruIonescu,mossop
Tooru Fujisawa <arai_a@mac.com> - Mon, 11 Jul 2022 12:41:50 +0000 - rev 694507
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1667455 - Part 5: Stop importing Services.jsm from chrome-priv JS code, top-level single-line cases. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,extension-reviewers,application-update-reviewers,pip-reviewers,twisniewski,m_kato,jdescottes,mconley,AlexandruIonescu,mossop Differential Revision: https://phabricator.services.mozilla.com/D150894
ad6234248f3d039ad98ece85d9c4581c297973f0: Bug 1667455 - Part 4: Stop importing Services.jsm from JSM. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,application-update-reviewers,pip-reviewers,twisniewski,devtools-reviewers,m_kato,jdescottes,ochameau,mconley,sfoster,AlexandruIonescu
Tooru Fujisawa <arai_a@mac.com> - Mon, 11 Jul 2022 12:41:50 +0000 - rev 694506
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1667455 - Part 4: Stop importing Services.jsm from JSM. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,application-update-reviewers,pip-reviewers,twisniewski,devtools-reviewers,m_kato,jdescottes,ochameau,mconley,sfoster,AlexandruIonescu Differential Revision: https://phabricator.services.mozilla.com/D150893
b2c0359c81ea480e9c298c32223ae2c7525e4a6d: Bug 1510613 LintWarning: Dangerous Flag Constant Declaration. r=m_kato,geckoview-reviewers
Pranshu Agrawal <pranshukumar1999@gmail.com> - Mon, 11 Jul 2022 10:55:02 +0000 - rev 694496
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1510613 LintWarning: Dangerous Flag Constant Declaration. r=m_kato,geckoview-reviewers Differential Revision: https://phabricator.services.mozilla.com/D151438
5f2fe4601a9ec463e49e074bc721ed912e9fa208: Bug 1778091 - Make `HTMLEditor` move invisible `<br>` element into the empty inline element after splitting a paragraph at end r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 11 Jul 2022 05:36:29 +0000 - rev 694482
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1778091 - Make `HTMLEditor` move invisible `<br>` element into the empty inline element after splitting a paragraph at end r=m_kato In Yahoo! Mail, the paragraph has `<br>` after `<span>` element which has `background-color`. In this case, Gecko creates the following DOM tree after splitting the paragraph: ``` <div><span>foo</span></div><div><span></span><br></div> ``` Then, the empty `<span>` in the right paragraph will be removed by the post-processing. However, in this case, the inline element is required for preserving the style continued from the previous paragraph. In this case, we should move the `<br>` element into the `<span>` to make it non-empty and avoid it to be removed. This is compatible with Chrome. Differential Revision: https://phabricator.services.mozilla.com/D151345
e3fd1571e2b9e6968d5e7b8063700afc469c4186: Bug 1777903 - Add tentative WPT of handling line breaks in inline editing host r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 07 Jul 2022 00:28:30 +0000 - rev 694235
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1777903 - Add tentative WPT of handling line breaks in inline editing host r=m_kato Browsers shouldn't insert `<div>` and `<p>` elements into inline elements such as `<span>` even when it's `display` value creates a block format context since it's invalid structure from point of view of HTML. However, some browsers do it. Therefore, this test should make them fail. The reason why this patch touches `editor-test-utils.js` is, it scans the following `<script>` element's text with a bug. So the change makes it does not scan outside the editing host. Differential Revision: https://phabricator.services.mozilla.com/D150991
49b26c48ade8183bcf7ef2b6945009ef6f733532: Bug 1778055: exclude `ClipboardReadTextPaste` actors on Android. r=m_kato
Mirko Brodesser <mbrodesser@mozilla.com> - Tue, 05 Jul 2022 12:04:52 +0000 - rev 694081
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1778055: exclude `ClipboardReadTextPaste` actors on Android. r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D150993
4094704632bb6e23cf0623834aa082d749aea0dd: Bug 1776332 - part 2: Create a tentative WPT to check attribute handling of joining elements by the builtin editor r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 01 Jul 2022 04:48:55 +0000 - rev 693870
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1776332 - part 2: Create a tentative WPT to check attribute handling of joining elements by the builtin editor r=m_kato Similar to the previous patch, this adds tentative tests. Different from the previous tests, joining shouldn't touch attributes of the original nodes. This tests do not check which node is deleted from the document, but in the future, it should be tested after fixing bug 1735608 completely. Differential Revision: https://phabricator.services.mozilla.com/D150221
753c9e14d5a14eac3647fd5036bb935e5def9d01: Bug 1776332 - part 1: Create a tentative WPT to check attribute handling of splitting element by the builtin editor r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 01 Jul 2022 04:48:54 +0000 - rev 693869
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1776332 - part 1: Create a tentative WPT to check attribute handling of splitting element by the builtin editor r=m_kato We have similar tests under `mozilla`. However, for Interop2022-editing, we should rewrite it with the modern style and mark it "tentative". It does not matter how to split an element and its ancestors here. The test check only how attributes of splitting element and its ancestors. All attributes should be cloned, but `id` attributes shouldn't, at least, there should not be 2 elements which share same `id` value. Chrome duplicates `id` attributes, so Chrome fails to pass of the checks, but passes the other checks. Differential Revision: https://phabricator.services.mozilla.com/D150220
3c238edc8b4da075bf4e36d2da856ba34ec3ee15: Bug 1776331 - Add check whether `document.execCommand("selectAll")` worked first r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 01 Jul 2022 04:48:50 +0000 - rev 693868
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1776331 - Add check whether `document.execCommand("selectAll")` worked first r=m_kato Oddly, the test is passed in Chrome if only it runs, i.e., if I run all tests in the same folder, the test fails even in Chrome (currently, all browsers fail the test, Gecko's bug is bug 1771701, but the failure reason is different from the others). The original purpose of the test is, check where is selected by a `document.execCommand("selectAll")` call when no editable element has focus. Therefore, we want Chrome to pass it even with any hacks. However, adding some hacks makes it passes in Gecko too. Therefore, this patch just adds a new check which shows the failure reason correctly in Chrome. Differential Revision: https://phabricator.services.mozilla.com/D150219
1f99e4a5113539ba2b85689d04f66fd0261db0a8: Bug 1774114 - Make `HTMLEditor` and its helper classes get split/join node direction dynamically r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 01 Jul 2022 02:02:03 +0000 - rev 693865
Push 16885 by ffxbld-merge at Mon, 25 Jul 2022 15:04:18 +0000
Bug 1774114 - Make `HTMLEditor` and its helper classes get split/join node direction dynamically r=m_kato Currently I'm think that the split/join node direction should be managed per `HTMLEditor` instance because per transaction makes undo/redo handling complicated and may require additional space to save it in each transaction instance. However, the direction should be changeable with new Gecko specific `execCommand` to support both direction until creating first split/join node transaction or anytime with clearing the transactions. Differential Revision: https://phabricator.services.mozilla.com/D149192
311f4827c961b92fecad8447f6212539f96767af: Bug 1771734 - Drop unused DTD strings. r=flod,geckoview-reviewers,m_kato
Eemeli Aro <eemeli@mozilla.com> - Thu, 23 Jun 2022 14:25:27 +0000 - rev 692748
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1771734 - Drop unused DTD strings. r=flod,geckoview-reviewers,m_kato This follows in the same vein as bug 1771133, and cleans up some strings that were orphaned by bug 1589182. Differential Revision: https://phabricator.services.mozilla.com/D147652
7f64e67f3144c17cea8def8f495cb15d08425a0b: Bug 1770877 - part 38: Make `HTMLEditor::InsertParagraphSeparatorAsSubAction` stop updating `Selection` while handling its job r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 23 Jun 2022 01:09:12 +0000 - rev 692716
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 38: Make `HTMLEditor::InsertParagraphSeparatorAsSubAction` stop updating `Selection` while handling its job r=m_kato Finally, this patch makes it update `Selection` once after finishing its preparation. Differential Revision: https://phabricator.services.mozilla.com/D149109
e9b6a7f08dc99da785ba2e3af6a8794203c2e930: Bug 1770877 - part 38: Make `HTMLEditor::InsertParagraphSeparatorAsSubAction` stop updating `Selection` while handling its job r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 13:57:07 +0000 - rev 692631
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 38: Make `HTMLEditor::InsertParagraphSeparatorAsSubAction` stop updating `Selection` while handling its job r=m_kato Finally, this patch makes it update `Selection` once after finishing its preparation. Differential Revision: https://phabricator.services.mozilla.com/D149109
2b6f258080b102f460ff9f3cb7509eb36eea5b8f: Bug 1770877 - part 37: Make `HTMLEditor::HandleInsertLinefeed` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 13:14:17 +0000 - rev 692623
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 37: Make `HTMLEditor::HandleInsertLinefeed` stop touching `Selection` directly r=m_kato Note that the odd path which always returns `NS_ERROR_FAILURE` is not covered by the tests. Therefore, this patch adds `MOZ_ASSERT` to make somebody hit it and report a bug. Differential Revision: https://phabricator.services.mozilla.com/D149108
b7064633d35389ba3d310eaa581fb9779fdf7e2d: Bug 1770877 - part 36: Make `HTMLEditor::CreateStyleForInsertText` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 13:07:05 +0000 - rev 692618
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 36: Make `HTMLEditor::CreateStyleForInsertText` stop touching `Selection` directly r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D149107
f5a4ea36e50b6059246a5c36be40cecea2a93a77: Bug 1770877 - part 35: Make `HTMLEditor::SetInlinePropertyOnNode` and `HTMLEditor::SetInlinePropertyOnNodeImpl` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 12:57:51 +0000 - rev 692616
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 35: Make `HTMLEditor::SetInlinePropertyOnNode` and `HTMLEditor::SetInlinePropertyOnNodeImpl` stop touching `Selection` directly r=m_kato Note that `CSSEditUtils` does not change `Selection` except `RemoveCSSInlineStyleWithTransaction` which is used only by aligning in a block. Therefore, this patch does not touch `CSSEditUtils`. Differential Revision: https://phabricator.services.mozilla.com/D149106
757a2158f293934487b11dcbc45ba5716e5e5475: Bug 1770877 - part 34: Make `HTMLEditor::RemoveStyleInside` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 12:36:37 +0000 - rev 692614
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 34: Make `HTMLEditor::RemoveStyleInside` stop touching `Selection` directly r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D149105
3652f16762112e01d694877eedf4ade3a9dc451b: Bug 1770877 - part 33: Make `HTMLEditor::RelativeFontChangeOnTextNode` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 08:18:40 +0000 - rev 692540
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 33: Make `HTMLEditor::RelativeFontChangeOnTextNode` stop touching `Selection` directly r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D149104
ff2f12be9907e7ce35be9573fa8ac8642bb98695: Bug 1770877 - part 32: Make `HTMLEditor::InsertContainerWithTransaction` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 08:04:26 +0000 - rev 692539
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 32: Make `HTMLEditor::InsertContainerWithTransaction` stop touching `Selection` directly r=m_kato This changes the behavior a little bit, unfortunately. `InsertContainerWithTransaction` starts return code. And the behavior changed WPTs are hit here: https://searchfox.org/mozilla-central/rev/a8bdd0feeb7ae596a202333ee324a68153f9f4c4/editor/libeditor/EditorBase.cpp#2179-2180 Then, the editor specific error will be converted to `NS_OK` at the corresponding public method. Therefore, the return code may be changed from `NS_ERROR_FAILURE` to `NS_OK`, and that causes the return value change of `Document.execCommand`. Differential Revision: https://phabricator.services.mozilla.com/D149103
192e532ea4030217b9bbf1bd9faf04b5b04a278d: Bug 1770877 - part 31-3: Replace `insertLineBreak` variable in `HTMLEditor::InsertParagraphSeparatorAsSubAction` with a lambda r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 02:54:34 +0000 - rev 692516
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 31-3: Replace `insertLineBreak` variable in `HTMLEditor::InsertParagraphSeparatorAsSubAction` with a lambda r=m_kato This can encapsule the long if-elseif-else blocks into the lambda. Differential Revision: https://phabricator.services.mozilla.com/D149102
e71eb63a2c41065aaf17538a288e7942c15ece9b: Bug 1770877 - part 31-2: Make `HTMLEditor::InsertParagraphSeparatorAsSubAction` call `HandleInsertParagraphInParagraph` without `Selection` r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 01:52:32 +0000 - rev 692515
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 31-2: Make `HTMLEditor::InsertParagraphSeparatorAsSubAction` call `HandleInsertParagraphInParagraph` without `Selection` r=m_kato The preceding call of `InsertBRElement` may collapse selection at the inserted padding `<br>` element. Only when calling `HandleInsertParagraphInParagraph`, `InsertParagraphSeparatorAsSubAction` uses `Selection`. So, only in this case, we need to recompute the point to split for keeping current (odd) behavior. Note that in normal cases, using `atStartOfSelection` gets same result. However, if there are some invisible nodes such as comment nodes, doing it may change the behavior. For now, we should keep the current behavior. It should be sorted out when we make it stop inserting `<br>` elements for the preparation of split without checking whether it's actually necessary. Differential Revision: https://phabricator.services.mozilla.com/D149101
2922b0526888dfc07ccfee6a6b21a30fa088c2d7: Bug 1770877 - part 31-1: Add WPT to check `insertParagraph` behavior r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 01:52:31 +0000 - rev 692514
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 31-1: Add WPT to check `insertParagraph` behavior r=m_kato The expectations are exactly same as Chrome's behavior. And checked by my hands briefly, Safari also behaves as same as Chrome. Differential Revision: https://phabricator.services.mozilla.com/D149100
27233700181a7957116c9c424cc7230f3016bbca: Bug 1770877 - part 30: Make `HTMLEditor::HandleInsertParagraphInListItemElement` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 01:34:03 +0000 - rev 692513
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 30: Make `HTMLEditor::HandleInsertParagraphInListItemElement` stop touching `Selection` directly r=m_kato It touches `Selection` redundantly (i.e., immediately after that, it or its caller collapse `Selection`). So we can just stop it because we can ignore the cases when the handling fails after the redundant `Selection` update and it can be caused by tricky things with the mutation event listeners. Note that without changing `SplitNodeResult` a lot, we cannot make it return `SplitNodeResult`, and currently there is no motivation to do it because the only caller does not need the detail of the split. Therefore, I give up doing it. Differential Revision: https://phabricator.services.mozilla.com/D149099
9f542033a1955ab6c291351099df37dc1199e35b: Bug 1770877 - part 29: Make `HTMLEditor::HandleInsertParagraphInHeadingElement` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 01:25:04 +0000 - rev 692510
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 29: Make `HTMLEditor::HandleInsertParagraphInHeadingElement` stop touching `Selection` directly r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D149098
6572b95e88705b7ebbd277a1e9d31c0ebdacabe7: Bug 1770877 - part 28-6: Make `HTMLEditor::HandleInsertParagraphInParagraph` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 01:18:35 +0000 - rev 692509
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 28-6: Make `HTMLEditor::HandleInsertParagraphInParagraph` stop touching `Selection` directly r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D149097
631abbaad8b1e0f478440b2f6372fc728e9b45dc: Bug 1770877 - part 28-5: Get rid of unnecessary duplication of `EditorDOMPoint` in `HTMLEditor::HandleInsertParagraphInParagraph` r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 01:05:47 +0000 - rev 692507
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 28-5: Get rid of unnecessary duplication of `EditorDOMPoint` in `HTMLEditor::HandleInsertParagraphInParagraph` r=m_kato I tried to make the latter half preparation to call `HTMLEditor::SplitParagraphWithTransaction`, but I cannot make it cleaner because it needs to return `HTMLBRElement*` and `EditorDOMPoint` with maybe modifying the DOM tree. So, I keep it as-is, but I make replace the unnecessary duplicated `EditorDOMPoint` with the original one which is adjusted to avoid to create new empty link in the right paragraph. Differential Revision: https://phabricator.services.mozilla.com/D149096
e7941e3d1c02fc7ea9c8f516ed3f64c5c7e64106: Bug 1770877 - part 28-4: Make `HTMLEditor::HandlerInsertParagraphInParagraph` take a split point and editing host r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 01:00:42 +0000 - rev 692506
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 28-4: Make `HTMLEditor::HandlerInsertParagraphInParagraph` take a split point and editing host r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D149095
f18761f6020d651d8c3d64affe7469f10e9755b1: Bug 1770877 - part 28-3: Make `HTMLEditor::HandleInsertParagraphInParagraph` insert `<br>` element immediately after considering so r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Wed, 22 Jun 2022 00:40:20 +0000 - rev 692505
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 28-3: Make `HTMLEditor::HandleInsertParagraphInParagraph` insert `<br>` element immediately after considering so r=m_kato Using the wide scope `EditorDOMPoint pointToInsertBR` makes it harder to read. Although this duplicates a call of `HTMLEditor::InsertBRElement` and a couple of post processing, but I think that it's easier to read/understand. Differential Revision: https://phabricator.services.mozilla.com/D149094
2e8167df4d7719d4917487436a60d670a63ebc7c: Bug 1770877 - part 28-2: Make `HTMLEditor::HandleInsertParagraphInParagraph` return earlier if should be default to insert `<br>` instead r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 21 Jun 2022 23:50:42 +0000 - rev 692503
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 28-2: Make `HTMLEditor::HandleInsertParagraphInParagraph` return earlier if should be default to insert `<br>` instead r=m_kato If it needs to insert a `<br>` but the editor does not want to create new paragraph, its caller should be default to insert a `<br>` element. Rather than checking this at inserting `<br>` element, it should do it at considering the place to insert the new `<br>`. Differential Revision: https://phabricator.services.mozilla.com/D149093
a672ee6e35fcaf9c3b710d2bf774ac6cd3cb199f: Bug 1770877 - part 28-1: Isolate the part of adjusting split point for avoiding to create new empty link in `HTMLEditor::HandleInsertParagraphInParagraph` r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 21 Jun 2022 23:38:06 +0000 - rev 692502
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 28-1: Isolate the part of adjusting split point for avoiding to create new empty link in `HTMLEditor::HandleInsertParagraphInParagraph` r=m_kato The method does several different things. For making each part isolated, this patch wraps the first part with a lambda. Differential Revision: https://phabricator.services.mozilla.com/D149092
500b28ff7eb6efa3a8188e2fa26d9aef38197330: Bug 1770877 - part 27: Make `HTMLEditor::SplitParagraph` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 21 Jun 2022 08:49:51 +0000 - rev 692434
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 27: Make `HTMLEditor::SplitParagraph` stop touching `Selection` directly r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D149091
54aff5bcc909943fbe7913a41d7bdc5818fa1212: Bug 1770877 - part 26: Make `HTMLEditor::InsertBRElementIfEmptyBlockElement` a lambda since it's used only by one method r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 21 Jun 2022 08:19:37 +0000 - rev 692432
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 26: Make `HTMLEditor::InsertBRElementIfEmptyBlockElement` a lambda since it's used only by one method r=m_kato And its selection update are not used except the legacy mutation event listeners so that we can drop them. Differential Revision: https://phabricator.services.mozilla.com/D149090
a1a871c03b3d26aa8891df64b6ee453660d8e042: Bug 1770877 - part 25: Make `HTMLEditor::FormatBlockContainerWithTransaction` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 21 Jun 2022 05:58:45 +0000 - rev 692423
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 25: Make `HTMLEditor::FormatBlockContainerWithTransaction` stop touching `Selection` directly r=m_kato This patch makes it take `AutoRangeArray` and it can save a snapshot of the ranges and restore it like `AutoSelectionRestorer`. For accessing `HTMLEditor::RangeUpdaterRef` for clearing the saved ranges, `AutoRangeArray` needs to store `HTMLEditor`. Therefore, its constructors and the destructor cannot be inlined in the header due to the include-hell. Differential Revision: https://phabricator.services.mozilla.com/D149089
5a257be173a48ff79d94027905a5e90c8ba484ea: Bug 1770877 - part 24: Make `HTMLEditor::MaybeExtendSelectionToHardLineEdgesForBlockEditAction` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 21 Jun 2022 03:11:42 +0000 - rev 692419
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 24: Make `HTMLEditor::MaybeExtendSelectionToHardLineEdgesForBlockEditAction` stop touching `Selection` directly r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D149088
cc7dffd956f928cd4478111ae29cdc4545bd49d4: Bug 1770877 - part 23: Clean up callers of `AutoRangeArray::SplitTextNodesAtEndBoundariesAndParentInlineElementsAtBoundaries` r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 21 Jun 2022 01:26:20 +0000 - rev 692412
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 23: Clean up callers of `AutoRangeArray::SplitTextNodesAtEndBoundariesAndParentInlineElementsAtBoundaries` r=m_kato They at most twice updates the `Selection` right now. We can make them update `Selection` once. And this patch makes the scope of `AutoRangeArray` clearer. Differential Revision: https://phabricator.services.mozilla.com/D149087
3738f1426b07c10cfa36e6780ba2be0e18d00c5d: Bug 1770877 - part 22: Move `HTMLEditor::CollectEditTargetNodes` into `AutoRangeArray` r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 21 Jun 2022 01:19:25 +0000 - rev 692410
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 22: Move `HTMLEditor::CollectEditTargetNodes` into `AutoRangeArray` r=m_kato And also this moves `HTMLEditor::CollectChildren` to `HTMLEditUtils`. Differential Revision: https://phabricator.services.mozilla.com/D149086
74aeec5ca9a9852290efb1813db78a1bc42fcc22: Bug 1770877 - part 21: Get rid of `HTMLEditor::SplitInlinesAndCollectEditTargetNodes` r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 21 Jun 2022 01:07:10 +0000 - rev 692409
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 21: Get rid of `HTMLEditor::SplitInlinesAndCollectEditTargetNodes` r=m_kato It's callers become messy with this patch. The following patches try to make them smaller. Differential Revision: https://phabricator.services.mozilla.com/D149085
4645504a099547f76984d70ddbda880c7fee1eec: Bug 1770877 - part 20: Move `HTMLEditor::SplitTextNodesAtRangeEnd` and `HTMLEditor::SplitParentInlineElementsAtRangeEdges` into `AutoRangeArray` r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 20 Jun 2022 23:45:02 +0000 - rev 692408
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 20: Move `HTMLEditor::SplitTextNodesAtRangeEnd` and `HTMLEditor::SplitParentInlineElementsAtRangeEdges` into `AutoRangeArray` r=m_kato Although they update the DOM tree with transactions, but for making `HTMLEditor` smaller, and the following patches makes the related code simpler, we need to move them into `AutoRangeArray`. Differential Revision: https://phabricator.services.mozilla.com/D149084
c7d39fc1c51a006a4382e3caf8b14cd0b3e9089c: Bug 1770877 - part 19: Make `HTMLEditor::SplitParentInlineElementsAtRangeEdges` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 20 Jun 2022 23:09:29 +0000 - rev 692406
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 19: Make `HTMLEditor::SplitParentInlineElementsAtRangeEdges` stop touching `Selection` directly r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D149083
a07aafab6392204a4f322ad944d1214c2a4ff1ce: Bug 1770877 - part 18: Make `HTMLEditor::SplitTextNodesAtRangeEnd` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 20 Jun 2022 08:54:47 +0000 - rev 692281
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 18: Make `HTMLEditor::SplitTextNodesAtRangeEnd` stop touching `Selection` directly r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D149082
5021cfa2df4a95e23b1fd147f67bf6b896921a68: Bug 1770877 - part 17: Make `HTMLEditor::SplitElementsAtEveryBRElement` and `HTMLEditor::MaybeSplitElementsAtEveryBRElement` stop touching `Selection` directly r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Sun, 19 Jun 2022 20:57:21 +0000 - rev 692270
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 17: Make `HTMLEditor::SplitElementsAtEveryBRElement` and `HTMLEditor::MaybeSplitElementsAtEveryBRElement` stop touching `Selection` directly r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D149081
33352a8ca7b47300cb8534c760d23d6c5a198803: Bug 1770877 - part 16: Make `AutoRangeArray` can be initialized with an `EditorDOMRangeBase` or `EditorDOMPointBase` r=m_kato
Masayuki Nakano <masayuki@d-toybox.com> - Sat, 18 Jun 2022 09:53:41 +0000 - rev 692257
Push 16793 by ffxbld-merge at Mon, 27 Jun 2022 15:12:58 +0000
Bug 1770877 - part 16: Make `AutoRangeArray` can be initialized with an `EditorDOMRangeBase` or `EditorDOMPointBase` r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D149080