Commit Graph

9701 Commits

Author SHA1 Message Date
Makoto Kato
be2e7568aa Bug 1568996 - Flush layout before calling nsFrameSelection::MoveCaret. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D47532

--HG--
extra : moz-landing-system : lando
2019-10-07 08:18:33 +00:00
Makoto Kato
1ab2eca2d2 Bug 1584901 - Convert tail space to NBSP in composition string. r=masayuki
This is related to bug 1530649. When using <span> element with contentedtiable,
we won't insert <br> element at last. When Korean IME on macOS commits
composition by space key, composition string has space.

Gekco removes U+0020 space when it is last character into editing host. To keep
whitespace, we have to replace with NBSP when it is last.

Differential Revision: https://phabricator.services.mozilla.com/D48146

--HG--
extra : moz-landing-system : lando
2019-10-07 08:16:18 +00:00
Masayuki Nakano
3cc02eccbf Bug 1566795 - part 2: Clean up HTMLEditor::SplitAboveRange() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D47859

--HG--
extra : moz-landing-system : lando
2019-10-07 01:11:31 +00:00
Masayuki Nakano
470b292007 Bug 1566795 - part 1: Clean up HTMLEditor::ClearStyle(), HTMLEditor::SplitStyleAbovePoint() and their callers r=m_kato
Both method take a DOM point with `nsCOMPtr<nsINode>*` and `int32_t*`.
This makes each caller complicated.  Instead, we should use stack only class
to return both `EditorDOMPoint` and `nsresult`.  I name it `EditResult`.

Additionally, this fixes a bug of `HTMLeditor::SplitStyleAboveRange()`.  That
is not tracking new selection start point while it splits elements at end
of given range.  This is detected by the debug assertion in
`ToRawRangeBoundary()` (i.e., this fix is required to pass some tests).

Differential Revision: https://phabricator.services.mozilla.com/D47858

--HG--
extra : moz-landing-system : lando
2019-10-07 00:55:02 +00:00
Sylvestre Ledru
f12b9fa5c3 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D47737

--HG--
extra : moz-landing-system : lando
2019-10-06 18:29:55 +00:00
Emma Malysz
e4eba2b24f Bug 1586337, Replace XUL textbox with HTML input in testcases within editor directory r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D48100

--HG--
extra : moz-landing-system : lando
2019-10-04 16:30:10 +00:00
Tim Nguyen
91976e6a66 Bug 1586018 - Remove a11y tree tests, reftests and crashtests only related to textbox. r=surkov,emilio
Differential Revision: https://phabricator.services.mozilla.com/D48080

--HG--
extra : moz-landing-system : lando
2019-10-03 18:01:08 +00:00
Tim Nguyen
2ed60e9a99 Bug 1586019 - Remove textbox .plain class support. r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D48074

--HG--
extra : moz-landing-system : lando
2019-10-03 16:21:42 +00:00
Alexander Surkov
e670b51391 Bug 1582590 - Clean up unused <textbox type='autocomplete'> platform code. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D46541

--HG--
extra : moz-landing-system : lando
2019-10-03 11:18:53 +00:00
Gabriele Svelto
10d41866a5 Bug 1585156 - Remove useless inclusions of nsIDOMWindow.h and nsIDOMWindowUtils.h r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D47678

--HG--
extra : moz-landing-system : lando
2019-09-30 22:06:47 +00:00
Geoff Brown
d964f2d601 Bug 1584290 - Enable many reftests on Android; r=geckoview-reviewers,snorp
Most of these tests have been disabled for a long time; they run well
in the current test environment.

Differential Revision: https://phabricator.services.mozilla.com/D47616

--HG--
extra : moz-landing-system : lando
2019-09-30 16:34:16 +00:00
Christoph Kerschbaumer
7271448df4 Bug 1584282: Remove forgotten debug statement within test_bug629172.html from Bug 1497200. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D47307

--HG--
extra : moz-landing-system : lando
2019-09-26 16:48:43 +00:00
Jorg K
389a1827c2 Bug 1581774 - revert part of rev 5e2fad03c885 from bug 1507543 for Thunderbirds since it breaks the spellcheck. r=m_kato
--HG--
extra : rebase_source : 8dd6fdf15b48115691d21c476875a9bc5cd48591
2019-09-26 09:42:42 +02:00
Tim Nguyen
b0d1ddb586 Bug 1581956 - Make search-textbox not use the <textbox> tag. r=surkov,MarcoZ
Differential Revision: https://phabricator.services.mozilla.com/D46219

--HG--
extra : moz-landing-system : lando
2019-09-25 19:12:48 +00:00
Christoph Kerschbaumer
53d5895e71 Bug 1497200: Apply Meta CSP to about:downloads. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D45330

--HG--
extra : moz-landing-system : lando
2019-09-25 13:50:28 +00:00
Makoto Kato
2c7f1d861c Bug 1474978 - Add crashtest. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D46756

--HG--
extra : moz-landing-system : lando
2019-09-23 10:37:40 +00:00
Mirko Brodesser
a962446e79 Bug 1581523: part 4) Don't set mWrapColumn depending on <body>'s style. r=jorgk
Instead, rely on the proper initialization of `mWrapColumn` via
`nsPlainTextSerializer::Init`.

This will allow to move `mWrapColumn` to `nsPlainTextSerializer::Settings::mWrapColumn`,
simplifying reasoning about it.

Differential Revision: https://phabricator.services.mozilla.com/D46129

--HG--
extra : moz-landing-system : lando
2019-09-23 11:43:59 +00:00
Masayuki Nakano
5d03660aa8 Bug 1581206 - Reconvert browser_bug629172.js to mochitest r=Ehsan
Currently, we can use chrome process's shortcut key with
`EventUtils.synthesizeKey()` with enabling `"test.events.async.enabled"` pref.
So, we should reconvert it to a mochitest for making it more stable.

Oddly, when I try to run this test as test-verify on macOS, it permanently
fails rendering resizer of `<textarea>` elements immediately after creation.
Therefore, this patch disables this test in test-verify on macOS.

Differential Revision: https://phabricator.services.mozilla.com/D46578

--HG--
rename : editor/libeditor/tests/browser_bug629172.js => editor/libeditor/tests/test_bug629172.html
extra : moz-landing-system : lando
2019-09-20 14:56:47 +00:00
Masayuki Nakano
52da57f7a9 Bug 1581337 - Make HTMLEditor::DeleteMostAncestorMailCiteElementIfEmpty() do nothing if found mail-cite element is not empty r=m_kato
When rewriting `DeleteMostAncestorMailCiteElementIfEmpty()` with early-return
style, I forgot to make it do nothing when found element is empty:
https://searchfox.org/mozilla-central/rev/94e642e6036dc694b07cab895c9b5b267f0db065/editor/libeditor/HTMLEditRules.cpp#4078
This patch restores it.

Differential Revision: https://phabricator.services.mozilla.com/D46122

--HG--
extra : moz-landing-system : lando
2019-09-18 11:38:35 +00:00
Masayuki Nakano
58f9c64190 Bug 1581034 - part 2: Get rid of TextEditUtils::IsBreak() and TextEditUtils itself r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45811

--HG--
extra : moz-landing-system : lando
2019-09-18 12:37:14 +00:00
Masayuki Nakano
4f5eae49b0 Bug 1581034 - part 1: Get rid of TextEditUtils::IsBody() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45810

--HG--
extra : moz-landing-system : lando
2019-09-18 10:29:01 +00:00
Masayuki Nakano
9973ff7319 Bug 1540029 - part 11: Get rid of AutoEditInitRulesTrigger r=m_kato
Only for solving the order of `AutoEditInitRulesTrigger` destruction when
`HTMLEditor::Init()` calls `TextEditor::Init()`, `TextEditor` has unnecessary
counter and the initialization code is made harder to understand.

Therefore, this patch makes `TextEditor::Init()` and `HTMLEditor::Init()`
directly call `InitEditorContentAndSelection()` at appropriate time.
Additionally, `HTMLEditor::Init()` can call `EditorBase::Init()` instead of
`TextEditor::Init()` since `TextEditor::Init()` does nothing for `HTMLEditor`
actually.

Differential Revision: https://phabricator.services.mozilla.com/D45793

--HG--
extra : moz-landing-system : lando
2019-09-18 10:14:40 +00:00
Masayuki Nakano
6789366d5e Bug 1540029 - part 10: Get rid of TextEditRules and HTMLEditRules r=m_kato
Now, we can get rid of `TextEditRules` and `HTMLEditRules` completely.
And also this patch renames their cpp files to `TextEditSubActionHandler`
and `HTMLEditSubActionHandler`.

`TextEditor::Init()` and `HTMLEditor::Init()` are still complicated due to
`AutoEditInitRulesTrigger`.  The following patch will remove it.

Differential Revision: https://phabricator.services.mozilla.com/D45792

--HG--
rename : editor/libeditor/HTMLEditRules.cpp => editor/libeditor/HTMLEditSubActionHandler.cpp
rename : editor/libeditor/TextEditRules.cpp => editor/libeditor/TextEditSubActionHandler.cpp
extra : moz-landing-system : lando
2019-09-18 08:40:08 +00:00
Masayuki Nakano
d2ae4d5d88 Bug 1540029 - part 9: Move TextEditRules::Init() and HTMLEditRules::Init() to TextEditor and HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45791

--HG--
extra : moz-landing-system : lando
2019-09-18 08:21:37 +00:00
Masayuki Nakano
8b7e7ba3d1 Bug 1540029 - part 8: Replace HTMLEditRules::GetParagraphState() with new stack only class r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45790

--HG--
extra : moz-landing-system : lando
2019-09-18 08:20:29 +00:00
Masayuki Nakano
ed4c1cd65a Bug 1540029 - part 7: Replace HTMLEditRules::GetAlignment() with new stack only class r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45789

--HG--
extra : moz-landing-system : lando
2019-09-18 06:26:56 +00:00
Masayuki Nakano
6ff81fdbe4 Bug 1540029 - part 6: Replace HTMLEditRules::GetListItemState() with new stack only class r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45788

--HG--
extra : moz-landing-system : lando
2019-09-18 04:42:55 +00:00
Masayuki Nakano
320d1209c9 Bug 1540029 - part 5: Replace HTMLEditRules::GetListState() with new stack class r=m_kato
It takes a lot of `bool` out arguments.  Therefore, we should make it a
stack only class and caller should retrieve only necessary information.

Differential Revision: https://phabricator.services.mozilla.com/D45787

--HG--
extra : moz-landing-system : lando
2019-09-18 03:39:00 +00:00
Masayuki Nakano
b3115e6972 Bug 1540029 - part 4: Merge BeforeEdit() and OnStartToHandleTopLevelEditSubAction(), and AfterEdit() and OnEndHandlingTopLevelEditSubAction() r=m_kato
And also this patch make each `AutoEditSubActionNotifier` creator check
the result of `OnStartToHandleTopLevelEditSubAction()` at least for
`NS_ERROR_EDITOR_DESTROYED`.

We need to take care of its destructor's result later, though.

Differential Revision: https://phabricator.services.mozilla.com/D45786

--HG--
extra : moz-landing-system : lando
2019-09-18 03:01:28 +00:00
Makoto Kato
c147a2e204 Bug 1571375 - Don't remove white space when committing composition. r=masayuki
This is regression by bug 1530649.

After landing bug 1530649, we try to scan end point of replacement text. But
in this bug's situation, afterRun becomes same as current ws run by landing
bug 1530649. To get white space type of next of replacement end, we have to
scan around end point again.

