Commit Graph

9596 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
3c12d374bc Bug 1600362 - Cleanup IntersectionObserver. r=smaug
Initially this was going to be a simple cleanup: Remove some useless namespaces
here and there and so on, remove `using` statements from the header and so on.

But unfortunately, DOMIntersectionObserver.h (which is included in Element.h,
unnecessarily) ended up exposing `Element` unnamespaced to a lot of code, so I
had to fix that.

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

--HG--
extra : moz-landing-system : lando
2019-11-29 20:39:36 +00:00
Emilio Cobos Álvarez
3abaf523d8 Bug 1599843 - nsCommandManager::CommandStatusChanged is infallible. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D54980

--HG--
extra : moz-landing-system : lando
2019-11-28 02:22:29 +00:00
Masayuki Nakano
b91249c508 Bug 1599318 - TextEditor shouldn't put \r into its anonymous text node r=m_kato
Starting from bug 1597679, `HTMLTextAreaElement::GetValueInternal()` stops
converting `\r\n` and `\r` with `\n` because it may be in hot path and the scan
cost of `\r` in `nsContentUtils::PlatformToDOMLineBreaks()` is redundant in
most cases.

However, there are still some paths to input `\r`.  This patch makes them
call `nsContentUtils::PlatformToDOMLineBreaks()` if they have not done it.

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

--HG--
extra : moz-landing-system : lando
2019-11-28 05:51:41 +00:00
Sylvestre Ledru
8d2f0d1b1f Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-11-26 14:35:02 +00:00
jeffin143
2293551763 Bug 1598539 : convert NS_STYLE_IME_MODE_* to an enum class in nsStyleConsts.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D54255

--HG--
extra : moz-landing-system : lando
2019-11-25 15:41:18 +00:00
Masayuki Nakano
4d856eb67e Bug 1598327 - part 2: Make TopLevelEditSubActionData::mCachedInlineStyle create only in HTMLEditor r=m_kato
The initialization cost of `AutoStyleCacheArray` is still expensive and it's
used only by `HTMLEditor`.  Therefore, we should make it `Maybe` and construct
it only when the editor is an `HTMLEditor`.

Depends on D54253

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

--HG--
extra : moz-landing-system : lando
2019-11-23 01:12:33 +00:00
Masayuki Nakano
b07bd373e8 Bug 1598327 - part 1: Make AutoStyleCacheArray initialize itself with initialization list r=m_kato
Calling `AppendElement()` a lot causes the constructor appearing in profile.
`AutoTArray` has a constructor taking initialization list.  Let's use it.

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

--HG--
extra : moz-landing-system : lando
2019-11-23 01:12:35 +00:00
Masayuki Nakano
20699e2189 Bug 1597679 - part 2: Make nsITextControlElement inherit nsGenericHTMLFormElementWithState r=smaug
Sub classes of `nsITextControlElement` are only `HTMLInputElement` and
`HTMLTextAreaElement`. And both base class is
`nsGenericHTMLFormElementWithState`.  Therefore, we can make
`nsITextControlElement` inherit `nsGenericHTMLFormElementWithState` and
make `HTMLInputElement` and `HTMLTextAreaElement` inherit
`nsITextControlElement`.  Then, we can get rid of a lot of QI between
`nsINode`/`nsIContent`/`Element` and `nsITextControlElement` (and note that
some of them in a hot path).

Additionally, this patch renames `nsITextControlElement` to
`mozilla::TextControlElement`.

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

--HG--
rename : dom/html/nsITextControlElement.h => dom/html/TextControlElement.h
extra : moz-landing-system : lando
2019-11-25 06:35:15 +00:00
Coroiu Cristina
84bf2b6d25 Backed out 3 changesets (bug 1597679) for Android debug build bustage at build/src/dom/base/nsContentAreaDragDrop.cpp
Backed out changeset 6a73b58e0db4 (bug 1597679)
Backed out changeset 90a172eff2de (bug 1597679)
Backed out changeset d4a156cf28ff (bug 1597679)

--HG--
rename : dom/html/TextControlElement.h => dom/html/nsITextControlElement.h
2019-11-24 09:02:53 +02:00
Masayuki Nakano
eea1784f2d Bug 1597679 - part 2: Make nsITextControlElement inherit nsGenericHTMLFormElementWithState r=smaug
Sub classes of `nsITextControlElement` are only `HTMLInputElement` and
`HTMLTextAreaElement`. And both base class is
`nsGenericHTMLFormElementWithState`.  Therefore, we can make
`nsITextControlElement` inherit `nsGenericHTMLFormElementWithState` and
make `HTMLInputElement` and `HTMLTextAreaElement` inherit
`nsITextControlElement`.  Then, we can get rid of a lot of QI between
`nsINode`/`nsIContent`/`Element` and `nsITextControlElement` (and note that
some of them in a hot path).