Differential Revision: https://phabricator.services.mozilla.com/D45947

--HG--
extra : moz-landing-system : lando
2019-09-18 03:56:25 +00:00
Masayuki Nakano
59ca43a5a6 Bug 1540029 - part 3: Move HTMLEditRules::DocumentModified() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45785

--HG--
extra : moz-landing-system : lando
2019-09-17 07:22:01 +00:00
Masayuki Nakano
db32271cec Bug 1540029 - part 2: Get rid of TextEditRules::DocumentIsEmpty() and HTMLEditRules::DocumentIsEmpty() r=m_kato
`TextEditRules::DocumentIsEmpty()` is a wrapper of `TextEditor::IsEmpty()` so
that we can get rid of it simply.

`HTMLEditRules::DocumentIsEmpty()` needs to change.  It's oddly checks only
`EditorBase::mPaddingBRElementForEmptyEditor` is `nullptr` or not.  However,
the editor may be completely empty.  And the result may be different from
`TextEditor::IsEmpty()` which is not overridden by `HTMLEditor`.  For partially
solving this issue, this patch makes `HTMLEditor` overrides `IsEmpty()` and
optimizes `TextEditor::IsEmpty()`.

With this change, the caller of `HTMLEditRules::DocumentIsEmpty()` may behave
differently in the only caller, `HTMLEditor::SelectEntireDocument()`.  And
unfortunately, its root called from `SelectAllCommand::DoCommand()`.  However,
it does just collapse `Selection` into the root element (`<body>` or
`Document.documentElement`) if it returns `true`.  Therefore, this change
must be safe since anyway `SelectionRefPtr()->SelectAllChildren()` with
the root element is exactly same as `SelectionRefPtr()->Collapse()` with
the empty root element if it's truly empty.

Differential Revision: https://phabricator.services.mozilla.com/D45784

--HG--
extra : moz-landing-system : lando
2019-09-17 06:58:06 +00:00
Masayuki Nakano
9ee5b3bbef Bug 1540029 - part 1: Move old edit action listener methods of HTMLEditRules to EditorBase::TopLevelEditSubActionData r=m_kato
The main purpose of them is modifying
`TopLevelEditSubActionData::mChangedRange`.  Therefore, they should be in the
struct.

Differential Revision: https://phabricator.services.mozilla.com/D45783

--HG--
extra : moz-landing-system : lando
2019-09-17 04:27:59 +00:00
Masayuki Nakano
bbcb8b3a63 Bug 1574852 - part 113: Move TextEditRules::CreateTrailingBRIfNeeded() and TextEditRules::CollapseSelectionToTrailingBRIfNeeded() to TextEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45496

--HG--
extra : moz-landing-system : lando
2019-09-17 02:47:49 +00:00
Masayuki Nakano
5b0eb574be Bug 1574852 - part 112: Make TextEditor::InsertWithQuotationsAsSubAction() virtual and HTMLEditor override it r=m_kato
It requires different preparation in `TextEditor` and `HTMLEditor` but it's
not split.  Therefore, we should make it virtual and override it to use
different preparation code.  Fortunately, its code is enough simple to
duplicate.

Additionally, this removes unnecessary code from `TextEditRules` and
`HTMLEditRules` including `WillDoAction()` and `DidDoAction()`!

Differential Revision: https://phabricator.services.mozilla.com/D45495

--HG--
extra : moz-landing-system : lando
2019-09-17 02:47:26 +00:00
Masayuki Nakano
119bd889bd Bug 1574852 - part 111: Make methods calling HTMLEditRules::WillDoAction() with EditSubAction::eInsertElement stop using it r=m_kato
Unfortunately, `EditSubAction::eInsertElement` is used by 4 methods and one
of them is too big method.  But we should move what old `WillInsert()` does
into them for stop making anybody use `HTMLEditRules`.

Differential Revision: https://phabricator.services.mozilla.com/D45494

--HG--
extra : moz-landing-system : lando
2019-09-17 03:13:09 +00:00
Masayuki Nakano
0549668bb1 Bug 1574852 - part 110: Split HTMLEditor::WillInsert() r=m_kato
It does 4 different things so that it looks like a black-box from the
callers.

First, only `HTMLEditRules::WillDoAction()` refers `aCancel` out argument.
Therefore, it should check whether it's cancelled or not directly.

Next, `EnsureNoPaddingBRElementForEmptyEditor()` should be called by each
caller directly.

Then, the renaming part can be split to 2 methods.  One is adjusting
caret position and the other preparing inline style for new content.


Unfortunately, this patch makes each caller messy.  I think that for the
3rd job (i.e., adjusting caret position), each caller should retrieve the
adjusted caret position and use it directly instead of handling with
`Selection` in the future.

Differential Revision: https://phabricator.services.mozilla.com/D45493

--HG--
extra : moz-landing-system : lando
2019-09-17 02:21:53 +00:00
Masayuki Nakano
0da92b7d7d Bug 1574852 - part 109: Move TextEditRules::WillSetText() to TextEditor r=m_kato
And also renaming `EditorBase::SetTextImpl()`.

Differential Revision: https://phabricator.services.mozilla.com/D45492

--HG--
extra : moz-landing-system : lando
2019-09-17 02:21:35 +00:00
Gurzau Raul
ba23dcf114 Backed out 2 changesets (bug 1574852) for assertion failures at TextEditRules.cpp
Backed out changeset f54f6af6359d (bug 1574852)
Backed out changeset 2b6968592570 (bug 1574852)
2019-09-15 02:32:09 +03:00
Masayuki Nakano
bf1c1cfd11 Bug 1574852 - part 110: Split HTMLEditor::WillInsert() r=m_kato
It does 4 different things so that it looks like a black-box from the
callers.

First, only `HTMLEditRules::WillDoAction()` refers `aCancel` out argument.
Therefore, it should check whether it's cancelled or not directly.

Next, `EnsureNoPaddingBRElementForEmptyEditor()` should be called by each
caller directly.

Then, the renaming part can be split to 2 methods.  One is adjusting
caret position and the other preparing inline style for new content.


Unfortunately, this patch makes each caller messy.  I think that for the
3rd job (i.e., adjusting caret position), each caller should retrieve the
adjusted caret position and use it directly instead of handling with
`Selection` in the future.

Differential Revision: https://phabricator.services.mozilla.com/D45493

--HG--
extra : moz-landing-system : lando
2019-09-14 15:12:03 +00:00
Masayuki Nakano
87f73d9008 Bug 1574852 - part 109: Move TextEditRules::WillSetText() to TextEditor r=m_kato
And also renaming `EditorBase::SetTextImpl()`.

Differential Revision: https://phabricator.services.mozilla.com/D45492

--HG--
extra : moz-landing-system : lando
2019-09-14 15:12:03 +00:00
Masayuki Nakano
75507785e6 Bug 1574852 - part 108: Move TextEditRules::WillOutputText() to TextEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45491

--HG--
extra : moz-landing-system : lando
2019-09-13 03:44:33 +00:00
Masayuki Nakano
af80a20e09 Bug 1574852 - part 107: Get rid of TextEditRules::GetTextNodeAroundSelectionStartContainer() since nobody uses it r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45490

--HG--
extra : moz-landing-system : lando
2019-09-13 03:39:13 +00:00
Masayuki Nakano
438470f81e Bug 1574852 - part 106-2: Move calling DeleteSelectionWithTransaction() and HTMLEditor specific post handling into HandleDeleteSelection() from TextEditor::DeleteSelectionAsSubAction() r=m_kato
In `TextEditor::HandleDeleteSelection()`, we have only one path of returning
`EditActionIgnored()`.  Therefore, it should call
`DeleteSelectionWithTransaction()` directly.

On the other hand, it's not clear in `HTMLEditor::HandleDeleteSelection()`
since it may be called recursively by its helper methods.  Therefore,
this patch creates `HTMLEditor::HandleDeleteSelectionInternal()` for the
recursive calls and makes `HTMLEditor::HandleDeleteSelection()` call
`DeleteSelectionWithTransaction()` if nobody handled it and to the
`HTMLEditor` specific post-process in it.

Differential Revision: https://phabricator.services.mozilla.com/D45301

--HG--
extra : moz-landing-system : lando
2019-09-13 03:20:04 +00:00
Masayuki Nakano
053579099d Bug 1574852 - part 106-1: Move TextEditRules::WillDeleteSelection() and TextEditRules::DeleteSelectionWithTransaction() to TextEditor and make HTMLEditor::HandleDeleteSelection() override the former r=m_kato
`TextEditor::DeleteSelectionAsSubAction()` starts to handle all
"delete selection" sub-actions (i.e., even if the instance is `HTMLEditor`).
Therefore, `TextEditRules::WillDeleteSelection()` should be renamed to
`TextEditor::HandleDeleteSelection()` and we need to make it virtual.

Differential Revision: https://phabricator.services.mozilla.com/D45300

--HG--
extra : moz-landing-system : lando
2019-09-13 02:49:43 +00:00
Masayuki Nakano
72fa9d1512 Bug 1574852 - part 105: Get rid of TextEditRules::WillSetProperty() and TextEditRules::WillRemoveProperty() r=m_kato
Oddly, they are used only by `HTMLEditor`, but implemented by `TextEditRules`.
They cancels when the editor is in plaintext mode.  So, actual things are
implemented by each caller.  This patch cleans them up too.

Differential Revision: https://phabricator.services.mozilla.com/D45299

--HG--
extra : moz-landing-system : lando
2019-09-12 09:13:00 +00:00
Masayuki Nakano
f521a40385 Bug 1574852 - part 104: Move TextEditRules::WillInsertText() to TextEditor and make HTMLEditor::WillInsertText() override it r=m_kato
And also this patch moves `TextEditRules::HandleNewLines()` and
`TextEditRules::DontEchoPassword()` to `TextEditor`.

Differential Revision: https://phabricator.services.mozilla.com/D45298

--HG--
extra : moz-landing-system : lando
2019-09-13 02:40:09 +00:00
Masayuki Nakano
d0bf28c6cc Bug 1574852 - part 103: Move TextEditRules::WillInsertLineBreak() to TextEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45297

--HG--
extra : moz-landing-system : lando
2019-09-12 08:03:57 +00:00
Masayuki Nakano
80be9ab956 Bug 1574852 - part 102: Move TextEditRules::TruncateInsertionIfNeeded() to TextEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45296

--HG--
extra : moz-landing-system : lando
2019-09-12 07:48:29 +00:00
Masayuki Nakano
d0e7a72d94 Bug 1574852 - part 101: Move HTMLEditRules::DidDeleteSelection() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45295

--HG--
extra : moz-landing-system : lando
2019-09-12 07:27:30 +00:00
Masayuki Nakano
45ef18ee30 Bug 1574852 - part 100: Get rid of TextEditRules::DidDeleteSelection() r=m_kato
There are only 3 callers and it does simple but different 2 things.  One of
the callers is `HTMLEditRules::DidDeleteSelection()` so that if same things
are done by `TextEditor::DeleteSelectionAsSubAction()`, it does not need to
duplicate the code.  Therefore, we need to duplicate the code into
`TextEditor::DeleteSelectionAsSubAction()` and `TextEditRules::WillSetText()`.
Then, `TextEditRules::WillSetText()` can avoid accessing `Selection` since
it still grabs the modified text node.

Note that only when it's called by `TextEditRules::DidDoAction()`,
`AutoTransactionsConserveSelection` has been set.  However, neither
`DeleteNodeWithTransaction()` nor `DeleteNodeTransaction::DoTransaction()`
changes `Selection`.  Therefore, it hasn't do anything.  So, we can remove
it right now.