Additionally, this patch renames `nsITextControlElement` to
`mozilla::TextControlElement`.

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

--HG--
rename : dom/html/nsITextControlElement.h => dom/html/TextControlElement.h
extra : moz-landing-system : lando
2019-11-24 05:38:02 +00:00
Cosmin Sabou
f2a93e6f4d Backed out 2 changesets (bug 1598327) for browser chrome failures on browser_bug399606.js
Backed out changeset c2996e694ada (bug 1598327)
Backed out changeset fd1c9515bd8b (bug 1598327)
2019-11-23 02:52:20 +02:00
Noemi Erli
92d932148c Backed out changeset 8cdae49ab472 (bug 1598539) for causing build bustages in EditorBase.cpp CLOSED TREE 2019-11-22 22:04:00 +02:00
Masayuki Nakano
f846ab4ab6 Bug 1598327 - part 2: Make TopLevelEditSubActionData::mCachedInlineStyle create only in HTMLEditor r=m_kato
The initialization cost of `AutoStyleCacheArray` is still expensive and it's
used only by `HTMLEditor`.  Therefore, we should make it `Maybe` and construct
it only when the editor is an `HTMLEditor`.

Depends on D54253

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

--HG--
extra : moz-landing-system : lando
2019-11-22 15:02:57 +00:00
Masayuki Nakano
1ecc9bd28e Bug 1598327 - part 1: Make AutoStyleCacheArray initialize itself with initialization list r=m_kato
Calling `AppendElement()` a lot causes the constructor appearing in profile.
`AutoTArray` has a constructor taking initialization list.  Let's use it.

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

--HG--
extra : moz-landing-system : lando
2019-11-22 16:11:10 +00:00
jeffin143
058d24f2df Bug 1598539 : convert NS_STYLE_IME_MODE_* to an enum class in nsStyleConsts.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D54255

--HG--
extra : moz-landing-system : lando
2019-11-22 13:33:59 +00:00
Hiroyuki Ikezoe
49285c5161 Bug 1598225 - Call restoreNormalRefresh before closing window. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D54197

--HG--
extra : moz-landing-system : lando
2019-11-22 01:35:03 +00:00
Makoto Kato
d6c4b79621 Bug 1595425 - Don't flush layout when setting empty string on Chrome. r=masayuki
This is a regression by bug 1568996. Although editor uses nsFrameSelection to
move caret, if frame is dirty, nsFrameSelection returns error.
So by bug 1568996, we flush layout before calling nsFrameSelection. But we
should stop flushing layout when we don't use nsFrameSelection.

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

--HG--
extra : moz-landing-system : lando
2019-11-20 05:09:18 +00:00
Emma Malysz
ce9c72d88e Bug 1597752, rename .xul files in editor/ to .xhtml r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D53844

--HG--
rename : editor/composer/test/test_bug434998.xul => editor/composer/test/test_bug434998.xhtml
rename : editor/libeditor/tests/test_bug1386222.xul => editor/libeditor/tests/test_bug1386222.xhtml
rename : editor/libeditor/tests/test_bug1397412.xul => editor/libeditor/tests/test_bug1397412.xhtml
rename : editor/libeditor/tests/test_bug489202.xul => editor/libeditor/tests/test_bug489202.xhtml
rename : editor/libeditor/tests/test_bug599983.xul => editor/libeditor/tests/test_bug599983.xhtml
rename : editor/libeditor/tests/test_bug607584.xul => editor/libeditor/tests/test_bug607584.xhtml
rename : editor/libeditor/tests/test_bug616590.xul => editor/libeditor/tests/test_bug616590.xhtml
rename : editor/libeditor/tests/test_bug780908.xul => editor/libeditor/tests/test_bug780908.xhtml
rename : editor/libeditor/tests/test_cut_copy_delete_command_enabled.xul => editor/libeditor/tests/test_cut_copy_delete_command_enabled.xhtml
rename : editor/libeditor/tests/test_pasteImgTextarea.xul => editor/libeditor/tests/test_pasteImgTextarea.xhtml
rename : editor/reftests/xul/empty-ref.xul => editor/reftests/xul/empty-ref.xhtml
rename : editor/reftests/xul/emptytextbox-4.xul => editor/reftests/xul/emptytextbox-4.xhtml
rename : editor/reftests/xul/emptytextbox-ref.xul => editor/reftests/xul/emptytextbox-ref.xhtml
extra : moz-landing-system : lando
2019-11-19 23:40:10 +00:00
Emilio Cobos Álvarez
ef510c0de3 Bug 1596768 - Remove GetBindingParent usage in editor. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D53199