Differential Revision: https://phabricator.services.mozilla.com/D45294

--HG--
extra : moz-landing-system : lando
2019-09-12 06:51:26 +00:00
Masayuki Nakano
d87ff4830d Bug 1574852 - part 99: Move HTMLEditRules::WillRelativeChangeZIndex() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45293

--HG--
extra : moz-landing-system : lando
2019-09-12 06:20:49 +00:00
Masayuki Nakano
fee93a3a4d Bug 1574852 - part 98: Move HTMLEditRules::WillAbsolutePosition() and HTMLEditRules::WillRemoveAbsolutePosition() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D45292

--HG--
extra : moz-landing-system : lando
2019-09-12 05:45:13 +00:00
Masayuki Nakano
878bbf3cb8 Bug 1574852 - part 97: Move HTMLEditRules::PrepareToMakeElementAbsolutePosition() to HTMLEditor r=m_kato
Only caller of it is `WillRemoveAbsolutePosition()` and it always sets
`*aHandled` to true before calling it.  Therefore, it does not need to take
it as an argument.

Differential Revision: https://phabricator.services.mozilla.com/D45291

--HG--
extra : moz-landing-system : lando
2019-09-12 04:07:30 +00:00
Masayuki Nakano
8b9c4d3ad1 Bug 1574852 - part 96: Merge HTMLEditRules::DidAbsolutePosition() with HTMLEditRules::WillAbsolutePosition() r=m_kato
Oddly, absolute position is handled as following steps.
1. `WillAbsolutePosition()` calls `PrepareToMakeElementAbsolutePosition()`
   to consider the target element.
2. Set TopLevelEditSubActionData::mNewBlockElement to it.
3. `DidAbsolutePosition()` makes it absolute-positioned.

So that, all of them can be done in `WillAbsolutePosition()` like other
edit sub-action handling.

Differential Revision: https://phabricator.services.mozilla.com/D45290

--HG--
extra : moz-landing-system : lando
2019-09-12 01:54:28 +00:00
Masayuki Nakano
d5f8e358d2 Bug 1574852 - part 95: Move HTMLEditRules::AfterEditInner() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44799

--HG--
extra : moz-landing-system : lando
2019-09-11 10:39:38 +00:00
Masayuki Nakano
821d89d488 Bug 1574852 - part 94: Move HTMLEditRules::PinSelectionToNewBlock() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44798

--HG--
extra : moz-landing-system : lando
2019-09-11 09:44:39 +00:00
Masayuki Nakano
e3bcdb2d3c Bug 1574852 - part 93: Move HTMLEditRules::CheckInterlinePosition() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44797

--HG--
extra : moz-landing-system : lando
2019-09-11 01:07:27 +00:00
Masayuki Nakano
875a9d4d05 Bug 1574852 - part 92: Move HTMLEditRules::RemoveEmptyNodesInChangedRange() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44796

--HG--
extra : moz-landing-system : lando
2019-09-10 04:46:55 +00:00
Masayuki Nakano
9ab5c8f493 Bug 1574852 - part 91: Move HTMLEditRules::InsertBRElementToEmptyListItemsAndTableCellsInRange() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44795

--HG--
extra : moz-landing-system : lando
2019-09-10 04:32:21 +00:00
Masayuki Nakano
24f1d9a9b3 Bug 1574852 - part 90: Move HTMLEditRules::ConfirmSelectionInBody() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44794

--HG--
extra : moz-landing-system : lando
2019-09-10 03:52:44 +00:00
Masayuki Nakano
a2c5d981ee Bug 1574852 - part 89: Move HTMLEditRules::AdjustSelection() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44793

--HG--
extra : moz-landing-system : lando
2019-09-10 03:38:04 +00:00
Masayuki Nakano
9a7cb5f3c8 Bug 1574852 - part 88: Move HTMLEditRules::FindNearEditableNode() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44792

--HG--
extra : moz-landing-system : lando
2019-09-09 10:09:38 +00:00
Masayuki Nakano
a8504046a4 Bug 1574852 - part 87: Move HTMLEditRules::SelectionEndpointInNode() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44791

--HG--
extra : moz-landing-system : lando
2019-09-09 05:21:04 +00:00
Masayuki Nakano
b1ead5a6f3 Bug 1574852 - part 86: Move HTMLEditRules::WillAlign() and HTMLEditRules::AlignContentsAtSelection() to HTMLEditor r=m_kato
And also this splits large 2 blocks of
`HTMLEditRules::AlignContentsAtSelection()` to 2 methods.

Differential Revision: https://phabricator.services.mozilla.com/D44790

--HG--
extra : moz-landing-system : lando
2019-09-09 04:57:50 +00:00
Masayuki Nakano
04e8f93b98 Bug 1574852 - part 85: Move HTMLEditRules::AlignBlock() to HTMLEditor r=m_kato
With guaranteeing the argument element type with `MOZ_ASSERT()`, we can
make it really simpler.

Differential Revision: https://phabricator.services.mozilla.com/D44789

--HG--
extra : moz-landing-system : lando
2019-09-09 02:48:56 +00:00
Masayuki Nakano
85fb6afdf7 Bug 1574852 - part 84: Move HTMLEditRules::RemoveAlignment() to HTMLEditor r=m_kato
And also this patch removes unnecessary declarations in `HTMLEditRules.h`.

Differential Revision: https://phabricator.services.mozilla.com/D44788

--HG--
extra : moz-landing-system : lando
2019-09-09 10:47:47 +00:00
Masayuki Nakano
2bc7658314 Bug 1574852 - part 83: Move HTMLEditRules::MakeSureElemStartsOrEndsOnCR() to HTMLEditor r=m_kato
`HTMLEditRules::MakeSureElemStartsOrEndsOnCR()` is unclear what it does.
And fortunately, its job is simple if we split it to each mode.  Therefore,
this patch splits it to `EnsureHardLineBeginsWithFirstChildOf()` and
`EnsureHardLineEndsWithLastChildOf()`.  Finally, the batch caller of them,
`HTMLEditRules::MakeSureElemStartsAndEndsOnCR()` is removed since directly
calling both of them is clearer.

Differential Revision: https://phabricator.services.mozilla.com/D44787

--HG--
extra : moz-landing-system : lando
2019-09-09 10:47:08 +00:00
Masayuki Nakano
d87e610645 Bug 1574852 - part 82: Move HTMLEditRules::MakeTransitionList() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44786

--HG--
extra : moz-landing-system : lando
2019-09-09 10:46:17 +00:00
Masayuki Nakano
fe64aaca55 Bug 1574852 - part 81: Move HTMLEditRules::AlignInnerBlocks() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44785

--HG--
extra : moz-landing-system : lando
2019-09-08 05:29:24 +00:00
Masayuki Nakano
31f29e011e Bug 1574852 - part 80: Move HTMLEditRules::AlignBlockContents() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44784

--HG--
extra : moz-landing-system : lando
2019-09-08 05:28:56 +00:00
Masayuki Nakano
c7ac0cebe5 Bug 1574852 - part 79: Make HTMLEditor::IndentAsAction() and HTMLEditor::OutdentAsAction() call specific AsSubAction() methods instead of WillDoAction() and DidDoAction() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44783

--HG--
extra : moz-landing-system : lando
2019-09-08 05:12:43 +00:00
Masayuki Nakano
13e63d57ea Bug 1574852 - part 78: Move HTMLEditRules::WillOutdent() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44782

--HG--
extra : moz-landing-system : lando
2019-09-08 05:05:38 +00:00
Masayuki Nakano
183c471149 Bug 1574852 - part 77: Move HTMLEditRules::WillIndent(), HTMLEditRules::WillHTMLIndent() and HTMLEditRules::WillCSSIndent() to HTMLEditor r=m_kato
The caller of `HTMLEditRules::WillDoAction()` is shared with "outdent".
Therefore, this patch is a preparation of makes `HTMLEditor` stop calling it.

Be aware, `HTMLEditRules::WillIndent()` won't cancel the action, and also
always handles the action unless editor has already been destroyed.  Therefore,
we can remove the dead code in `HTMLEditor::IndentOrOutdentAsSubAction()`
right now.

Differential Revision: https://phabricator.services.mozilla.com/D44781

--HG--
extra : moz-landing-system : lando
2019-09-08 04:35:52 +00:00
Masayuki Nakano
67f54f71f8 Bug 1574852 - part 76: Move HTMLEditRules::OutdentAroundSelection() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44780

--HG--
extra : moz-landing-system : lando
2019-09-08 04:03:06 +00:00
Masayuki Nakano
a322625816 Bug 1574852 - part 75: Move HTMLEditRules::OutdentPartOfBlock() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44779

--HG--
extra : moz-landing-system : lando
2019-09-08 03:23:16 +00:00
Masayuki Nakano
d64c6562b7 Bug 1574852 - part 74: Move HTMLEditRules::IndentAroundSelectionWithHTML() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44778

--HG--
extra : moz-landing-system : lando
2019-09-08 03:05:46 +00:00
Masayuki Nakano
9ff1becd88 Bug 1574852 - part 73: Move HTMLEditRules::IndentAroundSelectionWithCSS() to HTMLEditor r=m_kato
And also this patch fixes unexpected behavior change by bug 1460509:
https://searchfox.org/mozilla-central/diff/d5d67de86f23655fcccc7bbcf4423bb75148fd34/editor/libeditor/HTMLEditRules.cpp#4466

Differential Revision: https://phabricator.services.mozilla.com/D44777

--HG--
extra : moz-landing-system : lando
2019-09-06 12:57:56 +00:00
Masayuki Nakano
07dae7f820 Bug 1574852 - part 72: Move HTMLEditRules::ChangeMarginStart() to HTMLEditor and get rid of its wrappers r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44465

--HG--
extra : moz-landing-system : lando
2019-09-06 08:51:36 +00:00
Masayuki Nakano
de7cc1a3a0 Bug 1574852 - part 71: Move HTMLEditRules::WillRemoveList() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44464

--HG--
extra : moz-landing-system : lando
2019-09-06 06:01:57 +00:00
Masayuki Nakano
cfd3ee7e70 Bug 1574852 - part 70: Move HTMLEditRules::RemoveListStructur() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44463

--HG--
extra : moz-landing-system : lando
2019-09-06 05:46:15 +00:00
Geoff Brown
56ca134785 Bug 1579272 - Cleanup obviously fennec-centric test annotations; r=bc
Remove test manifest annotations that specifically target fennec,
or likely target the android 4.3 emulator.

Differential Revision: https://phabricator.services.mozilla.com/D45018

--HG--
extra : moz-landing-system : lando
2019-09-06 16:51:10 +00:00
Masayuki Nakano
e6a72f86be Bug 1574852 - part 69: Move HTMLEditRules::PopListItem() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44462

--HG--
extra : moz-landing-system : lando
2019-09-06 04:51:51 +00:00
Masayuki Nakano
c4c3b160eb Bug 1574852 - part 68: Make HTMLEditRules::GetDefinitionListItemTypes() to a stack class r=m_kato
It scans children and returns whether `<dt>` and `<dd>` are found or not.
So, we can make it a stack class and makes caller pick the necessary value
with getter methods.

Differential Revision: https://phabricator.services.mozilla.com/D44461

--HG--
extra : moz-landing-system : lando
2019-09-06 04:32:36 +00:00
Masayuki Nakano
f213a8f6d0 Bug 1574852 - part 67-10: Move HTMLEditRules::WillDeleteSelection() and related methods to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44460

--HG--
extra : moz-landing-system : lando
2019-09-06 04:31:38 +00:00
Masayuki Nakano
23c21f055e Bug 1574852 - part 67-9: Make next early return-style code work without AutoTrackDOMPoint r=m_kato
The next simple case is using early-return style and does not refer modified
`firstRangeStart` nor `firstRangeEnd` so that it can do same thing without
`AutoTrackDOMPoint`.

Then, there is remaining the complicated case.  We cannot split it anymore.

Note that we should not split `HandleDeleteNonCollapsedSelection()` anymore
because as you know, it does not make sense.  It checks only first range
and consider how to treat all ranges.  We should split it after we investigate
deeper with writing new WPT.

Differential Revision: https://phabricator.services.mozilla.com/D44459

--HG--
extra : moz-landing-system : lando
2019-09-06 03:46:03 +00:00
Masayuki Nakano
7c0f0f1a19 Bug 1574852 - part 67-8: Make next simple deletion code use early-return style r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44458

--HG--
extra : moz-landing-system : lando
2019-09-06 02:59:57 +00:00
Masayuki Nakano
07dea9b716 Bug 1574852 - part 67-7: Make early-return style for first simple deletion case of HTMLEditRules::HandleDeleteNonCollapsedSelection() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44457

--HG--
extra : moz-landing-system : lando
2019-09-06 01:49:57 +00:00
Masayuki Nakano
3e4575061a Bug 1574852 - part 67-6: Split the last common part of HTMLEditRules::HandleDeleteNonCollapsedSelection() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44456

--HG--
extra : moz-landing-system : lando
2019-09-06 01:44:00 +00:00
Masayuki Nakano
05db7b82d5 Bug 1574852 - part 67-5: Rewrite HTMLEditRules::HandleDeleteNonCollapsedSelection() with EditorDOMPoint r=m_kato
Before splitting the method, we should make it use `EditorDOMPoint` to
treat selection edges.

Differential Revision: https://phabricator.services.mozilla.com/D44455

--HG--
extra : moz-landing-system : lando
2019-09-06 00:59:32 +00:00
Masayuki Nakano
1a4a5cb8b9 Bug 1574852 - part 67-4: Split HTMLEditRules::HandleDeleteAroundCollapsedSelection() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44454

--HG--
extra : moz-landing-system : lando
2019-09-05 13:38:07 +00:00
Masayuki Nakano
f3b99207af Bug 1574852 - part 67-3: Split HTMLEditRules::WillDeleteSelection() to 3 methods r=m_kato
First, we can split it with 3 parts:
1. preparation with current selection part.
2. handling deletion with collapsed selection part.
3. handling deletion with non-collapsed selection part.
The first should leave in `WillDeleteSelection()`, but the others should be
moved to independent methods.

With this change, we need to fix an odd case when there is no visible node
and `GetFirstSelectedTableCellElement()` returned error due to crossing
the method boundary.  The method returns error only when there is no selection
ranges.  In such case, we cannot handle deletion of current selection anyway.
So, it must not be a problem to handle the error immediately after calling
`GetFirstSelectedTableCellElement()`.  Note that this shouldn't occur in
normal cases since `WillDoAction()` checks it before calling
`WillDeleteSelection()`.

Differential Revision: https://phabricator.services.mozilla.com/D44453

--HG--
extra : moz-landing-system : lando
2019-09-05 13:37:57 +00:00
Masayuki Nakano
b9ab4d13e9 Bug 1574852 - part 67-2: Rename variables in HTMLEditRules::WillDeleteSelection() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44452