--HG--
extra : moz-landing-system : lando
2019-11-15 17:44:11 +00:00
Mirko Brodesser
1ae8f1b996 Bug 1591417: part 4) Adapt InsertTextIntoTextNodeWithTransaction to pass adjusted range to TopLevelEditSubActionDataRef.DidInsertText. r=masayuki
Otherwise, an invalid `EditorRawDOMPoint` was constructed by a test.

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

--HG--
extra : moz-landing-system : lando
2019-11-13 09:16:06 +00:00
Mirko Brodesser
c4342625ea Bug 1591417: part 2) Rename HasMutationEventListeners to MaybeHasMutationEventListeners. r=masayuki
After removing all mutation event listeners, the corresponding method
still returns `true`, so the new name is more accurate.

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

--HG--
extra : moz-landing-system : lando
2019-11-12 15:20:20 +00:00
Mirko Brodesser
e5f7410403 Bug 1591417: part 1) Assert EditorDOMPointBase::ToRawRangeBoundary() uses valid offset. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D52341

--HG--
extra : moz-landing-system : lando
2019-11-12 15:20:13 +00:00
Sebastian Hengst
0341151d63 Bug 1594981 - update Core::DOM* and Core::Storage* bugzilla product and component meta data in moz.build files after reorganization in bug 1594717. r=annevk
Differential Revision: https://phabricator.services.mozilla.com/D52345

--HG--
extra : moz-landing-system : lando
2019-11-08 12:17:57 +00:00
Masayuki Nakano
a1a0330433 Bug 1593920 - Clean up HTMLEditor::TabInTable() with taking WidgetKeyboardEvent* and returning EditActionResult r=m_kato
With making it take `WidgetKeyboardEvent*`, it won't need to return "handled"
state.  However, when we implement `beforeinput` event, it needs to return
"canceled" state.  Therefore, it should return `EditActionResult`.

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

--HG--
extra : moz-landing-system : lando
2019-11-07 02:59:51 +00:00
Masayuki Nakano
129b58687c Bug 1588745 - part 6: Post processing of setting value with TextEditor should be done before dispatching "input" event r=Ehsan
Currently, "input" event is fired when the `AutoScriptBlocker` in `SetValue()`
is deleted.  So, for keeping same behavior, the post processing after calling
`TextEditor` methods should be done before editor dispatches "input" event.

Fortunately, `TextInputListener::OnEditActionHandled()` is a good chance to
do that.  Therefore, this patch makes it notify `TextControlState` and
`AutoTextControlHandlingState`.

Note that ideally, each method of `TextEditor` should return
`NS_ERROR_OUT_OF_MEMORY` coming from
`AutoTextControlHandlingState::OnEditActionHandled()`.  However, it requires
a lot of changes in editor classes, and the case is really rare since editor
does not use fallible allocation.  Therefore, it must be okay to crash in
editor if `OnEditActionHandled()` returns `NS_ERROR_OUT_OF_MEMORY`.

Depends on D51395

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

--HG--
extra : moz-landing-system : lando
2019-11-03 02:50:00 +00:00
Edgar Chen
acd2114113 Bug 1580491 - Use Element::HasNonEmptyAttr in various places; r=bzbarsky
This was done by reviewing the results of
https://searchfox.org/mozilla-central/search?q=%2F*GetAttr%5C(.%2B(%26%26%7C%5C%7C%5C%7C)&case=true&regexp=true
one by one and replacing them with Element::HasNonEmptyAttr if possible.

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

--HG--
extra : moz-landing-system : lando
2019-11-01 15:24:25 +00:00
Emilio Cobos Álvarez
630c46a466 Bug 1591297 - Fix/remove a couple sanitizer tests now that we don't parse -moz-binding. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D50590

--HG--
extra : moz-landing-system : lando
2019-10-29 08:32:06 +00:00
Alex Henrie
74cc0f4dce Bug 1591490 - Use the NS_IS_SURROGATE_PAIR macro everywhere. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D50697

--HG--
extra : moz-landing-system : lando
2019-10-27 05:05:51 +00:00
Makoto Kato
67ecac7a24 Bug 1453190 - Don't get editing session during destroying docshell. r=masayuki
When closing window / documnet, if content modifies an element that has
contenteditable via unload event, it hits assertion in
`nsDocShell::EnsureEditorData` due to destroying document. So we should
return error before getting editing session.

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

--HG--
extra : moz-landing-system : lando
2019-10-25 10:23:31 +00:00
Emilio Cobos Álvarez
6d8c0d26b1 Bug 1582398 - Remove user-select: all for editable labels. r=masayuki
This seems to go back to our initial contenteditable implementation, and I don't
think there's a reason <label> should work differently from anything else.

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

--HG--
extra : moz-landing-system : lando
2019-10-23 09:30:03 +00:00
Mirko Brodesser
e1b9454134 Bug 1587716: change RangeBoundaryBase's offset argument to uint32_t. r=smaug
`uint32_t`, because `nsRange::ComparePoints` requires it -- by webidl
interface -- to be unsigned long.

Moreover it makes `RangeBoundaryBase`'s interface cleaner, because it
already exposes the offset as a `uint32_t`.

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

--HG--
extra : moz-landing-system : lando
2019-10-23 08:22:36 +00:00
Mats Palmgren
6aadfc8aaf Bug 1587141 part 2 - Make execCommand("indent") ignore whitespace when looking for sibling list element. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D48587

--HG--
extra : moz-landing-system : lando
2019-10-14 17:11:00 +00:00
Mats Palmgren
c506e40d11 Bug 1587141 part 1 - Share some common code between Handle[CSS|HTML]IndentAtSelectionInternal (idempotent patch). r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D48586

--HG--
extra : moz-landing-system : lando
2019-10-15 04:36:26 +00:00
Geoff Brown
32490358c2 Bug 1585119 - Re-enable many more mochitests 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.
I intend to enable still more mochitests in a future patch.

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

--HG--
extra : moz-landing-system : lando
2019-10-18 14:35:20 +00:00
Valentin Gosu
8a48b05801 Bug 1413203 - The css for about:networking is not loading in Android r=Gijs
* Make about:networking work on mobile
* I used the aboutMemory.css file as a guide for doing this
* The mobile CSS does not include the common.css, since that doesn't seem to work. But at least now the interfaces is functional. We should make it look nice in a follow-up.

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

--HG--
extra : moz-landing-system : lando
2019-10-18 12:01:56 +00:00
Masayuki Nakano
abdf9727f5 Bug 1582215 - Make HTMLEditor::DoInsertHTMLWithContext() compute new insertion point before removing unnecessary <li> elements r=m_kato
When inserting `<li>` elements into `<ul>`, `<ol>` or `<li>` element,
`HTMLEditor::DoInsertHTMLWithContext()` removes unnecessary empty `<li>`
elements at insertion point.  At this time, we've computed next insertion
point with removed `<li>` element.  Therefore, insertion point goes out
from the DOM tree.  This patch makes it compute new insertion point before
removing each empty `<li>` element.

Additionally, this patch adds some WPT data for testing this case.  I verified
that Chrome passes the new tests too.

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

--HG--
extra : moz-landing-system : lando
2019-10-17 09:17:14 +00:00
Geoff Brown
c906073cd5 Bug 1585119 - Re-enable many mochitests 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.
With the additional tests running, task times increase; I have added one
more test chunk for android mochitest-plain.
These tests were identified from a random sampling of mochitest manifests;
I intend to enable more mochitests in future patches.

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

--HG--
extra : moz-landing-system : lando
2019-10-15 15:07:09 +00:00
Mirko Brodesser
b761e516f6 Bug 1587746: remove RangeBoundaryBase::Set and use constructor instead. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D48826

--HG--
extra : moz-landing-system : lando
2019-10-11 12:43:57 +00:00
Masayuki Nakano
ac74e89b26 Bug 1566795 - part 6: Make HTMLEditor::RemoveInlinePropertyInternal() remove text node style which comes from block parent r=m_kato
Finally, `Document.execCommand()` still does not work fine if selection
starts from very start of block and/or end at very end of block because
`PromoteInlineRange()` extends selection range to contain the
containers, then, `SubtreeContentIterator` won't list up text nodes.

In this case, `RemoveInlinePropertyInternal()` expects that
`RemoveStyleInside()` removes text node style with creating
`<span>` elements.  However, `RemoveStyleInsilde()` only handles
`Element`s and it handles elements from most-descendants.
Therefore, it cannot distinguish whether text node style comes
from removing inline elements or parent block.