--HG--
extra : moz-landing-system : lando
2019-09-05 13:16:12 +00:00
Masayuki Nakano
ce5e7d1651 Bug 1574852 - part 67-1: Make HTMLEditRules::WillDeleteSelection() return EditActionResult` r=m_kato
Before moving the largest method in our tree, we should split it.  This is
first preparation of that.

Differential Revision: https://phabricator.services.mozilla.com/D44451

--HG--
extra : moz-landing-system : lando
2019-09-05 13:37:42 +00:00
Masayuki Nakano
0382baf2fe Bug 1574852 - part 66: Move HTMLEditRules::ExpandSelectionForDelete() to HTMLEditor r=m_kato
And this patch makes the new method do not touch `Selection`, instead, return
new `StaticRange`.  Although the creation cost may make damage to the
performance but let's keep using `StaticRange` for now.  There should be
a stack only class which have 2 `RangeBoundaryBase` or `EditorDOMPointBase`.

Differential Revision: https://phabricator.services.mozilla.com/D44205

--HG--
extra : moz-landing-system : lando
2019-09-05 07:25:51 +00:00
Masayuki Nakano
ff5055d6e2 Bug 1574852 - part 65: Move TextEditRules::CheckBidiLevelForDeletion() to EditorBase r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44204

--HG--
extra : moz-landing-system : lando
2019-09-05 02:21:26 +00:00
Masayuki Nakano
656648d70f Bug 1574852 - part 64: Move HTMLEditRules::MaybeDeleteTopMostEmptyAncestor() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44203

--HG--
extra : moz-landing-system : lando
2019-09-05 01:30:37 +00:00
Masayuki Nakano
c6648a62df Bug 1574852 - part 63: Move HTMLEditRules::GetGoodSelPointForNode() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44202

--HG--
extra : moz-landing-system : lando
2019-09-05 01:14:24 +00:00
Masayuki Nakano
d2ce733c6a Bug 1574852 - part 62: Move HTMLEditRules::TryToJoinBlocksWithTransaction() to HTMLEditor r=m_kato
Additionally, `WSRunObject::ScrabBlockBoundary()` and
`WSRunObject::PreparetToJoinBlocks()` are used only the it.  Therefore, we
can clean them up.

Differential Revision: https://phabricator.services.mozilla.com/D44201

--HG--
extra : moz-landing-system : lando
2019-09-04 08:43:12 +00:00
Masayuki Nakano
e0847a6b6d Bug 1574852 - part 61: Move HTMLEditRules::MoveBlock() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44200

--HG--
extra : moz-landing-system : lando
2019-09-04 05:00:11 +00:00
Masayuki Nakano
e06533766b Bug 1574852 - part 60: Move HTMLEditRules::MoveNodeSmart() and HTMLEditRules::MoveContents() to HTMLEditor r=m_kato
Making them return next insertion point with `nsresult` makes the callers
easier to understand.  Therefore, this patch declares `MoveNodeResult` class
newly and make them use it.

And also we can get rid of the case of setting `*aInOutDestOffset` to -1
because it's a hacky case of `HTMLEditRules::MoveBlock()`.  If we keep it,
`MoveNodeSmart()` needs to compute new insertion point with different logic.
Therefore, this patch makes `HTMLEditRules::MoveBlock()` adjust new insertion
point with checking its argument.

Differential Revision: https://phabricator.services.mozilla.com/D44199

--HG--
extra : moz-landing-system : lando
2019-09-04 03:32:26 +00:00
Masayuki Nakano
9c8bc82f51 Bug 1574852 - part 59: Move HTMLEditRules::JoinNearestEditableNodesWithTransaction() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44198

--HG--
extra : moz-landing-system : lando
2019-09-04 00:18:18 +00:00
Masayuki Nakano
e9b4c8468b Bug 1574852 - part 58: Move HTMLEditRules::CheckForInvisibleBR() to HTMLEditor r=m_kato
This is defined as too complicated than what it does actually since there
was not `EditorDOMPointBase`.

If given point's offset is `0`, returns `nullptr`.  If `aWhere` is
`BRLocation::blockEnd`, treats `aOffset` is length of `aBlock`.  Otherwise,
using given point.  Then, if the `WSRun` start reason is `br`, returns the
start reason node.  This means that this method just retrieves invisible
`<br>` element if it starts `WSRun` at given point.

Now, callers can specify end of block with `EditorDOMPointBase::SetToEndOf()`
easier.  Therefore, we can make it take only an `EditorDOMPointBase` instance.

Differential Revision: https://phabricator.services.mozilla.com/D44197

--HG--
extra : moz-landing-system : lando
2019-09-03 10:31:41 +00:00
Masayuki Nakano
e1d468e330 Bug 1574852 - part 57: Move HTMLEditRules::DeleteNodeIfCollapsedText() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44196

--HG--
extra : moz-landing-system : lando
2019-09-03 09:57:28 +00:00
Masayuki Nakano
1edcec042e Bug 1574852 - part 56: Merge HTMLEditRules::WillMakeList() and HTMLEditRules::WillMakeDefinitionList() and make HTMLEditor call it directly r=m_kato
`HTMLEditRules::WillMakeDefinitionList()` just calls
`HTMLEditRules::WillMakeList()` and `HTMLEditRules::WillMakeList()` can be
called as `HTMLEditRules::MakeOrChangeListAndListItemAsSubAction()` so that
we should merge them and make `HTMLEditor` call it directly.

This patch also removes default action part of
`HTMLEditor::MakeOrChangeListAsAction()` because it runs only when
`HTMLEditRules::WillDoAction()` does not return canceled nor error but not
handled, however, it's won't occur since `HTMLEditRules::WillMakeList()`
always sets `aHandled` to `true` when it returns `NS_OK`.

Differential Revision: https://phabricator.services.mozilla.com/D44195

--HG--
extra : moz-landing-system : lando
2019-09-03 09:32:17 +00:00
Masayuki Nakano
447a15d680 Bug 1574852 - part 55: Move HTMLEditRules::MakeList() to HTMLEditor r=m_kato
Additionally, this patch makes it use early-return style with `continue` as
far as making number of changing line minimized.

Differential Revision: https://phabricator.services.mozilla.com/D44194

--HG--
extra : moz-landing-system : lando
2019-09-03 07:24:41 +00:00
Masayuki Nakano
d4fab048af Bug 1574852 - part 54: Move HTMLEditRules::ConvertListType() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44193

--HG--
extra : moz-landing-system : lando
2019-09-03 05:13:35 +00:00
Masayuki Nakano
2fc50edf06 Bug 1574852 - part 53: Move HTMLEditRuies::InDifferentTableElements() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44191

--HG--
extra : moz-landing-system : lando
2019-09-03 04:18:02 +00:00
Masayuki Nakano
f92de6dd34 Bug 1574852 - part 52: Make HTMLEditRules::WillInsertParagraph() merged with HTMLEditor::InsertParagraphSeparatorAsSubAction() r=m_kato
Meaningful job of `HTMLEditor::InsertParagraphSeparatorAsSubAction()` is only
calling `HTMLEditRules::WillInsertParagraph()` via
`HTMLEditRules::WillDoAction()`.  Therefore, we can move all jobs in them
into `HTMLEditRules::WillInsertParagraph()` and rename it to
`HTMLEditor::InsertParagraphSeparatorAsSubAction()`.

Differential Revision: https://phabricator.services.mozilla.com/D44190

--HG--
extra : moz-landing-system : lando
2019-09-03 03:59:11 +00:00
Masayuki Nakano
298b98043f Bug 1574852 - part 51: Move HTMLEditRules::IsInListItem() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44189

--HG--
extra : moz-landing-system : lando
2019-09-02 23:59:49 +00:00
Masayuki Nakano
b588b7f775 Bug 1574852 - part 50: Move TextEditRules::UndefineCaretBidiLevel() to EditorBase r=m_kato
It's used both by `TextEditRules` and `HTMLEditRules` so that `EditorBase`
should have it instead.

Differential Revision: https://phabricator.services.mozilla.com/D44188

--HG--
extra : moz-landing-system : lando
2019-09-02 10:08:57 +00:00
Masayuki Nakano
d6d83bd331 Bug 1574852 - part 49: Move HTMLEditRules::ReturnInListItem() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44186

--HG--
extra : moz-landing-system : lando
2019-09-02 09:16:31 +00:00
Masayuki Nakano
5941cef758 Bug 1574852 - part 48: Move HTMLEditRules::ReturnInHeader() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44185

--HG--
extra : moz-landing-system : lando
2019-09-02 09:14:23 +00:00
Masayuki Nakano
e356eee3f9 Bug 1574852 - part 47: Move HTMLEditRules::ReturnInParagraph() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44184

--HG--
extra : moz-landing-system : lando
2019-09-02 08:49:18 +00:00
Masayuki Nakano
425de0b16f Bug 1574852 - part 46: Move HTMLEditRules::SplitParagraph() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44183

--HG--
extra : moz-landing-system : lando
2019-09-02 08:09:47 +00:00
Masayuki Nakano
16447ba211 Bug 1574852 - part 45: Move HTMLEditRules::DefaultParagraphSeparator() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44182

--HG--
extra : moz-landing-system : lando
2019-09-02 08:06:56 +00:00
Masayuki Nakano
7c64e596da Bug 1574852 - part 44: Move HTMLEditRules::IsEmptyBlockElement() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44181

--HG--
extra : moz-landing-system : lando
2019-09-02 06:37:43 +00:00
Masayuki Nakano
fc08e740d8 Bug 1574852 - part 43: Move HTMLEditRules::DidMakeBasicBlock() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44180

--HG--
extra : moz-landing-system : lando
2019-09-02 06:36:33 +00:00
Masayuki Nakano
8438c04ae7 Bug 1574852 - part 42: Merge HTMLEditRules::WillMakeBasicBlock() into HTMLEditor::InsertBasicBlockWithTransaction() r=m_kato
`HTMLEditRules::WillMakeBasicBlock()` just calls
`HTMLEditor::FormatBlockContainer()` and it's called only for
`EditSubAction::eCreateOrRemoveBlock` and it's used only in
`HTMLEditor::InsertBasicBlockWithTransaction()`.  Therefore, we can replace
calling `HTMLEditRules::WillDoAction()` in it with what
`HTMLEditRules::WIllMakeBasicBlock()` does.

First, `HTMLEditRules::WillDoAction()` checks whether first selection range
is editable.  If it's not so, it returns `NS_OK` with setting `aCancel` to
`true`.  Therefore, this patch moves this part to
`HTMLEditor::CanHandleHTMLEditSubAction()` for making
`HTMLEditor::InsertBasicBlockWithTransaction()` can check it easier.

Next, `HTMLEditor::InsertBasicBlockWithTransaction()` does something if
`HTMLEditRules::WillDoAction()` returns as not handled nor canceled.
However, this special handling requires at least one selection range:
https://searchfox.org/mozilla-central/rev/597a69c70a5cce6f42f159eb54ad1ef6745f5432/editor/libeditor/HTMLEditor.cpp#2284-2288
Surprisingly, `handled` is set to `false` only when there is an error or
there is no selection range.  Therefore, this long block has already been
dead code so that we can remove this.  Removing this block causes that we
become not throwing exception when `Document.execCommand("formatblock")`
without selection ranges.  But this is better since Chrome does not throw
excption.

Finally, this patch renames some related methods:
- `HTMLEditor::FormatBlockContainer()` -> `HTMLEditor::FormatBlockContainerWithTransaction()`
- `HTMLEditor::InsertBasicBlockWithTransaction()` -> `HTMLEditor::FormatBlockContainerAsSubAction()`

Differential Revision: https://phabricator.services.mozilla.com/D44179

--HG--
extra : moz-landing-system : lando
2019-09-02 06:08:43 +00:00
Masayuki Nakano
816dbbb57d Bug 1574852 - part 41: Move HTMLEditRules::InsertBRIfNeeded(nsINode&) to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44178

--HG--
extra : moz-landing-system : lando
2019-09-02 03:17:14 +00:00
Masayuki Nakano
08108eda15 Bug 1574852 - part 40: Move HTMLEditRules::InsertPaddingBRElementForEmptyLastLineIfNeeded() to HTMLEditor r=m_kato
And this fixes the caller which has not guaranteed the lifetime of the
start container.

Differential Revision: https://phabricator.services.mozilla.com/D44175

--HG--
extra : moz-landing-system : lando
2019-09-02 03:16:26 +00:00
Masayuki Nakano
1155464d4c Bug 1574852 - part 39: Move HTMLEditRules::InsertBRIfNeeded() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D44174

--HG--
extra : moz-landing-system : lando
2019-09-02 01:47:14 +00:00
Makoto Kato
9d24379b0f Bug 1577969 - Get rid of nsIHTMLEditor.getLinkedObject and nsIURIRefObject. r=masayuki
Since bug 1577443 is landed in comm-central, no one uses `nsIHTMLEditor.getLinkedObject`.

Differential Revision: https://phabricator.services.mozilla.com/D44361

--HG--
extra : moz-landing-system : lando
2019-09-02 12:15:41 +00:00
Masayuki Nakano
1779535bf3 Bug 1574852 - part 38: Move HTMLEditRules::MakeBasicBlock() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D43199

--HG--
extra : moz-landing-system : lando
2019-08-26 07:09:11 +00:00
Masayuki Nakano
a6be29d2bf Bug 1574852 - part 37: Move HTMLEditRules::ApplyBlockStyle() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D43198

--HG--
extra : moz-landing-system : lando
2019-08-26 04:48:21 +00:00
Masayuki Nakano
364649f84e Bug 1574852 - part 36: Move HTMLEditRules::RemvoeBlockStyle() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D43197

--HG--
extra : moz-landing-system : lando
2019-08-26 04:00:15 +00:00
Masayuki Nakano
72ea02b6a7 Bug 1574852 - part 35: Move HTMLEditRules::SplitRangeOffFromBlockAndRemoveMiddleContainer() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D43196

--HG--
extra : moz-landing-system : lando
2019-08-26 03:59:48 +00:00
Masayuki Nakano
627c9ff582 Bug 1574852 - part 34: Move HTMLEditRules::SplitRangeOffFromBlock() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D43195

--HG--
extra : moz-landing-system : lando
2019-08-26 03:20:35 +00:00
Masayuki Nakano
d42fe61844 Bug 1574852 - part 33: Move HTMLEditRules::MakeBlockquote() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D43194

--HG--
extra : moz-landing-system : lando
2019-08-26 01:55:01 +00:00
Masayuki Nakano
337a97617a Bug 1574852 - part 32: Move HTMLEditRules::MaybeSplitAncestorsForInsertWithTransaction() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D43193

--HG--
extra : moz-landing-system : lando
2019-08-26 01:38:56 +00:00
Masayuki Nakano
1a76778801 Bug 1574852 - part 31: Move HTMLEditRules::IsEmptyInline() and HTMLEditRules::ListIsEmptyLine() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D43192

--HG--
extra : moz-landing-system : lando
2019-08-25 06:59:24 +00:00
Masayuki Nakano
bff247acdd Bug 1574852 - part 30: Move HTMLEditRules::NormalizeSelection() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D43191

--HG--
extra : moz-landing-system : lando
2019-08-25 06:19:48 +00:00
Masayuki Nakano
ff26989c8d Bug 1574852 - part 29: Merge HTMLEditRules::GetListActionNodes() with HTMLEditor::CollectEditTargetNodes() r=m_kato
This patch fixes an existing bug with this clean up.

Except `HTMLEditRules::MoveBlock()`, `GetListActionNodes()` is called after
calling `SplitInlinesAndCollectEditTargetNodesInExtendedSelectionRanges()`
or `CollectEditTargetNodesInExtendedSelectionRanges()` **with**
`EditSubAction::eCreateOrChangeList`.  I think that `HTMLEditRules::MoveBlock()`
using the edit sub-action is a simple mistake.  Perhaps, it should be
`EditSubAction::eCreateOrRemvoeBlock`.  However, I'm not 100% sure because
`HTMLEditor::CollectEditTargetNodes()` does special handling for
`EditSubAction::eCreateOrRemvoeBlock` but not so for
`EditSubAction::eCreateOrChangeList`.  The behavior of difference between
those edit sub-actions are only here.  Therefore, this patch creates new
`EditSubAction` `eMergeBlockContents` for `MoveBlock()`.

Then, this patch makes `HTMLEditor::CollectEditTargetNodes()` handle
`EditSubAction::eCreateOrChangeList` insead of `GetListActionNodes()`.
This causes one logic change in `SplitInlinesAndCollectEditTargetNodes()`.
It calls `MaybeSplitElementsAtEveryBRElement()` after `CollectEditTargetNodes()`
so that this change makes calling `MaybeSplitElementsAtEveryBRElement()` at
last.  According to my tests, new behavior must be expected since `<br>`
elements outside and in `<table>` should be handled consistently.  Therefore,
this patch adds some simple testcases into WPT.

Differential Revision: https://phabricator.services.mozilla.com/D43190

--HG--
extra : moz-landing-system : lando
2019-08-25 04:20:34 +00:00
Masayuki Nakano
24835249e4 Bug 1574852 - part 28: Make methods collecting event target nodes take additional argument which can specify whether aOutArrayOfNodes includes non-editable nodes or not r=m_kato
`HTMLEditRules::GetListActionNodes()` removes non-editable element.  However,
this should've been done by collector methods.

Differential Revision: https://phabricator.services.mozilla.com/D43026

--HG--
extra : moz-landing-system : lando
2019-08-25 04:11:06 +00:00
Masayuki Nakano
071b3d92c1 Bug 1574852 - part 27: Move first half of HTMLEditRules::GetListActionNodes() to HTMLEditor and each caller r=m_kato
First half of `HTMLEditoRules::GetListActionNodes()` does 2 things.  One is
trying to get parent list element of `Selection` ranges if `aEntireList` is
`EntireList::yes`.  If it found a list element, it does nothing anymore.
Otherwise, falls backs to `EntireList::no` case.  So, if each caller which
calls it with `EntireList::yes`, `GetListActionNodes()` does not need the
argument.  Therefore, this patch does it first.

Then, `GetListActionNodes()` calls
`CollectEditTargetNodesInExtendedSelectionRanges()` or
`SplitInlinesAndCollectEditTargetNodesInExtendedSelectionRanges()`.  It's
considered with `aTouchContent` is `yes` or `no`.  So, this should be done
by each caller for making it clearer.

Differential Revision: https://phabricator.services.mozilla.com/D43024

--HG--
extra : moz-landing-system : lando
2019-08-25 03:45:34 +00:00
Masayuki Nakano
4b1fe5b646 Bug 1574852 - part 26: Move a part of HTMLEditRules::LookInsideDivBQandList() and remove the others r=m_kato
`HTMLEditRules::LookInsideDivBQandList()` does complicated things and I cannot
explain with a method name what it does.  Fortunately, there are only 2 callers.
Therefore, this patch duplicates the part of modifying the range and creates
a method to retrieve "deepest and only editable child of `<div>`, `<blockquote>`
and one of list items".

Differential Revision: https://phabricator.services.mozilla.com/D43023

--HG--
extra : moz-landing-system : lando
2019-08-23 09:20:05 +00:00
Cosmin Sabou
a876ab139c Bug 1575739 - Disable test on Android cause of frequent failures. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D43347

--HG--
extra : moz-landing-system : lando
2019-08-25 03:44:10 +00:00
Masayuki Nakano
7002a0f988 Bug 1574852 - part 25: Move HTMLEditRules::GetChildNodesForOperation() to HTMLEditor r=m_kato
It just collects all children of given node so that it can be a static method
in `HTMLEditor`.

Differential Revision: https://phabricator.services.mozilla.com/D43022

--HG--
extra : moz-landing-system : lando
2019-08-23 07:34:38 +00:00
Masayuki Nakano
6b6f24ee0f Bug 1574852 - part 24: Move HTMLEditRules::GetNodesFromPoint() to HTMLEditor r=m_kato
It's called only from `HTMLEditRules::MoveBlock()`.  Even though it has 4
patters to call different methods, we need only one of them.  Therefore,
this patch moves it into `HTMLEditor.h` as
`SplitInlinesAndCollectEditTargetNodesInOneHardLine()`.

Differential Revision: https://phabricator.services.mozilla.com/D43021

--HG--
extra : moz-landing-system : lando
2019-08-23 07:33:50 +00:00
Masayuki Nakano
6a2026a28d Bug 1574852 - part 23: Move HTMLEditRules::GetNodesFromSelection() to HTMLEditor r=m_kato
`HTMLEditRules::GetNodesFromSelection()` has a patch to call
`HTMLEditor::GetSelectionRangesExtendedToIncludeAdjuscentWhiteSpaces()`.
However, nobody uses this path so that we can get rid of this path.
Then, it becomes just calling `SplitInlinesAndCollectEditTargetNodes()` or
`CollectEditTargetNodes()` with result of
`GetSelectionRangesExtendedToHardLineStartAndEnd()`.  Therefore, we can split
it to `SplitInlinesAndCollectEditTargetNodesInExtendedSelectionRanges()` and
`CollectEditTargetNodesInExtendedSelectionRanges()`.  Then, we can mark
only the former as `MOZ_CAN_RUN_SCRIPT`.

Differential Revision: https://phabricator.services.mozilla.com/D43020

--HG--
extra : moz-landing-system : lando
2019-08-23 07:04:15 +00:00
Masayuki Nakano
dd792e1d82 Bug 1574852 - part 22: Move HTMLEditRules::GetPromotedRanges() to HTMLEditor r=m_kato
`HTMLEditRules::GetPromotedRanges()` does 2 things.  Calling
`CreateRangeIncludingAdjuscentWhiteSpaces()` or
`CreateRangeExtendedToHardLineStartAndEnd()` with each range of `Selection`.
The difference is considered with current edit sub-action.  Therefore, we cal
split it to `GetSelectionRangesExtendedToIncludeAdjuscentWhiteSpaces()` and
`GetSelectionRangesExtendedToHardLineStartAndEnd()`.  Then, we got clearer code
at each caller.

Differential Revision: https://phabricator.services.mozilla.com/D43018

--HG--
extra : moz-landing-system : lando
2019-08-23 06:55:34 +00:00
Masayuki Nakano
620c07b2bb Bug 1574852 - part 21: Move HTMLEditRules::PromoteRange() to HTMLEditor r=m_kato
The method name is really unclear what's done.  The method does 3 things.
One is try to select a `<br>` element in empty block if given range is
collapsed in the block.  This is moved as
`HTMLEditor::SelectBRElementIfCollapsedInEmptyBlock()`.  Next, it extends the
given range to include adjuscent whitespaces only when edit sub-action is
inserting or deleting text.  This is moved as
`HTMLEditor::CreateRangeIncludingAdjuscentWhiteSpaces()`.  Finally, when
handling the other edit sub-actions, extends the given range to start/end
of line at both edges.  This is moved as
`HTMLEditor::CreateRangeExtendedToHardLineStartAndEnd()`.

And also this patch makes each caller of `PromoteRange()` to check edit
sub-action by themselves.  Unfortunately, this duplicates same logic to
multiple places, but makes what they do clearer.  I think that the duplication
issue should be fixed later if necessary.  Instead, we should shine the
blackbox of `HTMLEditRules` right now.

Differential Revision: https://phabricator.services.mozilla.com/D43017

--HG--
extra : moz-landing-system : lando
2019-08-23 06:32:27 +00:00
Masayuki Nakano
39bbc90bb9 Bug 1574852 - part 20: Move HTMLEditRules::GetPromotedPoint() to HTMLEditor r=m_kato
`HTMLEditRules::GetPromotedPoint()` does too many things.  Therefore, this patch
splits it to 3 methods.  One is for specific `EditSubAction` values, that's
the first block in `GetPromotedPoint()`.  It's named as
`GetWhiteSpaceEndPoint()`.  Next one is for expanding start of the range to
start of its line.  It's named as `GetCurrentHardLineStartPoint()`.  The last
one is for expanding end of the range to end of its line.  It's named as
`GetCurrentHardLineEndPoint()`.

Differential Revision: https://phabricator.services.mozilla.com/D42791

--HG--
extra : moz-landing-system : lando
2019-08-23 06:05:38 +00:00
Masayuki Nakano
b8dba99d81 Bug 1574852 - part 19: Move HTMLEditRules::GetNodesForOperation() to HTMLEditor r=m_kato
This does not move the method simply.  Instead, splits it to 4 simpler
methods.

Despite of the name, it modifies the DOM tree if `aTouchContent` is
`TouchContent::yes`.  For avoiding this confusion and avoiding unnecessary
`MOZ_CAN_RUN_SCRIPT` attribute, the main part is split to
`HTMLEditor::CollectEditTargetNodes()`.

 If callers want to call `HTMLEditRules::GetNodesForOperation()` with
`TouchContent::no`, only calling this method equals to the call of
`GetNodesForOperation()`.

Otherwise, the callers should call
`HTMLEditor::SplitInlinesAndCollectEditTargetNodes()`.  This calls internal
methods automatically.

First, `HTMLEditor::SplitTextNodesAtRangeEnd()` splits text nodes at end of
each range.  Then, `HTMLEditor::SplitParentInlineElementsAtRangeEdges()`
overload splits inline elements at both edges of each range.  Then, collects
event target nodes with calling `HTMLEditor::CollectEditTargetNodes()`.
Finally, `HTMLEditor::MaybeSplitElementsAtEveryBRElement()` may split the
result nodes at every <br> element in them.

Differential Revision: https://phabricator.services.mozilla.com/D42790

--HG--
extra : moz-landing-system : lando
2019-08-23 04:38:28 +00:00
Masayuki Nakano
2271a1a433 Bug 1574852 - part 18: Move HTMLEditRules::BustUpInlinesAtBRs() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42789

--HG--
extra : moz-landing-system : lando
2019-08-23 04:14:56 +00:00
Masayuki Nakano
6cb490583d Bug 1574852 - part 17: Move HTMLEditRules::GetInnerContent() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42788

--HG--
extra : moz-landing-system : lando
2019-08-23 03:35:40 +00:00
Masayuki Nakano
9cd140da4a Bug 1574852 - part 16: Move HTMLEditRules::BustUpInlinesAtRangeEndpoints() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42787

--HG--
extra : moz-landing-system : lando
2019-08-23 01:28:26 +00:00
Mirko Brodesser
460b937f0b Bug 1575584: prevent reading uninitialized variable in TextEditor::ComputeValueInternal. r=masayuki
The fix here is to first check `NS_FAILED(rv)`, because if that's the
case, `cancel` wasn't necessarily set to a value.

As best practice I initialized `cancel` and `handled` with default
values.

Differential Revision: https://phabricator.services.mozilla.com/D43071

--HG--
extra : moz-landing-system : lando
2019-08-23 09:25:00 +00:00
Masayuki Nakano
495df615e7 Bug 1574852 - part 15: Move HTMLEditUtils::GetHighestInlineParent() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42786

--HG--
extra : moz-landing-system : lando
2019-08-22 08:47:50 +00:00
Masayuki Nakano
bee148c761 Bug 1574852 - part 14: Move HTMLEditRules::InsertBRElement() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42785

--HG--
extra : moz-landing-system : lando
2019-08-22 08:33:28 +00:00
Masayuki Nakano
6c17e180aa Bug 1574852 - part 13: Move HTMLEditRules::CanContainParagraph() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42784

--HG--
extra : moz-landing-system : lando
2019-08-22 08:29:38 +00:00
Masayuki Nakano
d0797846a4 Bug 1574852 - part 12: Move HTMLEditRules::SplitMailCites() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42783

--HG--
extra : moz-landing-system : lando
2019-08-22 08:29:16 +00:00
Masayuki Nakano
ba9cfcb2a7 Bug 1574852 - part 11: Move HTMLEditRules::GetTopEnclosingMailCite() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42782

--HG--
extra : moz-landing-system : lando
2019-08-22 13:11:16 +00:00
Masayuki Nakano
f23c09bbd0 Bug 1574852 - part 10: Move HTMLEditRules::WillInsertText() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42781

--HG--
extra : moz-landing-system : lando
2019-08-22 08:01:39 +00:00
Masayuki Nakano
3822de5442 Bug 1574852 - part 9: Move HTMLEditRules::CreateStyleForInsertText() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42780

--HG--
extra : moz-landing-system : lando
2019-08-22 07:33:41 +00:00
Masayuki Nakano
7ed950a31c Bug 1574852 - part 8: Move HTMLEditRules::WillInsert() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42778

--HG--
extra : moz-landing-system : lando
2019-08-22 07:08:19 +00:00
Masayuki Nakano
ed5707df5b Bug 1574852 - part 7: Get rid of HTMLEditRules::ClearCachedStyles() r=m_kato
It's declared, but not defined.

Differential Revision: https://phabricator.services.mozilla.com/D42777

--HG--
extra : moz-landing-system : lando
2019-08-22 06:03:52 +00:00
Masayuki Nakano
f135e00456 Bug 1574852 - part 6: Move HTMLEditRules::CacheInlineStyles() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42776

--HG--
extra : moz-landing-system : lando
2019-08-22 05:13:50 +00:00
Masayuki Nakano
ab4e7103b0 Bug 1574852 - part 5: Move HTMLEditRules::ReapplyCachedStyles() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42775

--HG--
extra : source : 6456b7a6cc679d744637e639d37cb73e795c1357
2019-08-22 05:12:28 +00:00
Noemi Erli
8586a20580 Backed out changeset 6456b7a6cc67 (bug 1574852) for failing in browser_html_tooltip-05.js 2019-08-22 11:41:29 +03:00
Masayuki Nakano
df6c33c509 Bug 1574852 - part 5: Move HTMLEditRules::ReapplyCachedStyles() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42775

--HG--
extra : moz-landing-system : lando
2019-08-22 05:12:28 +00:00
Masayuki Nakano
0d08551fbd Bug 1574852 - part 4: Move HTMLEditRules::GetInlineStyles() to HTMLEditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42774

--HG--
extra : moz-landing-system : lando
2019-08-22 01:10:30 +00:00
Makoto Kato
b4d246692c Bug 1574596 - Keep editing UI until PresShell is really gone. r=masayuki
This is regression by bug 1543312.

By bug 1543312, we destroy editor when destroying PresShell. But when destroying PresShell, editor doesn't remove anonymous content of editing UI from PresShell. Then, when destroying the frame manager in `PresShell::Destroy`, it hits assertion due to uncomposed doc.

We shouldn't hide editing UI during destroying PresShell and we should hide it after destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D42773

--HG--
extra : moz-landing-system : lando
2019-08-21 06:05:16 +00:00
Masayuki Nakano
3e52c98a82 Bug 1574852 - part 3: Get rid of HTMLEditRules::InitFields() r=m_kato
It's called immediately before setting `mHTMLEditor` and sets `mHTMLEditor` to
`nullptr`.  So, it does nothing actually.  We can get rid of it.

Differential Revision: https://phabricator.services.mozilla.com/D42771

--HG--
extra : moz-landing-system : lando
2019-08-21 07:14:09 +00:00
Masayuki Nakano
d22d8c911e Bug 1574852 - part 2: Replace HTMLEditRules::IsInlineNode() with HTMLEditor::NodeIsInlineStatic() r=m_kato
`HTMLEditRules::IsInlineNode()` is a wrapper of
`HTMLEditor::NodeIsInlineStatic()`, but returns opposite value.

This patch moves it into `HTMLEditor` and names it with same rule as
`NodeIsBlockStatic()`.

Note that this method may return true if given node is unexpected node type.
E.g., comment node, CDATA node, etc.  However, it's not scope of this bug.

Differential Revision: https://phabricator.services.mozilla.com/D42770

--HG--
extra : moz-landing-system : lando
2019-08-21 07:13:41 +00:00
Masayuki Nakano
24e7c7235d Bug 1574852 - part 1: Get rid of HTMLEditRules::IsBlockNode() r=m_kato
`HTMLEditRules::IsBlockNode()` just wraps `HTMLEditor::NodeIsBlockStatic()`
and all its users will be moved into `HTMLEditor`.  Therefore, we should
unwrap it.

Differential Revision: https://phabricator.services.mozilla.com/D42769

--HG--
extra : moz-landing-system : lando
2019-08-21 06:21:05 +00:00
Masayuki Nakano
eeb6d0434a Bug 1572685 - part 13: Get rid of HTMLEditRules::mReturnInEmptyLIKillsList r=m_kato
`HTMLEditRules::mReturnInEmptyLIKillsList` stores value of
`editor.html.typing.returnInEmptyListItemClosesList` at construction, and it's
set to true unless the pref value is `"false"`.  However, this pref isn't
registered in anywhere (all.js, firefox.js, etc) nor used in comm-central
and BlueGriffon.

Even if I search the pref in the web, I don't see any information so that
this hidden pref must not be used anybody.  Therefore, this patch just removes
this member.

Differential Revision: https://phabricator.services.mozilla.com/D42262

--HG--
extra : moz-landing-system : lando
2019-08-20 01:53:35 +00:00
Masayuki Nakano
47e3467fa6 Bug 1572685 - part 12: Move HTMLEditRules::mListenerEnabled to EditSubActionData r=m_kato
This patch includes a logic change.  `HTMLEditRules::mListenerEnabled` is used
for storing 2 state.  One is that whether `HTMLEditRules` can handle the legacy
listener methods (they came from `nsIEditActionListener`) with `mHTMLEditor` or
not.  The other is that whether current edit sub-action handler temporarily
disables the listeners for performance or not.

For the former, we can check same result with `HTMLEditRules::mInitialized`
and `HTMLEditRules::mHTMLEditor`.

However, the latter, current design is obviously wrong.  Currently,
`HTMLEditRules::mListenerEnabled` is set only to `false` temporarily from
`WillInsertText()`, but the state will be affected to other edit sub-actions
which are nested by mutation event listeners.  So, currently,
`HTMLEditRules::mDocChangeRange` may not contain modified range caused by
nested edit sub-actions.

For solving this bug, this patch moves it into `EditSubActionData` rather
than `HTMLEditor` and `TopLevelEditSubActionData`.

Differential Revision: https://phabricator.services.mozilla.com/D42107

--HG--
extra : moz-landing-system : lando
2019-08-20 01:53:02 +00:00
Masayuki Nakano
d741d7dbe7 Bug 1572685 - part 11: Move HTMLEditRules::JoinOffset to EditorBase::EditSubActionData r=m_kato
The members of `HTMLEditRules` which are used only while `WillDoAction()` and
`DidDoAction()` are called should be moved to specific stack only struct
`EditorBase::EditSubActionData`.

Differential Revision: https://phabricator.services.mozilla.com/D42106

--HG--
extra : moz-landing-system : lando
2019-08-20 01:52:50 +00:00
Masayuki Nakano
f3a6c9590b Bug 1572685 - part 10: Get rid of HTMLEditRules::mUtilRange r=m_kato
`HTMLEditRules::mUtilRange` is used only for the argument of
`HTMLEditRules::UpdateDocChangeRange()`.  However, it does not need to be
a range instance since it compares its start and
`TopLevelEditSubAction::mChangedRange->StartRef()`, and its end and
`TopLevelEditSubAction::mChangedRange->EndRef()`.  Therefore, with rewriting
it as taking 2 `EditorRawDOMPoint`s, we don't need `mUtilRange`.

Differential Revision: https://phabricator.services.mozilla.com/D42105

--HG--
extra : moz-landing-system : lando
2019-08-20 01:52:23 +00:00
Masayuki Nakano
0cc09df825 Bug 1572685 - part 9: Move HTMLEditRules::mDocChangeRange to TopLevelEditSubActionData r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42104

--HG--
extra : moz-landing-system : lando
2019-08-20 01:51:59 +00:00
Masayuki Nakano
a2367ac28f Bug 1572685 - part 8: Move HTMLEditRules::mCachedStyles to TopLevelEditSubAction r=m_kato
This patch makes `StyleCache` not inherit `ItemProp` because `MOZ_COUNT_CTOR`
and `MOZ_COUNT_DTOR` do not work well with `AutoTArray` and there is no reason
to do that since nobody treat `StyleCache` instance with `ItemProp` pointer.

Differential Revision: https://phabricator.services.mozilla.com/D42103

--HG--
extra : moz-landing-system : lando
2019-08-20 01:51:36 +00:00
Masayuki Nakano
d696ee098d Bug 1572685 - part 7: Move HTMLEditRules::mRangeItem to TopLevelEditSubActionData r=m_kato
For avoiding allocation cost of `RangeItem`, it should be stored by `HTMLEditor`
and reused by all `TopLevelEditSubActionData` instances for the editor instance.

Differential Revision: https://phabricator.services.mozilla.com/D42102

--HG--
extra : moz-landing-system : lando
2019-08-20 01:51:19 +00:00
Masayuki Nakano
5f2af66e4b Bug 1572685 - part 6: Move HTMLEditRules::mNewBlock to TopLevelEditSubActionData r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42101

--HG--
extra : moz-landing-system : lando
2019-08-20 01:50:56 +00:00
Masayuki Nakano
0bc1ae3058 Bug 1572685 - part 5: Move HTMLEditRules::mRestoreContentEditableCount to TopLevelEditSubActionData r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42100

--HG--
extra : moz-landing-system : lando
2019-08-20 01:50:34 +00:00
Masayuki Nakano
7b09e44b5c Bug 1572685 - part 4: Move HTMLEditRules::mDidEmptyParentBlocksRemoved to TopLevelEditSubActionData r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42099

--HG--
extra : moz-landing-system : lando
2019-08-20 01:50:21 +00:00
Masayuki Nakano
8f2394e050 Bug 1572685 - part 3: Move HTMLEditRules::mDidRangedDelete to TopLevelEditSubActionData r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42098

--HG--
extra : moz-landing-system : lando
2019-08-20 01:50:04 +00:00
Masayuki Nakano
396a69a2bc Bug 1572685 - part 2: Move HTMLEditRules::mDidExplicitlySetInterLine to TopLevelEditSubActionData r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D42097

--HG--
extra : moz-landing-system : lando
2019-08-20 01:50:02 +00:00
Masayuki Nakano
992c1c0972 Bug 1572685 - part 1: Move HTMLEditRules::mDidDeleteSelection into AutoEditActionDataSetter r=m_kato
Most member variables of `HTMLEditRules` are temporary used while between
`BeforeEdit()` and `AfterEdit()` are called or `WillDoAction()` and
`DidDoAction()` are called.

The former means the data should be stored during top-level edit sub-action
is set.  Therefore, this patch creates a struct, `TopLevelEditSubActionData`
and make it a member of `AutoEditActionDataSetter`.  Then, makes
`EditorBase::TopLevelEditActionDataRef()` return reference of it.

And also this patch moves `HTMLEditRules::mDidDeleteSelection` into it.

Differential Revision: https://phabricator.services.mozilla.com/D42096

--HG--
extra : moz-landing-system : lando
2019-08-20 01:50:00 +00:00
Mark Banner
ca74b508b7 Bug 1574915 - Fix some instances of using async functions as promise executors. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D42508

--HG--
extra : moz-landing-system : lando
2019-08-19 16:26:31 +00:00
Emilio Cobos Álvarez
bfcf9b881b Bug 1574544 - Remove now-unnecessary condition that makes the frame constructor get confused with editor anonymous nodes. r=mats
This condition was needed when FindInsertionPrevSibling and co didn't understand
display: contents.

Editor is pretty broken (and calls into PresShell::ContentRemoved directly, and
incorrectly, using anonymous nodes).

In this case we were taking the XBL path because of display: contents, which
means that we tried to seek to the editor anonymous node, and crash (since it's
not an explicit kid).

Editor needs to get fixed, but this is technically more correct and fixes the
crash, so we may as well take it in the interim.

Differential Revision: https://phabricator.services.mozilla.com/D42472

--HG--
extra : moz-landing-system : lando
2019-08-19 12:16:28 +00:00
Emilio Cobos Álvarez
6779b66f01 Bug 1571530 - Remove various bool arguments in sheet loader APIs. r=heycam
They're bad, specially if they do vastly different thing in overloaded
functions, like aUseSystemPrincipal and aIsPreload. :)

Differential Revision: https://phabricator.services.mozilla.com/D40851

--HG--
extra : moz-landing-system : lando
2019-08-16 10:56:05 +00:00
Emilio Cobos Álvarez
2353359865 Bug 1571530 - Make Loader APIs return a Result. r=heycam
On the fence on this one, but I do think it's nicer.

Differential Revision: https://phabricator.services.mozilla.com/D40850

--HG--
extra : moz-landing-system : lando
2019-08-16 10:56:03 +00:00
Masayuki Nakano
0e763a968a Bug 1572681 - part 6: Move TextEditRules::mDidExplicitlySetInterline to HTMLEditRules r=m_kato
`TextEditRules::mDidExplicitlySetInterline` is set to true only by
`HTMLEditRules`, but `TextEditRules::DidDeleteSelection()` refers it.
So, it's enough to make `TextEditRules::DidDeleteSelection()` take the
value and we can move it into `HTMLEditRules`.

Differential Revision: https://phabricator.services.mozilla.com/D41401

--HG--
extra : moz-landing-system : lando
2019-08-13 08:53:45 +00:00
Masayuki Nakano
8870cb5d53 Bug 1572681 - part 5: Get rid of TextEditRules::mDeleteBidiImmediately r=m_kato
`TextEditRules::mDeleteBidiImmediately` is cache of
`bidi.edit.delete_immediately` pref value at creation time of `TextEditRules`.
However, this is referred when user removes selection.  So, there is no
reason to keep same behavior starting from editor creation.  In other words,
it must be better to take same behavior in all editor instances.

Therefore, we should remove it and the pref value should be referred directly
when user tries to remove selection.

Differential Revision: https://phabricator.services.mozilla.com/D41400

--HG--
extra : moz-landing-system : lando
2019-08-13 04:41:51 +00:00
Masayuki Nakano
7759842058 Bug 1572681 - part 4: Get rid of arguments of TextEditRules::BeforeEdit() and TextEditRules::AfterEdit() r=m_kato
`TextEditRules::BeforeEdit()`, `TextEditRules::AfterEdit()`,
`HTMLEditRules::BeforeEdit()` and `HTMLEditRules::AfterEdit()` are always
called with same values as the result of
`EditorBase::GetTopLevelEditSubAction()` and
`EditorBase::GetDirectionOfTopLevelEditSubAction()`.

For making what they do clearer, we should make them access with those
`EditorBase` members for now.  This makes those methods ugly due to increasing
number of long lines.  However, this issue should be solved when we move them
into `TextEditor` and `HTMLEditor`.

Differential Revision: https://phabricator.services.mozilla.com/D41399

--HG--
extra : moz-landing-system : lando
2019-08-13 04:41:18 +00:00
Masayuki Nakano
726b15369f Bug 1572681 - part 3: Change TextEditRules::mLockRulesSniffing to HTMLEditRules::mInitialized r=m_kato
`TextEditRules::mLockRulesSniffing` is set by `AutoLockRulesSniffing`.
It's created during `BeforeEdit()` and `AfterEdit()` are called, and
`HTMLEditRules::Init()` is initializing `mDocChangeRange`.

The purpose of it is, preventing `BeforeEdit()` and `AfterEdit()` to do
something in that time.  For the former cases, we don't need this member
anymore since they won't be nested.  Therefore, we need to manage
`HTMLEditRules::BeforeEdit()` and `HTMLEditRules::AfterEdit()` won't do
anything only while `HTMLEditRules::Init()` is called.  Therefore,
there should be only `HTMLEditRules::mInitialized` instead.

Differential Revision: https://phabricator.services.mozilla.com/D41398

--HG--
extra : moz-landing-system : lando
2019-08-13 04:26:52 +00:00
Masayuki Nakano
a866a356da Bug 1572681 - part 2: Get rid of TextEditRules::mTopLevelEditSubAction and TextEditRules::mActionNesting r=m_kato
`TextEditRules::BeforeEdit()`, `TextEditRules::AfterEdit()`,
`HTMLEditRules::BeforeEdit()` and `HTMLEditRules::AfterEdit()` manages
`TextEditRules::mActionNesting` for preventing that they won't do same thing
per top-level edit sub-action.  However, this has already been checked by
their caller, `AutoTopLevelEditSubActionNotifier`.  So, we can get rid of it.
Then, `TextEditRules::mTopLevelEditSubAction` is also always same as
`EditorBase::GetTopLevelEditSubAction()`.  Therefore, we can get rid of it
too.

Differential Revision: https://phabricator.services.mozilla.com/D41397

--HG--
extra : moz-landing-system : lando
2019-08-13 02:42:25 +00:00
Masayuki Nakano
13b14b9b2f Bug 1572681 - part 1: Move TextEditRules::mCachedSelection* to EditorBase::AutoEditActionDataSetter r=m_kato
Despite of their names, `TextEditRules::mCachedSelectionNode` and
`TextEditRules::mCachedSelectionOffset` are used only for calling
`EditorBase::HandleInlineSpellCheck()` so that they should be renamed to
explain the purpose.

Additionally, they are not necessary to be in the heap since they are
necessary until `TextEditRules::AfterEdit()` is called.  Therefore, we can
move them into `EditorBase::HandleInlineSpellCheck()`.

Finally, `TextEditRules::BeforeEdit()` and `TextEditRules::AfterEdit()` are
called only by `TextEditor::OnStartToHandleTopLevelEditSubAction()` and
`TextEditor::OnEndHandlingTopLevelEditSubAction()`.  Therefore, we can move
the setter to `TextEditor::OnStartToHandleTopLevelEditSubAction()`.

Differential Revision: https://phabricator.services.mozilla.com/D41396

--HG--
extra : moz-landing-system : lando
2019-08-13 01:24:01 +00:00
Mirko Brodesser
81a41b2d7d Bug 1573119: declare more methods around HTMLEditor const/static. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D41524

--HG--
extra : moz-landing-system : lando
2019-08-13 07:34:11 +00:00
Makoto Kato
609348ba4d Bug 1543312 - Tear down editor when PresShell is destroyed. r=masayuki
When browsing reported site (https://minecraft.curseforge.com/), user that uses Android cannot set caret on some editable contents.

GV's IME code uses `NOTIFY_IME_OF_SELECTION_CHANGE` to update selection on native IME.  But GV doesn't receives this notification on this reported site. This notification is fired by editor's selection listener, but when this occurs, this notification is no logner fired unfortunately.  Because selection listener isn't registered by current selection.

At first, editor registers selection listener by `EditorBase::Init`. But like test case, if PresShell is destroyed after editor is created, this registration is no longer used, and we have to register it by new selection again. So we should tear down editor when PresShell is destroyed. (or we have to add a way to re-initialize selection listener?)

This isn't related to Android. Android's IME code depends on this notification, so this occurs easily.

Also, `PresShell::SetCaretEnabled` only works when caret is valid (`PresShell::GetCaret` has caret).  If caret is nothing, it hits assertion.

And, attached test case is reproduced sample.

Differential Revision: https://phabricator.services.mozilla.com/D41356

--HG--
extra : moz-landing-system : lando
2019-08-13 02:00:00 +00:00
Masayuki Nakano
ede2ddb459 Bug 1572375 - part 8: Wrap EditorBase::mPaddingBRElementForEmptyEditor with an inline method r=m_kato
`TextEditRules` and `HTMLEditRules` still refer
`EditorBase::mPaddingBRElementForEmptyEditor` directly but this is really ugly.
Therefore, this patch creates `EditorBase::HasPaddingBRElementForEmptyEditor()`
for wrapping its access.

Differential Revision: https://phabricator.services.mozilla.com/D41162

--HG--
extra : moz-landing-system : lando
2019-08-13 00:57:38 +00:00
Masayuki Nakano
485a59c303 Bug 1572375 - part 7: Get rid of HTMLEditRules::OnModifyDocument() r=m_kato
`HTMLEditRules::OnModifyDocument()` is same as just calling
`EditorBase::EnsureNoPaddingBRElementForEmptyEditor()` and
`EditorBase::MaybeCreatePaddingBRElementForEmptyEditor()` so that this patch
gets rid of the method, then, creates `HTMLEditor::OnModifyDocumentInternal()`
and makes it do same thing.

Differential Revision: https://phabricator.services.mozilla.com/D41161

--HG--
extra : moz-landing-system : lando
2019-08-13 00:56:57 +00:00
Masayuki Nakano
1df80236d6 Bug 1572375 - part 6: Get rid of HTMLEditRules::WillLoadHTML() r=m_kato
`HTMLEditRules::WillLoadHTML()` does exactly same thing as
`EditorBase::EnsureNoPaddingBRElementForEmptyEditor()`.  Therefore, we can
get rid of it and make `HTMLEditor::LoadHTML()` not use `HTMLEditRules`.

Differential Revision: https://phabricator.services.mozilla.com/D41160

--HG--
extra : moz-landing-system : lando
2019-08-13 00:09:46 +00:00
Masayuki Nakano
c1906f614d Bug 1572375 - part 5: Move TextEditRules::CreatePaddingBRElementForEmptyEditorIfNeeded() into EditorBase r=m_kato
`TextEditRules::CreatePaddingBRElementForEmptyEditorIfNeeded()` is used by
both `TextEditor` and `HTMLEditor` so that this moves it into `EditorBase`.

Additionally, making `TextEditor::MaybeChangePaddingBRElementForEmptyEditor()`
call it if there is no content.  Then, we can avoid the dependency of them.

Differential Revision: https://phabricator.services.mozilla.com/D41159

--HG--
extra : moz-landing-system : lando
2019-08-09 10:19:11 +00:00
Masayuki Nakano
3b82fdde10 Bug 1572375 - part 4: Move TextEditRules::RemoveRedundantTrailingBR() into TextEditor r=m_kato
`TextEditRules::RemoveRedundantTrailingBR()` is used only by multiline text
editor (i.e., `<textarea>`).  Therefore, it should be moved into `TextEditor`.

Differential Revision: https://phabricator.services.mozilla.com/D41158

--HG--
extra : moz-landing-system : lando
2019-08-09 09:01:56 +00:00
Masayuki Nakano
d88036fb98 Bug 1572375 - part 3: Get rid of TextEditRules::WillUndo(), TextEditRules::DidUndo(), TextEditRules::WillRedo() and TextEditRules::DidRedo() r=m_kato
`TextEditRules::WillUndo()` and `TextEditRules::WillRedo()` only check whether
the editor is readonly/disabled or not.  So, `TextEditor::UndoAsAction()` and
`TextEditor::RedoAsAction()` should do it first.

`TextEditRules::DidUndo()` and `TextEditRules::DidRedo()` only set or unset
`mPaddingBRElementForEmptyEditor` if it's restored by undo or redo.
Therefore, we can move the code into `TextEditor::UndoAsAction()` and
`TextEditor::RedoAsAction()`.

Note that this patch makes `TextEditor::UndoAsAction()` discard the result of
`TransactionManager::Undo()` because this is inconsistent from what
`TextEditor::RedoAsAction()` does and this was changed by part 5 of bug 1447924.
https://hg.mozilla.org/mozilla-central/rev/869a1445816be7f43f54f7c97f28e4c6273fa75f

Differential Revision: https://phabricator.services.mozilla.com/D41157

--HG--
extra : moz-landing-system : lando
2019-08-09 08:57:00 +00:00
Masayuki Nakano
b0606032ba Bug 1572375 - part 2: Split TextEditRules::WillInsert() r=m_kato
`TextEditRules::WillInsert()` is not used with initial purpose since
`HTMLEditor` always works with `HTMLEditRules` and its `WillDoAction()`
always handles `EditSubAction::eInsertElement`.

Additionally, its name is too generic since it does non-related 3 things.

One is checking whether the editor is readonly or disabled.  However, this
may not be necessary since its callers may have already checked it or
just ignored the result.  So, this should be check by each caller.

Next one is masking password if auto-masking is enabled.  This is `TextEditor`
specific feature so that this patch moves the code into
`TextEditor::MaybeDoAutoPasswordMasking()`.

Final one is removing empty `<br>` element for empty editor if there is.
This is common feature so that this patch moves this code into
`EditorBase::EnsureNoPaddingBRElementForEmptyEditor()`.

Differential Revision: https://phabricator.services.mozilla.com/D41156

--HG--
extra : moz-landing-system : lando
2019-08-09 08:25:37 +00:00
Masayuki Nakano
b25f8b0e06 Bug 1572375 - part 1: Move TextEditRules::mPaddingBRElementForEmptyEditor to EditorBase r=m_kato
`TextEditRules::mPaddingBRElementForEmptyEditor` are used by both `TextEditor`
and `HTMLEditor`.  Therefore, it should be in `EditorBase`.

This patch makes `TextEditRules` and `HTMLEditRules` directly access the
private member of `EditorBase` temporarily.  It'll be fixed by the following
patches.

Differential Revision: https://phabricator.services.mozilla.com/D41155

--HG--
extra : moz-landing-system : lando
2019-08-09 07:03:29 +00:00
Mirko Brodesser
a83f7bfa50 Bug 1572715: part 2) Make some methods around HTMLEditor const-correct. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D41385

--HG--
extra : moz-landing-system : lando
2019-08-12 08:31:04 +00:00