This patch makes `RemoveInlinePropertyInternal()` collect
descendant text nodes in the range after handling all nodes in
the range except descendant text nodes, then, check the
final style of descendant text nodes, finally, remove the style
if coming from parent block.

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

--HG--
extra : moz-landing-system : lando
2019-10-09 08:04:34 +00:00
Makoto Kato
aecde3cc69 Bug 1587312 - Fix typo of finding non-anonymous content. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D48640

--HG--
extra : moz-landing-system : lando
2019-10-09 05:42:42 +00:00
Masayuki Nakano
92ead719bd Bug 1566795 - part 5: Make the for loop of HTMLEditor::RemoveInlinePropertyInternal() partially selected text nodes r=m_kato
If selection range is not in **one** text node, `RemoveInlinePropertyInternal()`
collects target nodes with `SubtreeContentIterator`.  It only collects topmost
nodes which are **entirely** contained in the range (it's enough because their
descendants will be handled by `RemoveStyleInside()` recursively).

The reasons why it uses `SubtreeContentIterator` rather than
`PreContentIterator` must be:
1. Performance reason.
2. Assuming there are no multiple text nodes.
3. Not expects that user removes text node styles come from parent block.

The reason 2 is wrong because when removing a style, all browsers don't
join text nodes which was in removing element with adjacent text nodes.
(I.e., we cannot change this behavior for compatibility.)

The reason 3 is of course wrong we're struggling with this scenario.

Therefore, `RemoveInlinePropertyInternal()` needs to collect partially
selected text nodes by itself (if there are).  Then, we can merge the
single text node selected case with the `for` loop.

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

--HG--
extra : moz-landing-system : lando
2019-10-08 09:24:47 +00:00
Masayuki Nakano
bb14f09ee9 Bug 1566795 - part 4: Make HTMLEditor not check IsCSSEnabled() at removing inline style r=m_kato
For compatibility with Chrome, when removing inline style at block parent,
we should reset the style with creating `<span>` element whose `style`
attribute removes the style.  We do this only in CSS mode, but we should do
it in HTML mode too.

This patch also makes `FontFaceStateCommand::SetState()` ignore `tt` value
if its root caller is `Document::ExecCommand()`.  It was implemented for
composer to handle XUL command in bug 115922.  Therefore, we should not do
this special handling on the web.  If it were possible to separate this
change to another bug, it'd be nicer.  But without this change, we'll have
a lot of regressions of `Document.execCommand("fontname")`.  Therefore,
this is also fixed in this patch.

Note that this removes first `.ini` file selection because
the tests cannot be run without test number range parameter.
So, the sections are not used anymore.

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

--HG--
extra : moz-landing-system : lando
2019-10-08 09:24:19 +00:00
Razvan Maries
a6b9e7fdbc Backed out changeset 90695432b21e (bug 1566795)for build bustages on HTMLStyleEditor.cpp. CLOSED TREE 2019-10-08 10:21:58 +03:00
Masayuki Nakano
b1996e5052 Bug 1566795 - part 4: Make HTMLEditor not check IsCSSEnabled() at removing inline style r=m_kato
For compatibility with Chrome, when removing inline style at block parent,
we should reset the style with creating `<span>` element whose `style`
attribute removes the style.  We do this only in CSS mode, but we should do
it in HTML mode too.

This patch also makes `FontFaceStateCommand::SetState()` ignore `tt` value
if its root caller is `Document::ExecCommand()`.  It was implemented for
composer to handle XUL command in bug 115922.  Therefore, we should not do
this special handling on the web.  If it were possible to separate this
change to another bug, it'd be nicer.  But without this change, we'll have
a lot of regressions of `Document.execCommand("fontname")`.  Therefore,
this is also fixed in this patch.

Note that this removes first `.ini` file selection because
the tests cannot be run without test number range parameter.
So, the sections are not used anymore.

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

--HG--
extra : moz-landing-system : lando
2019-10-07 05:31:19 +00:00
Masayuki Nakano
6a1791bc12 Bug 1566795 - part 3: Clean up HTMLEditor::RemoveStyleInside() r=m_kato
Surprisingly, its `aChildOnly` is never set to `true` and if it were set to
`true`, it does unnecessary recursive calls.  Therefore, we can make it
simpler.

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

--HG--
extra : moz-landing-system : lando
2019-10-07 03:33:11 +00:00
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