Commit Graph

8551 Commits

Author SHA1 Message Date
Boris Zbarsky
7f7ce9b56c Bug 1444686 part 13. Remove remaining nsIDOMDataTransfer uses. r=mystor
MozReview-Commit-ID: EFauqLMGz5S
2018-03-13 16:24:00 -04:00
Boris Zbarsky
145e566cd8 Bug 1444686 part 10. Remove nsIDOMDragEvent::GetDataTransfer. r=mystor
MozReview-Commit-ID: LwKqWBGXVcN
2018-03-13 16:24:00 -04:00
Boris Zbarsky
0da7198eee Bug 1444686 part 4. Get rid of nsIDOMDataTransfer::Get/SetDropEffectInt. r=mystor
MozReview-Commit-ID: EQ8KXMf4mnR
2018-03-13 16:23:59 -04:00
Boris Zbarsky
6139d9be8f Bug 1444686 part 2. Get rid of nsIDOMDataTransfer::GetMozItemCount. r=mystor
MozReview-Commit-ID: 1eo6czER8Qw
2018-03-13 16:23:59 -04:00
Emilio Cobos Álvarez
06bfed73ea Bug 1446451: GetPropertyValue can indeed not return an integer if the node is not displayed. r=masayuki
MozReview-Commit-ID: Gk0PffVE7bz

--HG--
extra : rebase_source : ded727b58d4184a9723d9f2d196882462384bce7
2018-03-16 18:07:33 +01:00
Makoto Kato
492ea93b80 Bug 1443714 - Remove already_AddRefed for GetDocument and GetPresSehll on EditorBase. r=masayuki
It is unnecessary to use already_AddRefed for GetDocument and GetPresShell.
Then, if we remove already_AddRefed, we can replace this with const method.

MozReview-Commit-ID: KTVS0rYrY2i

--HG--
extra : rebase_source : 0199026410fc674f112c960b599a09bc7906cf85
2018-03-07 18:26:00 +09:00
Tiberius Oros
f3c2b2ecf8 Merge autoland to mozilla-central. a=merge 2018-03-06 11:52:14 +02:00
Olli Pettay
51b6aa1b21 Bug 1066965, make contentEditable and spellchecking to work in ShadowDOM, r=mrbkap 2018-03-06 09:34:40 +09:00
Masayuki Nakano
9d71742b36 Bug 662591 - HTMLEditor should set caret to start of first editable text node or before first editable inline node r=m_kato
Currently, HTMLEditor doesn't initialize caret position when it gets focus by
itself in most cases.  Only when it's in designMode, it may move caret to the
first visible (not checking CSS actually).

In most cases, caret position is adjusted when EditorBase::InitializeSelection()
calls Selection::SetAncestorLimiter().  If selected range is outside of
new limiter, it moves caret to start of the new limiter.  However, this is
really different behavior from the other browsers.  The other browsers try
to move caret to the first editable text node or before the first editable
content such as <img>, <input>, etc.

This difference causes a serious incompatible issue with Draft.js.  It doesn't
initialize caret position when it gets focus but it assumes that caret is
always set to before <br> element if there is no other content.

So, let's try to behave as what other browsers do as far as possible.

This patch makes editor behave as:
* if selection is already in the editing host except start of the editing host,
  does nothing.
* if there is non-editable element before any editable node, move caret to
  start of the editing host.
* if there is editable text node or element node which cannot have a text node,
  move its start or before it.
* if there is no editable nodes which can contain text nodes, move caret to
  start of the editing host.

Note that before applying this patch, in designMode, BeginningOfDocument() used
document element instead of <body> element.  Therefore, it may set odd position
if <head> element has some text nodes with <script> or <style>.  However,
this doesn't make sense and for making more consistent behavior between
designMode and contenteditable, this patch makes it use editing host (it's
<body> element if it's in designMode).

MozReview-Commit-ID: 5neYoTMq6Cc

--HG--
extra : rebase_source : c4d06b6864a221d7cd2833a007d73f7d67821e95
2018-03-02 14:20:25 +09:00
Makoto Kato
00cc8e57e1 Bug 1442500 - Part 3. Move spellchecker tests to editor/spellchecker. r=masayuki
Many tests in composer are for spellchecker, so we should move it to
/editor/spellchecker/tests.

MozReview-Commit-ID: 7qmNymVXyZP

--HG--
rename : editor/composer/test/bug1200533_subframe.html => editor/spellchecker/tests/bug1200533_subframe.html
rename : editor/composer/test/bug1204147_subframe.html => editor/spellchecker/tests/bug1204147_subframe.html
rename : editor/composer/test/bug1204147_subframe2.html => editor/spellchecker/tests/bug1204147_subframe2.html
rename : editor/composer/test/bug678842_subframe.html => editor/spellchecker/tests/bug678842_subframe.html
rename : editor/composer/test/bug717433_subframe.html => editor/spellchecker/tests/bug717433_subframe.html
rename : editor/composer/test/de-DE/de_DE.aff => editor/spellchecker/tests/de-DE/de_DE.aff
rename : editor/composer/test/de-DE/de_DE.dic => editor/spellchecker/tests/de-DE/de_DE.dic
rename : editor/composer/test/en-AU/en_AU.aff => editor/spellchecker/tests/en-AU/en_AU.aff
rename : editor/composer/test/en-AU/en_AU.dic => editor/spellchecker/tests/en-AU/en_AU.dic
rename : editor/composer/test/en-GB/en_GB.aff => editor/spellchecker/tests/en-GB/en_GB.aff
rename : editor/composer/test/en-GB/en_GB.dic => editor/spellchecker/tests/en-GB/en_GB.dic
rename : editor/composer/test/mochitest.ini => editor/spellchecker/tests/mochitest.ini
rename : editor/composer/test/test_async_UpdateCurrentDictionary.html => editor/spellchecker/tests/test_async_UpdateCurrentDictionary.html
rename : editor/composer/test/test_bug1200533.html => editor/spellchecker/tests/test_bug1200533.html
rename : editor/composer/test/test_bug1204147.html => editor/spellchecker/tests/test_bug1204147.html
rename : editor/composer/test/test_bug1205983.html => editor/spellchecker/tests/test_bug1205983.html
rename : editor/composer/test/test_bug1209414.html => editor/spellchecker/tests/test_bug1209414.html
rename : editor/composer/test/test_bug1219928.html => editor/spellchecker/tests/test_bug1219928.html
rename : editor/composer/test/test_bug1365383.html => editor/spellchecker/tests/test_bug1365383.html
rename : editor/composer/test/test_bug338427.html => editor/spellchecker/tests/test_bug338427.html
rename : editor/composer/test/test_bug678842.html => editor/spellchecker/tests/test_bug678842.html
rename : editor/composer/test/test_bug697981.html => editor/spellchecker/tests/test_bug697981.html
rename : editor/composer/test/test_bug717433.html => editor/spellchecker/tests/test_bug717433.html
extra : rebase_source : 21c17f40d234670be1eefa680747c9085c843e94
2018-03-02 12:57:54 +09:00
Makoto Kato
6d4d7659bb Bug 1442500 - Part 2. Move some spellchecker source files in /editor/composer to /editor/spellchecker. r=masayuki
Per bug 1439813, some files in composer is for spellchecker, so we should move
it to /editor/spellchecker.

MozReview-Commit-ID: 6vlhC1TcZp5

--HG--
rename : editor/composer/EditorSpellCheck.cpp => editor/spellchecker/EditorSpellCheck.cpp
rename : editor/composer/EditorSpellCheck.h => editor/spellchecker/EditorSpellCheck.h
rename : editor/composer/nsComposeTxtSrvFilter.cpp => editor/spellchecker/nsComposeTxtSrvFilter.cpp
rename : editor/composer/nsComposeTxtSrvFilter.h => editor/spellchecker/nsComposeTxtSrvFilter.h
extra : rebase_source : b9c3fcf7e557a2ff4b58e81020fa7a9ec938d3af
2018-03-02 12:56:44 +09:00
Makoto Kato
43ea41434e Bug 1442500 - Part 1. Rename editor/txtsvc to editor/spellchecker. r=masayuki
txtsvc is ambiguous name, so we should use functional name instead.

XPIDL_MODULE still keeps 'txtsvc' because 'spellchecker' is already used by
extensions/spellchek/idl.  And all IDLs for editor may move to /editor since
most IDLs for editor is on /editor.

MozReview-Commit-ID: v9a5ENEs2M

--HG--
rename : editor/txtsvc/TextServicesDocument.cpp => editor/spellchecker/TextServicesDocument.cpp
rename : editor/txtsvc/TextServicesDocument.h => editor/spellchecker/TextServicesDocument.h
rename : editor/txtsvc/moz.build => editor/spellchecker/moz.build
rename : editor/txtsvc/nsFilteredContentIterator.cpp => editor/spellchecker/nsFilteredContentIterator.cpp
rename : editor/txtsvc/nsFilteredContentIterator.h => editor/spellchecker/nsFilteredContentIterator.h
rename : editor/txtsvc/nsIInlineSpellChecker.idl => editor/spellchecker/nsIInlineSpellChecker.idl
rename : editor/txtsvc/nsISpellChecker.h => editor/spellchecker/nsISpellChecker.h
rename : editor/txtsvc/nsITextServicesFilter.idl => editor/spellchecker/nsITextServicesFilter.idl
extra : rebase_source : 38ea55fe974614b7bb829b614f7de1ee649dbbb1
2018-03-02 12:55:26 +09:00
Emilio Cobos Álvarez
2988d4e66d Bug 1442207: Remove unneeded arguments to nsIMutationObserver. r=smaug
aDocument is always content->OwnerDoc().
aContainer is always content->GetParent().

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

MozReview-Commit-ID: 4xwPCOnhyIL
2018-03-01 22:45:17 +01:00
Sebastian Hengst
71f42f588a merge mozilla-central to autoland CLOSED TREE 2018-02-28 20:17:53 +02:00
Florian Quèze
f3ee8dd20b Bug 1433175 - more aggressive scripted patch to replace remaining Components.classes, Components.interfaces, Components.utils and Components.results uses with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:35 +01:00
Florian Quèze
6df7549a3e Bug 1433175 - semi-automated indent fix, r=Mossop. 2018-02-28 18:51:34 +01:00
Florian Quèze
c714053d73 Bug 1433175 - scripted patch to replace Components.classes[, Components.interfaces.nsI, Components.utils. and Components.results. with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:33 +01:00
Makoto Kato
75f1d82f9b Bug 1436285 - Part 2. Get a rid of nsIDOMNode version of GetNodeLocation, GetStartNodeAndOffset, GetEndNodeAndOffset and etc. r=masayuki
Remove unused methods...

MozReview-Commit-ID: 4A8924wsEq3

--HG--
extra : rebase_source : dc3cc6c263bdd213e7dd2fb2442ad1ff16662aaf
2018-02-28 11:33:16 +09:00
Makoto Kato
d89148b69b Bug 1436285 - Part 1. Don't use nsIDOMNode version of GetStartNodeAndOffset and GetEndNodeAndOffset. r=masayuki
To get a rid of some methods, I would like to replace nsIDOMNode usages with nsINode.

MozReview-Commit-ID: B0FVczayND0

--HG--
extra : rebase_source : ede058089332202ba0c05ddb61e0f119cbf52fcb
2018-02-28 11:32:28 +09:00
Emilio Cobos Álvarez
7dffe29d8f Bug 1432490: Make nsComputedDOMStyle::GetStyleContext / GetStyleContextNoFlush not take a presShell. r=bz
Everyone calls them with the shell of the current composed document, and this
allows the multi-presShell stuff to just be in UpdateCurrentStyleSources /
DoGetStyleContextNoFlush.

The only reason we need to use OwnerDoc()->GetShell() instead of the composed
doc in GetStyleContext / GetStyleContextNoFlush is Element::GetBindingURL, which
does expect to get the binding URL for stuff outside of the composed doc (and
changing that gave me a useless browser).

That's technically a behavior change on the cases that used to pass nullptr, but
I think all callers are fine with that. I could also just add a special function
for that particular case, it may be worth it.

MozReview-Commit-ID: 2XlnkgdgDCK
2018-02-25 02:23:59 +01:00
Emilio Cobos Álvarez
0f3f398be9 Bug 1439036: Fix some other miscellaneous issues with the caller. r=bz
While we're here...

MozReview-Commit-ID: 7B79vec0bYS

--HG--
extra : rebase_source : 1c7f78c913986e8d2856d62c3037da64b109d20e
2018-02-17 01:46:35 +01:00
Florian Quèze
682b1ec3b2 Bug 1440284 - change this.EXPORTED_SYMBOLS back to var EXPORTED_SYMBOLS in JS modules, r=mccr8. 2018-02-23 20:50:01 +01:00
Dorel Luca
6ad641c5c4 Merge mozilla-inboud to mozilla-central. a=merge 2018-02-22 11:59:54 +02:00
Makoto Kato
4bc57cc3ec Bug 1437087 - Call Disconnect on Unlink of cycle collector. r=masayuki 2018-02-21 21:08:17 -05:00
Makoto Kato
feb9be572d Bug 1439812 - Move noscript methods of nsIPlainTextEditor to TextEditor. r=masayuki
maxTextLength is unused from script, so I would like to move to TextEditor.
Also, there is no reason to keep setText on nsIPlainText.

MozReview-Commit-ID: CZ8pa9Pm8qt

--HG--
extra : rebase_source : ea58a20510b2211dcf440955ec8dc49d57337437
2018-02-21 13:21:57 +09:00
Adrian Wielgosik
2d4df58ad8 Bug 1439751 - Remove all members from nsIDOMHTMLInputElement. r=qdot
MozReview-Commit-ID: JVagEzvSONN

--HG--
extra : rebase_source : a7e1cf2e5ccc1925f3a11c7d935438ef6307c70c
2018-02-20 23:10:44 +01:00
Masayuki Nakano
cf83ee7bb4 Bug 1438157 - part 2: Remove unnecessary second argument of EventUtils.synthesizeKey() r=smaug
Note that this patch also replaces legacy VK_* with KEY_*, and replaces
synthesizeKey() for inputting some characters with sendString() because
it's better and clearer what it does and it sets shiftKey state properly.

MozReview-Commit-ID: De4enbjux3T

--HG--
extra : rebase_source : 2296b84bff8e22f01eeb48cd8614fac5db11136a
2018-02-15 04:15:39 +09:00
Chris Peterson
fe5cd3d5d9 Bug 1436263 - Part 3: Remove virtual from final virtual function declarations. r=froydnj
MozReview-Commit-ID: 8pjYjEvQF42

--HG--
extra : rebase_source : 5eb0bea2ef5f06a811b4f3daf57ce8720f12dd07
2018-02-08 21:22:43 -08:00
Chris Peterson
0129d900f3 Bug 1436263 - Part 2: Replace override final virtual function specifiers with just final. r=froydnj
MozReview-Commit-ID: 70gt5SUu4Dv

--HG--
extra : rebase_source : 71912c6bde22aaed01e70615a4ee794a36e70d0e
extra : source : 1c22d4c65d70b797ee3e963ec426c90e1f89b5e3
2018-02-05 22:50:00 -08:00
Hiroyuki Ikezoe
14075ea4f4 Bug 1438397 - Don't process RepaintSelection() if the presshell is being destroyed. r=masayuki
MozReview-Commit-ID: 4vihEDBw7BH

--HG--
extra : rebase_source : 1f9a89b543d4f41ab6cf22e840d4ea279f05aead
2018-02-15 11:21:32 +09:00
Masayuki Nakano
18912959bd Bug 1406726 - HTMLEditRules::WillInsertBreak() should reset mNewNode with caret position r=m_kato
HTMLEditRules::WillInsertBreak() started to use HTMLEditRules::MakeBasicBlock()
to wrap existing inline elements with default paragraph separator if inline
elements are children of editing host.  However,
HTMLEditRules::ApplyBlockStyle() called by HTMLEditRules::MakeBasicBlock() sets
mNewNode to last new block node.  So, if it wraps inline elements after caret
position, mNewNode becomes after expected caret position and
HTMLEditRules::AfterEditInner() will move caret into it.

This patch make HTMLEditRules::WillInsertBreak() reset mNewNode with
caret position after calling HTMLEditRules::MakeBasicBlock().

Additionally, this patch fixes a bug of HTMLEditor::IsVisibleBRElement().
That is, it uses only editable nodes to check if given <br> element is
visible.  However, editable state is not related to this check.  If <br>
element is followed by non-editable inline node (except invisible data
nodes), it always visible.  This bug caused getting wrong nodes with
HTMLEditRules::GetNodesFromSelection() which is used by
HTMLEditRules::MakeBasicBlock().  Therefore, this patch also adds lots of
EditorBase::Get(Next|Previous)ElementOrText*() and
HTMLEditor::Get(Next|Previous)HTMLElementOrText*() to ignore only invisible
data nodes.

Note that even with this fix, the range of nodes computed by
HTMLEditRules::GetNodesFromSelection() is still odd if only non-editable
elements follow a <br> node which is first <br> element after the caret
position.  However, what is expected by the execCommand spec is unclear.
So, automated test added by this patch checks current inconsistent behavior
for now.

MozReview-Commit-ID: 2m52StwoEEH

--HG--
extra : rebase_source : 6b9b2338e35c4d2e89a405fd8e1ffc7b0873ca1e
2018-02-13 19:01:42 +09:00
Masayuki Nakano
8917ac460f Bug 1436926 - part 2: Remove unnecessary KeyboardEvent.code specification of callers of EventUtils.synthesizeKey() r=smaug
Now, callers of EventUtils.synthesizeKey() don't need to specify
KeyboardEvent.code value anymore if they assume that active keyboard layout
is US keyboard layout.

Note that this patch changes the meaning of only test_bug551434.html.
Some callers in it don't match the key value and code value but that looks
like that they don't checking such odd keyboard events.  So, they must be
bug of the test.

MozReview-Commit-ID: Itxo7yZ9rkK

--HG--
extra : rebase_source : 856ef3715c924ca16e993ea57d92d1243b5cc6be
2018-02-09 19:17:26 +09:00
Boris Zbarsky
9bdcffc985 Bug 1436902 part 3. Replace usage of NS_IMPL_ISUPPORTS_INHERITED0 with NS_INLINE_DECL_REFCOUNTING_INHERITED when possible. r=mccr8
The change to RootAccessible.cpp fixes an obvious bug introduced in bug 741707.

The visibility changes in gfx/thebes are because NS_DECL_ISUPPORTS has a
trailing "public:" that those classes were relying on to have public
constructors.

MozReview-Commit-ID: IeB8KIJCGhU
2018-02-12 15:44:40 -05:00
Masayuki Nakano
c548fd9ae1 Bug 1436663 - EditorBase::JoinNodeDeep() should set result after actually joining the nodes r=m_kato
EditorBase::JoinNodeDeep() returns a DOM point which was start of right node.
Currently, this is set before actually joining the nodes.  Therefore, we see
warnings since right node which becomes joined node may have less children
than left node.

This patch also makes the NS_WARNING_ASSERTION to NS_ASSERTION since no tests
hit this.  So, we can use it to detect regressions.

MozReview-Commit-ID: 3RmRP588AkF

--HG--
extra : rebase_source : 2cab458ffac566c81eb8d3f47e755ffacb1553d2
2018-02-08 16:17:24 +09:00
Sebastian Hengst
d1700a0b7a merge mozilla-central to autoland. CLOSED TREE 2018-02-10 00:34:30 +02:00
Tim Nguyen
79e5dc6167 Bug 1429573 - Use input[type=number] in textbox[type=number] implementation. r=Paolo,surkov
* The number is no longer selected on number input focus

MozReview-Commit-ID: AmR5c6YKTCP

--HG--
extra : rebase_source : fdaab23fca57f361c9185191d9c30e047375cbe8
2018-02-09 21:54:36 +00:00
Boris Zbarsky
034e47c66b Bug 1436508 part 12. Remove nsIDOMKeyEvent. r=masayuki
MozReview-Commit-ID: 8giqG5iHiIf
2018-02-09 11:17:10 -05:00
Boris Zbarsky
fce30e834b Bug 1436508 part 10. Remove use of nsIDOMKeyEvent in JS. r=masayuki
MozReview-Commit-ID: GGciORX62Yh
2018-02-09 11:17:09 -05:00
arthur.iakab
f58e902071 Backed out 2 changesets (bug 1429573) for failing reftest on reftest/tests/editor/reftests/xul/number-3.xul on a CLOSED TREE
Backed out changeset 75364898f5f6 (bug 1429573)
Backed out changeset fe69b415f45b (bug 1429573)
2018-02-09 23:27:59 +02:00
Tim Nguyen
d2bb22650d Bug 1429573 - Use input[type=number] in textbox[type=number] implementation. r=Paolo,surkov
* The number is no longer selected on number input focus

MozReview-Commit-ID: EoXNqhXwK95

--HG--
extra : rebase_source : b5a522e11796ec42c87019f6c3955e6c40eb21d0
2018-02-09 19:23:56 +00:00
Masayuki Nakano
1165b53e10 Bug 1436295 - HTMLEditRules::WillInsertBreak() should cancel resetting EditorDOMPoint when HTMLEditRules::ReturnInParagraph() splits DOM node around the point r=m_kato
This patch only fixes warning, not changing actual behavior of editor.

HTMLEditRules::ReturnInParagraph() splits paragraph *around* given point.
Therefore, from point of view of caller, offset of setting point may be
invalid after HTMLEditRules::ReturnInParagraph() handled the edit action.
In this case, invalidating stored child of the point may cause warning
since offset may be larger than length of its container.

So, if HTMLEditRules::ReturnInParagraph() handles the edit action,
the caller, HTMLEditRules::WillInsertBreak(), should cancel invalidating
the stored child for avoiding unnecessary warning.

MozReview-Commit-ID: DKJlr0Awwlo

--HG--
extra : rebase_source : 8fbefff3b46e55daf8db6342f00de904315d7fcc
2018-02-07 19:04:52 +09:00
shindli
0fcb667b73 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-02-08 12:13:08 +02:00
Makoto Kato
6e437ccf06 Bug 1436272 - Move noscript methods in nsIEditor to EditorBase. r=masayuki
Since We can use EditorBase/TextEditor/HTMLEditor directly,  we can
movei noscript methods in nsIEditor to each class.

Also, Init is unnecessary to use nsIDOMDocument and nsIContent since method
isn't in IDL.  And some methods are unused now.

MozReview-Commit-ID: D3B6oSlcT0L

--HG--
extra : rebase_source : 6cab2e6e7b4ba8cfb56d8320be24ca4afcbe55fb
extra : amend_source : 1d8c59086a9158a49dd270b64ecf8341ed4002ce
2018-02-07 15:28:04 +09:00
Masayuki Nakano
aa44284d56 Bug 1436216 - EditorBase::CreateElement() should call RangeUpdater::SelAdjCreateNode() with point of new element r=m_kato
Before bug 1425091, we called RangeUpdater::SelAdjCreateNode() with point of
new node in EditorBase::CreateElement().  However, it was accidentally changed
to point *in* new element.  Therefore, setting such DOM point causes warnings
in debug build and call of RangeUpdater::SelAdjCreateNode() must be failed
since the point stores wrong container node.

Additionally, this patch stops using another EditorRawDOMPoint instance which
is just redundant and renames |ret| to |newElement| for making its meaning
clearer.

MozReview-Commit-ID: Gc0YgaNLYcx

--HG--
extra : rebase_source : c2fbe2669ca8a5993e26b357f53dc38341fd6bf6
2018-02-07 16:27:55 +09:00
Ciure Andrei
0b674adee4 Backed out changeset 86581d5ccbbb (bug 1436272) for failing /builds/worker/workspace/build/src/editor/libeditor/EditorBase.cpp a=backout on a CLOSED TREE 2018-02-08 04:54:47 +02:00
Makoto Kato
b845e3128e Bug 1436272 - Move noscript methods in nsIEditor to EditorBase. r=masayuki
Since We can use EditorBase/TextEditor/HTMLEditor directly,  we can
movei noscript methods in nsIEditor to each class.

Also, Init is unnecessary to use nsIDOMDocument and nsIContent since method
isn't in IDL.  And some methods are unused now.

MozReview-Commit-ID: D3B6oSlcT0L

--HG--
extra : rebase_source : b89698f4ab56fdd97a4cd8c515a8b33f6a74a7af
2018-02-07 15:28:04 +09:00
Andrew McCreight
5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -08:00
Narcis Beleuzu
84cea84b12 Merge inbound to mozilla-central. a=merge 2018-02-06 11:54:42 +02:00
Makoto Kato
2768bda89d Bug 1435149 - Part 2. Use scope resolution operator for CSSEditUtils's caller. r=masayuki
Part 1. changes to static method, so caller should use scope operator instead
of mCSSEditUtils member.

MozReview-Commit-ID: GlCfyjlQgr0

--HG--
extra : rebase_source : f558fc833d5f3cb193a543fc1b05cdeb58f60ec1
extra : histedit_source : 741529204d2dddef0f2dab9e18055186155eca8f
2018-02-02 18:42:25 +09:00
Makoto Kato
55fce07048 Bug 1435149 - Part 1. Change some methods to static or const method in CSSEditUtils. r=masayuki
Some methods in CSSEditUtils can change to static methods or const method.
So we should change to it to avoid unnecessary HTMLEditor check.

MozReview-Commit-ID: IwAbeNsgqSr

--HG--
extra : rebase_source : 649f198a59e06504a9e54cb64ab942ce04854ad2
extra : histedit_source : f4506dbdf8f9ccb614aca8f84aff1d572f0ce37e
2018-02-06 12:57:37 +09:00
Masayuki Nakano
283dfdf558 Bug 1434969 - EditorDOMPointBase::RewindOffset() shouldn't treat it as error if offset is same as length of the container r=m_kato
EditorDOMPointBase::RewindOffset() treats it as error when offset is
same as length of container.  However, this is wrong because offset can
be same as length of its container since it means after the last child
or last character.  So, if an instance points end of a container node,
Rewind() always fails unexpectedly.

MozReview-Commit-ID: A9bvsxETDoo

--HG--
extra : rebase_source : f05994f2924adaa29711da3916f431688eaa79b7
2018-02-04 01:00:44 +09:00
Eric Rahm
d563f447dc Bug 1434789 - Part 1: Remove unnecessary nsSubstringTuple.h includes. r=froydnj
--HG--
extra : rebase_source : 66b1950fe3cad1c04c901c8c39d135802ae3ccf7
2018-01-31 16:47:43 -08:00
Makoto Kato
6194942f78 Bug 1433849 - Remove unused methods in nsIHTMLAbsPosEditor. r=masayuki
The following methods are unused in m-c, c-c and bluegriffon from JavaScript.

- selectionContainerAbsolutelyPositioned
- absolutelyPositionedSelectionContainer
- absolutePositionSelection
- relativeChangeZIndex
- absolutelyPositionElement
- setElementPosition
- getElementZIndex
- setElementZIndex
- relativeChangeElementZIndex
- showGrabberOnElement
- hideGrabber

So let't remove these method from IDL.

MozReview-Commit-ID: JASJmB65wR2

--HG--
extra : rebase_source : a7c3cdf0ea96ec7b81bed7573c57d6040033d01b
2018-02-01 10:55:25 +09:00
Florian Quèze
2b1c8dccb6 Bug 1339461 - script-generated patch to convert foo.indexOf(...) == -1 to foo.includes(), r=Mossop. 2018-02-01 20:45:22 +01:00
Boris Zbarsky
7a9f022f1a Bug 1434819 part 7. Remove the SHOW_* constants from nsIDOMNodeFilter. r=qdot
MozReview-Commit-ID: 7E2KZkLfbSI
2018-02-01 14:26:12 -05:00
Boris Zbarsky
59795295d1 Bug 1434819 part 6. Get rid of NodeFilterHolder. r=qdot
Now that TreeWalker and NodeIterator only use webidl APIs, they always have a
NodeFilter, not nsIDOMNodeFilter.

MozReview-Commit-ID: 5pzn9V3Kxzy
2018-02-01 14:26:12 -05:00
Boris Zbarsky
72cdddcc61 Bug 1434686 part 3. Use IgnoreErrors() outside of dom/. r=mystor
I left some IgnoredErrorResults for now where people warn on failure.  We could
consider adding a WarnOnError() thing or something.

MozReview-Commit-ID: L5ttZ9CGKg0
2018-02-01 14:21:14 -05:00
Cameron McCormack
d02e54b79b Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn
MozReview-Commit-ID: CIHyPdF7Exl

--HG--
extra : source : 78a2fc781eead47af3923efcde58569c5d882ab1
2018-02-01 15:04:04 +11:00
Cameron McCormack
cc7db5c40c Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn
MozReview-Commit-ID: 1FZ9VzjcPzN

--HG--
extra : source : de22d220635f8c059834b76f769d5215ab1a8b5b
2018-02-01 15:04:04 +11:00
Boris Zbarsky
0935ca9973 Bug 1434318 part 12. Remove nsIDOMDocument's contentType attribute. r=mystor
MozReview-Commit-ID: DAXrxIxiac4
2018-01-31 15:18:11 -05:00
Boris Zbarsky
a514705917 Bug 1434318 part 7. Remove nsIDOMDocument::GetElementsBy* methods. r=mystor
MozReview-Commit-ID: CnfelWtz0mT
2018-01-31 15:18:10 -05:00
Boris Zbarsky
c62e23596a Bug 1434318 part 2. Stop using nsIContentViewer::GetDOMDocument in C++. r=mystor
MozReview-Commit-ID: FoMoVgCngGR
2018-01-31 15:18:09 -05:00
Boris Zbarsky
4c01bdc27f Bug 1428610 part 7. Make the nsICSSDeclaration length API nicer. r=emilio
MozReview-Commit-ID: 2gs8npBJFJY
2018-01-30 14:48:27 -05:00
Kris Maglione
918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Makoto Kato
76358fc558 Bug 1434171 - Clean up CheckSelectionStateForAnonymousButtons. r=masayuki
Since CheckSelectionStateForAnonymousButtons is called from selection listener,
We should reduce some QI for this.

MozReview-Commit-ID: 17hhupmnnV5

--HG--
extra : rebase_source : 81ed7f844033f75e5fcf1d8983a45804f0b9544f
2018-01-30 13:42:52 +09:00
Boris Zbarsky
afe966f041 Bug 1418085 part 1. Stop using nsIDOMHTMLElement in editor code. r=mystor
MozReview-Commit-ID: 6J0wWzMCfWP
2018-01-30 00:25:36 -05:00
Boris Zbarsky
311e6cf3f4 Bug 1418076 part 5. Get rid of nsIDOMHTMLDocument's designMode attribute. r=mystor
MozReview-Commit-ID: 8CB3OZBHa9q
2018-01-26 01:00:49 -05:00
Cosmin Sabou
9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Boris Zbarsky
8c61d57bca Bug 1276438 part 6. Stop using nsIDOMHTMLDocument::GetBody. r=mystor
MozReview-Commit-ID: EcDTnByuZsm
2018-01-26 00:53:35 -05:00
Boris Zbarsky
fba82e4ebc Bug 1432977 part 3. Remove nsIDOMHTMLElement's offsetWidth/Height attributes. r=mccr8
MozReview-Commit-ID: EoSwBkeGj60
2018-01-29 23:40:11 -05:00
Boris Zbarsky
548d16d0b1 Bug 1432977 part 2. Remove nsIDOMHTMLElement's spellcheck attribute. r=mccr8
MozReview-Commit-ID: B07hMx3LAed
2018-01-29 23:37:57 -05:00
Boris Zbarsky
e565b1fe1b Bug 1432944 part 11. Remove nsIDOMElement::GetAttribute. r=mccr8
MozReview-Commit-ID: 2f1vFvRdCPG
2018-01-29 23:28:00 -05:00
Boris Zbarsky
151487a675 Bug 1432944 part 10. Remove nsIDOMElement::SetAttribute. r=mccr8
MozReview-Commit-ID: 6eIdX8iA5Rg
2018-01-29 23:28:00 -05:00
Boris Zbarsky
b61aa11d01 Bug 1432944 part 8. Remove usage of nsIDOMElement::HasAttribute in editor code. r=m_kato
MozReview-Commit-ID: 926Dzqv7Oj4
2018-01-29 23:27:59 -05:00
Boris Zbarsky
a6f9dbf34e Bug 1432944 part 6. Remove the nsIDOMNode overloads of HTMLEditUtils::IsNamedAnchor and HTMLEditUtils::IsTable. r=m_kato
MozReview-Commit-ID: 4KlppKdzJGy
2018-01-29 23:27:59 -05:00
Boris Zbarsky
423c0886df Bug 1432944 part 5. Remove the now-unused nsIDOMNode overload of HTMLEditUtils::IsLink. r=m_kato
MozReview-Commit-ID: CDnYK194JB9
2018-01-29 23:27:59 -05:00
Boris Zbarsky
7bfc306103 Bug 1432944 part 4. Work with Element, not nsIDOMElement, inside HTMLEditor::GetSelectedElement. r=m_kato
MozReview-Commit-ID: 3F1rbPMgkAR
2018-01-29 23:27:59 -05:00
Boris Zbarsky
fbb40001ca Bug 1432944 part 3. Take an early return from HTMLEditor::GetSelectedElement when we can. r=m_kato
MozReview-Commit-ID: EAEzpom7oXo
2018-01-29 23:27:59 -05:00
Boris Zbarsky
1fa8ecc716 Bug 1432944 part 2. Make nsIHTMLEditor.getSelectedElement return nsISupports. r=m_kato
The only C++ caller immediately QIs the result anyway, and the exact type
returned doesn't matter for JS callers because the return values are DOM
objects.  This makes it simpler to rejigger the internals to work with nsINode
and Element and whatnot.

MozReview-Commit-ID: 863IDGECqYY
2018-01-29 23:27:59 -05:00
Boris Zbarsky
7bb421fe3b Bug 1432944 part 1. Stop returning NS_EDITOR_ELEMENT_NOT_FOUND from nsIHTMLEditor::GetSelectedElement. r=m_kato
The only C++ caller doesn't care, and JS callers can't tell that a non-NS_OK success code was returned anyway.

MozReview-Commit-ID: FNhQYR0a9ur
2018-01-29 23:27:58 -05:00
Boris Zbarsky
f60fd673d6 Bug 1432186 part 19. Remove the nsIDOMNode::*_NODE constants. r=mccr8
MozReview-Commit-ID: KvKjeKIOB9K
2018-01-29 23:10:53 -05:00
Boris Zbarsky
4d88c28e4d Bug 1432186 part 17. Remove nsIDOMNode's parentNode attribute. r=mccr8
MozReview-Commit-ID: 4xzDwwEqnvE
2018-01-29 23:10:52 -05:00
Boris Zbarsky
37aaea3c1f Bug 1432186 part 16. Remove nsIDOMNode's ownerDocument attribute. r=mccr8
MozReview-Commit-ID: JqfAFxPBz41
2018-01-29 23:10:52 -05:00
Boris Zbarsky
9525cabcc3 Bug 1432186 part 15. Remove nsIDOMNode::HasChildNodes. r=mccr8
MozReview-Commit-ID: GFc2sv4E7b2
2018-01-29 23:10:51 -05:00
Boris Zbarsky
323cec654b Bug 1432186 part 13. Remove nsIDOMNode's nextSibling attribute. r=mccr8
MozReview-Commit-ID: DTaivhMORXr
2018-01-29 23:10:51 -05:00
Boris Zbarsky
97302665b4 Bug 1432186 part 12. Remove nsIDOMNode's previousSibling attribute. r=mccr8
MozReview-Commit-ID: 7UJFaxEnT9Q
2018-01-29 23:10:51 -05:00
Boris Zbarsky
e2ce75877d Bug 1432186 part 11. Remove nsIDOMNode's firstChild attribute. r=mccr8
MozReview-Commit-ID: 5jCdAmSuPx8
2018-01-29 23:10:51 -05:00
Boris Zbarsky
96697d35fe Bug 1432186 part 10. Remove nsIDOMNode's lastChild attribute. r=mccr8
MozReview-Commit-ID: FhJs1MXAyeO
2018-01-29 23:10:51 -05:00
Boris Zbarsky
eb9faa9b79 Bug 1432186 part 6. Remove nsIDOMNode::RemoveChild. r=mccr8
MozReview-Commit-ID: 9ZbIEIRtYPL
2018-01-29 23:10:50 -05:00
Boris Zbarsky
abfab07da3 Bug 1432186 part 5. Remove nsIDOMNode's nodeType attribute. r=mccr8
MozReview-Commit-ID: LKsBgKcqtBS
2018-01-29 23:10:50 -05:00
Boris Zbarsky
3b6d43f65c Bug 1432186 part 4. Remove nsIDOMNode's nodeValue attribute. r=mccr8
MozReview-Commit-ID: Aqt4NDjcdKW
2018-01-29 23:10:50 -05:00
Boris Zbarsky
c646473558 Bug 1432186 part 3. Remove nsIDOMNode's nodeName attribute. r=mccr8
MozReview-Commit-ID: Jg0Tuvdi6uX
2018-01-29 23:10:50 -05:00
Boris Zbarsky
e9880ecc58 Bug 1432186 part 2. Clean up the string handling in HTMLURIRefObject::GetNextURI. r=mccr8
MozReview-Commit-ID: DB3pSrA9ffy
2018-01-29 23:10:50 -05:00
Kris Maglione
6476f95b13 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Brindusan Cristian
af8879d1eb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione
c276bb9375 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Masayuki Nakano
4b7e512db0 Bug 1433345 - part 4: Make EditorBase derived from nsISelectionListener and notify its owning classes of selection change r=m_kato
This patch makes EditorBase derived from nsISelectionListener.  Then, we can
make IMEContentObserver, TextInputListener, ComposerCommandsUpdater,
TypeInState not derived from nsISelectionListener since EditorBase or
HTMLEditor can notify them of selection change directly.  Additionally,
ResizerSelectionListener is not necessary anymore since it just implements
nsISelectionListener and calls only a method of HTMLEditor.  So, HTMLEditor
can call it directly.

Note that the order of selection listeners may be different.  However,
according to what each selection listener does, changing the order isn't
problem.

MozReview-Commit-ID: 1JXZxQcS0tP

--HG--
extra : rebase_source : c2ebe622a74001ad4e421da492dcdab8e6fe1649
2018-01-26 17:25:45 +09:00
Masayuki Nakano
1ef303c32e Bug 1433345 - part 3: Make HTMLEditor store ResizerSelectionListener directly r=m_kato
This patch makes HTMLEditor store ResizerSelectionListener directly and
make it cycle collectable.  However, in the following patch, this class will
be removed completely because it doesn't necessary if HTMLEditor becomes a
selection listener.

MozReview-Commit-ID: 2iXlTcZdzvj

--HG--
extra : rebase_source : 893a3bbf290eb1752a701d6d8ac284a1630a6fbe
2018-01-26 15:14:04 +09:00
Masayuki Nakano
905d027c8f Bug 1433345 - part 2: Make HTMLEditor store ComposerCommandsUpdater directly r=m_kato
For making ComposerCommandsUpdater not derived from nsISelectionListener,
HTMLEditor needs to store it directly.

This patch also makes ComposerCommandsUpdater cycle collectable because it
stores a strong pointer and HTMLEditor also needs to store it with RefPtr.
Therefore, ComposerCommandsUpdater becomes unnecessary to use nsWeakPtr.

MozReview-Commit-ID: 2WZnLdq15FK

--HG--
extra : rebase_source : 8ee4968e1a63fe88a8276b1f8ce8d145fb9b31ae
2018-01-26 14:38:05 +09:00
Masayuki Nakano
5436129851 Bug 1433345 - part 1: Expose nsComposerCommandsUpdater with renaming it to mozilla::ComposerCOmmandsUpdater r=m_kato
For making HTMLEditor stores it directly, we should expose
nsComposerCommandsUpdater first.  Then, it should be in mozilla namespace.

MozReview-Commit-ID: 8Vhum4Q3WY

--HG--
rename : editor/composer/nsComposerCommandsUpdater.cpp => editor/composer/ComposerCommandsUpdater.cpp
rename : editor/composer/nsComposerCommandsUpdater.h => editor/composer/ComposerCommandsUpdater.h
extra : rebase_source : 3056eeb4aa3dd3426246b74be1e1e18a93a7c33d
2018-01-26 14:06:29 +09:00
Masayuki Nakano
e43e597a9e Bug 1433101 - part 2: Treat Enter and Shift+Enter as printable key r=smaug
Chromium dispatches a keypress event when pressing Enter or Shift+Enter.
Actually, when user press them in <pre> element of HTML editor, ツ・n is inserted.
It makes sense to treat the key combinations as inputting text.

MozReview-Commit-ID: Hvx87MZtZkn

--HG--
extra : rebase_source : 196b63843ebcb6e4b398f6b21a4f5f1d020b8db3
2018-01-25 23:59:20 +09:00
Masayuki Nakano
082c64aa0c Bug 1433101 - part 1: Add new pref which disables keypress event for non-printable keys only for the default event group in web content r=smaug
UI Events declares that keypress event should be fired when the keypress event
causes some text input.  However, we're keeping our traditional behavior for
historical reasons because our internal event handlers (including event
handlers of Thunderbird) handles keypress events for any keys.  Therefore,
for minimizing the side effect, we should stop kicking keypress event handlers
in the default event group in web content.

This patch adds new pref for enabling the standard behavior in web content.

Additionally, creates WidgetKeyboardEvent::IsInputtingText() for sharing the
check logic between TextEventDispatcher and TextEditor/HTMLEditor.

MozReview-Commit-ID: 3rtXdLBPeVC

--HG--
extra : rebase_source : 2fc3c9a09840d0d03800c9a42bb83ca76a8db2d5
2018-01-25 23:27:07 +09:00
Masatoshi Kimura
f576a03e65 Bug 1433100 - Constify the parameter of HTMLEditor::DoInlineTableEditingAction. r=m_kato
--HG--
extra : source : 9042789502045102cf46b19d0382b0d4c0364377
2018-01-25 22:16:32 +09:00
Makoto Kato
ded973c413 Bug 1432715 - Don't use NS_IMETHOD when method doesn't override. r=masayuki
Some methods in HTMLEditor uses NS_IMETHOD that doesn't override.  So we should
replace with nsresult to avoid virtual method.

MozReview-Commit-ID: 7LillLQNhlg

--HG--
extra : rebase_source : 02655cdcf9350caae1fd12dfeb038f82f74aa0f0
2018-01-25 13:31:01 +09:00
Masayuki Nakano
298150d827 Bug 1432528 - part 4: Remove nsIEditorObserver::BeforeEditAction() and nsIEditorObserver::CancelEditAction() because nobody implements them r=m_kato
Now, nobody implements nsIEditorObserver::BeforeEditAction() and
nsIEditorObserver::CancelEditAction().  So, we can remove them.

MozReview-Commit-ID: DYppLayC5oT

--HG--
extra : rebase_source : 196e042234c65a43947a1aa90898901389a3a53b
2018-01-24 14:31:29 +09:00
Masayuki Nakano
7dab388aae Bug 1432528 - part 3: Make EditorBase store IMEContentObserver directly and make it not derived from nsIEditorObserver r=m_kato
Similar to TextInputListener, EditorBase should store IMEContentObserver
directly instead of via nsIEditorObserver.  Then,
EditorBase::NotifyEditorObservers() can call each method directly.
Additionally, we can make IMEContentObserver not derived from nsIEditorObserver.

MozReview-Commit-ID: cNKWJe5eUC

--HG--
extra : rebase_source : 4ed3b3b3180b8ee4a7c514ce1f89eba4dad64fbe
2018-01-24 14:10:18 +09:00
Masayuki Nakano
74aaf9525b Bug 1432528 - part 2: Make EditorBase treat TextInputListener directly and make TextInputListener not derived from nsIEditorObserver r=m_kato
Now, EditorBase can store TextInputListener directly instead of as
nsIEditorObserver.  And then, EditorBase can call its EditAction() method
directly.  Therefore, we can make TextInputListener not derived from
nsIEditorObserver.

MozReview-Commit-ID: 4qPnnvReLKy

--HG--
extra : rebase_source : cde47e245c9856abf696dbaf8e26d8e4d6d98d42
2018-01-24 12:50:01 +09:00
Masayuki Nakano
dc245c4fee Bug 1422234 - part 1: HTMLEditRules::ReturnInParagraph() should adjust split point if caret position is positioned at edge of anchor element r=m_kato
When Enter key is pressed at start or end of <a href="foo"> element, we
shouldn't split it (in other words, we shouldn't create empty <a href="foo">
element in new paragraph) because users must not want to keep editing *same*
link in new paragraph in most cases.

This patch adjusts HTMLEditRules::ReturnInParagraph() selection start point
locally when it gets selection.  If caret is at start of an <a href="foo">
element, moves caret to before the element.  If caret is at end of an
<a href="foo"> element, moves to after the element.

MozReview-Commit-ID: 3L3eDzc6Dk

--HG--
extra : rebase_source : dfb22486d2709e84ef7ec1eee3a9bfdef11cbe99
2018-01-23 11:14:37 +09:00
Makoto Kato
70a0912794 Bug 1425547 - Remove unused methods from nsIHTMLInlineTableEditor. r=masayuki
inlineTableEditingEnabled and refreshInlineTableEditingUI are used by
bluegriffon, but other methods aren't used by m-c, c-c and bluegriffon.
So I would like to remove these methods.  Then we can clean up
DoInlineTableEditingAction.

MozReview-Commit-ID: 3R0bJDU5vqv

--HG--
extra : rebase_source : 74c7615613bba65326069929cb53c3ea48f2e9a4
extra : amend_source : a1ac9af3de50daa0cbfd98e2790afa402d9932ef
2018-01-19 16:41:41 +09:00
Dorel Luca
30b5be6d16 Merge mozilla-inbound to mozilla-central r=merge a=merge 2018-01-23 19:46:03 +02:00
Andrea Marchesini
b8bb98af8c Bug 1430997 - Rename nsINode::IndexOf to nsINode::ComputeIndexOf, r=catalinb 2018-01-23 14:30:18 +01:00
Masayuki Nakano
92d5c4cdd8 Bug 1430785 - Make mozInlineSpellChecker not derived from nsIEditActionListener r=m_kato
mozInlineSpellChecker listens to only DidSplitNode() and DidJoinNodes().
So, EditorBase should call them directly rather than treating it as an
nsIEditActionListener since its runtime cost becomes really cheaper.

Different from EditorSpellCheck, nobody creates instance of
nsIInlineSpellChecker.  So, we can now stop supporting createInstance() for it
in chrome JS and should do this since EditorBase cannot support multiple
mozInlineSpellChecker instances without nsIEditActionListener interface.
Therefore, this patch removes the entry from factory.

MozReview-Commit-ID: W1CLdsJaaB

--HG--
extra : rebase_source : 2319999e4b1fc8978386c49236d5d24d78d86047
2018-01-17 14:05:06 +09:00
Masayuki Nakano
2020349542 Bug 1430982 - part 10: Make EditorBase store TextServicesDocument for its mInlineSpellChecker for avoiding to run for loops to call nsIEditActionListener methods r=m_kato
Currently, first edit action listener is always TextServicesDocument for
EditorBase::mInlineSpellChecker if spell check is enabled and it requires
only DidDeleteNode() and DidJoinNodes().  So, in most cases, EditorBase
should call only them to avoid running redundant for loops for
nsIEditActionListener methods.

This patch makes that EditorBase::AddEditActionListener() and
RemoveEditActionListener() check whether coming nsIEditActionListener is
TextServicesDocument for mInlineSpellChecker.  If so, EditorBase should
store it as reference to TextServicesDocument.  And when edit action occurs,
its DidDeleteNode() and DidJoinNodes() should be called directly.

Unfortunately, this patch makes TextServiceDocument's maintaining rules
complicated.  However, it must be really rare case to add new edit action
listener because it's really old component.

Note that EditorSpellCheck may be created multiple instances for an editor
from chrome JS.  Therefore, we need to keep TextServicesDocument being
derived from nsIEditActionListener because in such case, TextServicesDocument
for other EditorSpellCheck instances should be supported via
nsIEditActionListener even though such case makes EditorBase slower.

MozReview-Commit-ID: KtlXsBCOzKL

--HG--
extra : rebase_source : 6827ed09a028f2049fd7afba2f5116d092bd14e5
2018-01-18 23:46:03 +09:00
Masayuki Nakano
0c82cf40da Bug 1430982 - part 9: Create accessors for each member of mozSpellChecker, EditorSpellCheck, mozInlineSpellChecker r=m_kato
mozSpellChecker stores TextServicesDocument, EditorSpellCheck stores
mozSpellChecker and mozInlineSpellChecker stores EditorSpellCheck.
So, they should have accessors for their member.  Then, EditorBase can
access all of them.

MozReview-Commit-ID: Igphm8nRqve

--HG--
extra : rebase_source : 0c70bf3e23f16ea6a97b49901f4b1c87e7da6d37
2018-01-18 21:38:50 +09:00
Masayuki Nakano
04e3a3adfc Bug 1430982 - part 8: Make EditorBase store inline spell checker as mozInlineSpellChecker rather than nsIInlineSpellChecker r=m_kato
EditorBase::mInlineSpellChecker is always an instance of mozInlineSpellChecker.
Fortunately, it's easy to expose mozInlineSpellChecker.h.  So, making EditorBase
store it as mozInlineSpellChecker directly, EditorBase can access any of
mozInlineSpellChecker, EditorSpellCheck, mozSpellChecker and
TextServicesDocument with new accessors created by following patch.

MozReview-Commit-ID: 2oyS5tPeQcg

--HG--
extra : rebase_source : a9ce2e4dbceff7ca800d34d60d56eba184298677
2018-01-17 00:52:37 +09:00
Masayuki Nakano
5fe683df20 Bug 1430982 - part 6: Rename nsEditorSpellCheck to mozilla::EditorSpellCheck and expose its header r=m_kato
For making mozInlineSpellChecker stores nsEditorSpellCheck directly, we need
to expose its header file.  For doing that this patch renames the class to
mozilla::EditorSpellCheck and expose it as "mozilla/EditorSpellCheck.h".

MozReview-Commit-ID: 5H66Y2vVshu

--HG--
rename : editor/composer/nsEditorSpellCheck.cpp => editor/composer/EditorSpellCheck.cpp
rename : editor/composer/nsEditorSpellCheck.h => editor/composer/EditorSpellCheck.h
extra : rebase_source : 7940aa136df312cd43bf592df1e71d2ac6c5dec8
2018-01-18 21:01:13 +09:00
Masayuki Nakano
e0d185984f Bug 1430982 - part 5: Make nsEditorSpellCheck store mozSpellChecker directly rather than nsISpellChecker r=m_kato
nsEditorSpellCheck::mSpellChecker is always mozSpellChecker because it's
created only by nsEditorSpellCheck.  Additionally, mozSpellChecker.h is
already exposed.  So, nsEditorSpellCheck can store it as mozSpellChecker
directly.

MozReview-Commit-ID: 2vyDe4plncM

--HG--
extra : rebase_source : 847b2f384163450ab44b94bc12ee489633a849b6
2018-01-18 20:06:49 +09:00
Masayuki Nakano
60d2ed05ca Bug 1430982 - part 4: Get rid of nsITextServicesDocument because it used by nobody r=m_kato
nsITextServicesDocument isn't used by anybody now.  So, we can get rid of it.
Additionally, nsITextService and nsTextServicesFactory are not also used by
anybody.  Therefore, this patch removes all of them.

MozReview-Commit-ID: KSbMdm7QPKF

--HG--
extra : rebase_source : 724a5f48ad49b4231bacf7fba32c6a35d90121d0
2018-01-18 18:43:57 +09:00
Masayuki Nakano
21c3b9e2db Bug 1430982 - part 3: Make mozSpellChecker and nsEditorSpellChecker treat TextServicesDocument directly rather than nsITextServicesDocument r=m_kato
Now, TextServicesDocument can be treated by anybody.  So, let's make
mozSpellChecker and nsEditorSpellChecker treat it directly instead of
nsITextServicesDocument.

MozReview-Commit-ID: 2tMy6y3i17b

--HG--
extra : rebase_source : 2e6c79355a5e0a7044fbea989ba414a7bf1a7d8d
2018-01-18 17:32:23 +09:00
Masayuki Nakano
fa1d8d7c3f Bug 1430982 - part 2: Rename nsTextServicesDocument to mozilla::TextServicesDocument and expose its header r=m_kato
For making nsTextServicesDocument accessible from anywhere directly, we need to
expose its header.  Then, it should be in mozilla namespace.

This patch renames nsTextServicesDocument to mozilla::TextServicesDocument
and expose the header file as "mozilla/TextServicesDocument.h".

MozReview-Commit-ID: 9PmP73PXSJu

--HG--
rename : editor/txtsvc/nsTextServicesDocument.cpp => editor/txtsvc/TextServicesDocument.cpp
rename : editor/txtsvc/nsTextServicesDocument.h => editor/txtsvc/TextServicesDocument.h
extra : rebase_source : a12081434d0bc002e3675178486cc7f8eaaa3256
2018-01-18 16:57:01 +09:00
Masayuki Nakano
88c945974e Bug 1430982 - part 1: Make nsTextServicesDocument store editor with RefPtr<TextEditor> rather than nsWeakPtr r=m_kato
nsTextServicesDocument stores editor with nsWeakPtr for avoiding circular
reference.  However, both TextEditor and nsTextServicesDocument are cycle
collectable. So, we don't need to worry about the issue and we can simply
make it store with RefPtr<TextEditor>.  Then, we can make EditorBase and
nsTextServicesDocument access each other directly.

MozReview-Commit-ID: 9I4U8ivFlov

--HG--
extra : rebase_source : 4880c6f7d706acc70324f58aee70d4311db44059
2018-01-18 14:33:31 +09:00
Masayuki Nakano
397a47c1b9 Bug 1430319 - Get rid of nsIEditActionListener::Will*() which are not used by anybody r=m_kato
Most nsIEditActionListener::Will*() are not implemented, except
WillDeleteText() and WillDeleteSelection() which are implemented by
FinderHighlighter.  So, we can get rid of the other Will*() from it.

This patch removes a lot of unnecessary virtual calls and copy of strong
pointers to edit action listeners of EditorBase.

MozReview-Commit-ID: EsqI2tZoBG1

--HG--
extra : rebase_source : cf78eb8d33b12ca65177b0676f6e45d02e7c0688
2018-01-13 10:10:05 +09:00
Masayuki Nakano
31d493d9fa Bug 1430021 - part 2: Make HTMLEditRules not derived from nsIEditActionListener r=m_kato
HTMLEditRules implements only some of nsIEditActionListener and this is always
first edit action listener.  So, if we make EditorBase treat HTMLEditRules
directly before notifying edit action listeners, we can save a lot of runtime
cost (virtual calls especially unnecessary, copying array of edit action
listeners with strong pointer, redundant QIs), although the code becomes not
beautiful.

Perhaps, we should do same thing to nsTextServicesDocument and
mozInlineSpellChecker in other bugs.

MozReview-Commit-ID: Eveaxj398f2

--HG--
extra : rebase_source : 0b7b66ba1002e08591e8d95ef68b216e7ce1f93b
2018-01-13 00:21:17 +09:00
Masayuki Nakano
b2a3e52b16 Bug 1430021 - part 1: Move |RefPtr<TextEditRules> mRules| from TextEditor to EditorBase r=m_kato
For calling some methods of mRules from EditorBase, let's move mRules member
from TextEditor to EditorBase.

Unfortunately, TextEditRules.h depends on EditAction which is declared in
EditorBase.h and that caused unnecessary include hell of EditorBase.h.  So,
let's move it to an independent header file.

MozReview-Commit-ID: 5HiSZLP9WHH

--HG--
extra : rebase_source : 3e2c40385a6f3d6d1e03ef4e213434383bb37d5f
2018-01-12 19:01:04 +09:00
Boris Zbarsky
f1d64479e7 Bug 1431964 part 10. Remove nsIDOMAttr. r=mccr8
MozReview-Commit-ID: xj4QeXBF9V
2018-01-21 12:07:31 -05:00
Boris Zbarsky
e38dec29f4 Bug 1431964 part 8. Remove nsIDOMMozNamedAttrMap. r=mccr8
MozReview-Commit-ID: C7z0hcjC0Tg
2018-01-20 20:57:26 -05:00
Boris Zbarsky
ac46271e7c Bug 1431964 part 5. Remove nsIDOMMozNamedAttrMap::Item. r=mccr8
MozReview-Commit-ID: GnrOUhx9nTQ
2018-01-20 18:48:36 -05:00
Makoto Kato
5c5237a5a1 Bug 1402526 - Add crashtest. r=me a=test-only 2018-01-15 14:27:45 +09:00
Adrian Wielgosik
3c2cc07d2d Bug 1379891 - remove nsPIEditorTransaction interface, GetTxnDescription methods. r=m_kato,masayuki
MozReview-Commit-ID: 4NLeMrrqIv5
2018-01-14 16:01:41 +01:00
Chris Peterson
37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Cameron McCormack
8731df3c34 Bug 1427512 - Part 29: Remove nsIDOMCSSDeclaration. r=xidorn,jryans,bz
This removes the .style attribute from nsIDOMSVGElement, but there
shouldn't be any users of that.

MozReview-Commit-ID: LOBSFo85Utn
2018-01-11 16:17:57 +08:00
Cameron McCormack
66141a0c03 Bug 1427512 - Part 27: Remove nsIDOMCSSPrimitiveValue. r=xidorn,bz
MozReview-Commit-ID: IcGKAjPWacZ
2018-01-11 16:17:57 +08:00
Cameron McCormack
e3549b2d1c Bug 1427512 - Part 22: Remove nsIDOMStyleSheet. r=xidorn,bz
MozReview-Commit-ID: KO2mWX4P8lI
2018-01-11 16:17:57 +08:00
Makoto Kato
3f840ba7f5 Bug 1425652 - mosueDown, mouseUp and mouseMove should be removed from nsIHTMLObjectResizer. r=masayuki
comm-central and bluegriffon don't use mosueDown, mouseUp and mouseMove in
nsIHTMLObjectResizer, so we should remove these methods from this interface.

MozReview-Commit-ID: BnSkkH7f0xc

--HG--
extra : rebase_source : 40811e1a0b714e3ef30fd9ac5e4f840241de3780
2018-01-10 12:47:16 +09:00
Olli Pettay
3a7a79b6b8 Bug 1428747 - Make EditorBase::GetDOMEventTarget() to return EventTarget* and GetFocusedContent() return nsIContent* in order to optimize out some AddRef/Release calls, r=masayuki
--HG--
extra : rebase_source : 86be9af360438fcb1fa63f07994e41cf12d9c2e2
2018-01-09 15:41:42 +02:00
Margareta Eliza Balazs
fe2caaa266 Merge inbound to mozilla-central r=merge a=merge 2018-01-09 11:52:55 +02:00
Dão Gottwald
d6173b3fbb Bug 449045 - Drop support for type=timed textboxes. r=enn
MozReview-Commit-ID: Ld6foAxCAhW

--HG--
extra : rebase_source : 94065ccfb55e8a93322cd5fbbeabcc78b222bf1a
2018-01-05 21:03:39 +01:00
Makoto Kato
1f169bb35d Bug 1425091 - Part 4. EditorBase::MoveNode should check valid node that has parent node. r=masayuki
AutoMoveNodeSelNotify doesn't allow container is null.  So we should reject
that parent of moving node is null.

MozReview-Commit-ID: DGNCicLJxuK

--HG--
extra : rebase_source : eea203f16d0296c74d0727f34b6ddc5c165f9092
2017-12-15 10:56:45 -06:00
Makoto Kato
d438423b79 Bug 1425091 - Part 3. SelAdjCreateNode and SelAdjInsertNode should check whether valid point. r=masayuki
This crashtest case hits assertion in SelAdjInsertNode due to invalid offset
point. So we check whether this is valid.

Also, SelAdjCreateNode and SelAdjInsertNode should use EditorRawDOMPoint to avoid offset calculation and check valid offset.

MozReview-Commit-ID: A1kaKEzc36e

--HG--
extra : rebase_source : c46843fdd6e9e18f49b9cedb008cda6cf3436811
2017-12-15 10:49:53 -06:00
Makoto Kato
2ca662631f Bug 1425091 - Part 2. Add crashtest. r=masayuki
MozReview-Commit-ID: APqtZUv1q6y

--HG--
extra : rebase_source : 80b64a193a322543c6a34041d77fb5445776e902
2017-12-15 10:51:53 -06:00
Makoto Kato
2dbcd1159a Bug 1425091 - Part 1. Should check whether CreateNode is failure. r=masayuki
This crash occurs when CreateNode returns nullptr that is error.  So we should
check whether this method is failure.

MozReview-Commit-ID: 9jDOnEYSurG

--HG--
extra : rebase_source : a7f2f9797267befe99f7f794c524efdf7bf331c0
2017-12-15 11:01:58 -06:00
Makoto Kato
e8bfc9ec8b Bug 1428237 - Remove unused nsIHTMLEditor.getHeadContentsAsHTML. r=masayuki
c-c and bluegriffon don't use this method, so let's remove it to clean up.

MozReview-Commit-ID: BC5Ooy2Jlb9

--HG--
extra : rebase_source : 86e49ef864d5c78049673924c385e6cdbd0cb215
2018-01-05 10:59:37 +09:00
Makoto Kato
e38403da76 Bug 1427964 - Remove unused methods from CSSEditUtils. r=masayuki
Some methods in CSSEditUtils are unused now, so let's remove it.

MozReview-Commit-ID: H4HiqL6hW9K

--HG--
extra : rebase_source : 80e10ba5e6de5fcc5032dc2e08fa84bf26e80795
2018-01-04 14:27:15 +09:00
Andrea Marchesini
00e79ef07b Bug 1425321 - Renaming nsINode::GetChildAt to GetChildAt_Deprecated, r=catalinb
We want to deprecate nsINode::GetChildAt as the first step of removing DOM node
child array storage. See bug 651120.
2018-01-03 13:59:54 +01:00
Makoto Kato
db9f405bd9 Bug 1427060 - PropItem should use nsAtom instead of nsString. r=masayuki
Actually, PopItem uses nsString to store attribute name.  And when using it,
it converts to nsAtom by NS_Atomize and compare by nsString.

To reduce calculation of atom and string compare, we should store atom directly.

MozReview-Commit-ID: 8OB02mgMg1r

--HG--
extra : rebase_source : 9861217804acac52106a89cad75e08bd547080ad
extra : histedit_source : 2b9f01cf29b1b09dd07fc771ff94a06be4d94f31
2017-12-26 12:25:45 +09:00
Masayuki Nakano
18f7821c7b Bug 1425997 - Don't try to remove whitespaces in WSRunObject::ConvertToNBSP() when the text node is changed by mutation observer r=m_kato
WSRunObject::ConvertToNBSP() inserts an NBSP, then, removes following ASCII
whitespaces.  When inserting an NBSP, mutation observer may change the
text node.  In this case, it shouldn't keep working on removing ASCII
whitespaces because it may causes unexpected result.

This patch also renames ConvertToNBSP() and GetAsciiWSBounds() to
InsertNBSPAndRemoveFollowingASCIIWhitespaces() and
GetASCIIWhitespacesBounds() for making their jobs clearer.

MozReview-Commit-ID: TVy9fEKL6p

--HG--
extra : rebase_source : f0bce124055a86caca57334f06c75a46098f69ac
2017-12-21 19:27:31 +09:00
Emilio Cobos Álvarez
c8eb630ebe Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-25 17:50:10 +01:00
Emilio Cobos Álvarez
ffdf5d2cb5 Backout changeset e43f568b3e9a (bug 1423990) because some OSX-only code still doesn't build. r=me 2017-12-25 12:55:45 +01:00
Emilio Cobos Álvarez
c0959b2955 Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W

--HG--
extra : rebase_source : 09b82acb4f3d69e8a4345457ab217443bc28d6e2
2017-12-07 19:13:50 +01:00
Masayuki Nakano
17f76b7cd6 Bug 1393337 - Get rid of nsIEditRules r=m_kato
nsIEditRules is a super class of only mozilla::TextEditRules and not scriptable.
So, we can get rid of it.

This patch merges RulesInfo with TextRulesInfo and name new class is RulesInfo
for minimizing the code change.

Additionally, adds two methods AsHTMLEditRules() and its const version.
They make existing cast code safer.

MozReview-Commit-ID: KwWH3ADj3Bv

--HG--
extra : rebase_source : 4517bdc95b530530e9756e07c4b6cce78c002073
2017-12-21 14:52:32 +09:00
Emilio Cobos Álvarez
d5196e4079 Bug 1426494: Share more code among Document / ShadowRoot. r=smaug
MozReview-Commit-ID: C4cJrSFPnIb
2017-12-22 01:56:17 +01:00
Masayuki Nakano
7ffbc78e5c Bug 1359396 - Redesign HTMLEditRules::IsEmptyBlock() r=m_kato
HTMLEditRules::IsEmptyBlock() won't return error in most cases.  Additionally,
HTMLEditRules::WillInsertBreak() doesn't check it.  So, just returning bool
is simpler.

MozReview-Commit-ID: 5DfRv7lIyuS

--HG--
extra : rebase_source : 8b430d88a92fd5830a0b9f1bc1d46ac31e45c12c
2017-12-20 22:25:12 +09:00
Masayuki Nakano
240d199f53 Bug 1359405 - Redesign HTMLEditor::IsVisTextNode() r=m_kato
Despite of its name, HTMLEditor::IsVisTextNode() returns true with its out
argument when the given text node is empty.  And although it returns nsresult,
it's almost always NS_OK because it returns error only when the editor isn't
usual condition.

So, it should return bool and true when the given text node is visible.

This patch separates the method.  One is for checking the node with frames,
called IsInVisibleTextFrames().  The other is for checking it only with
its text, called IsVisibleTextNode().

MozReview-Commit-ID: EdQmkOxfNxO

--HG--
extra : rebase_source : ad9d42f6c8a8e17145f0ca92cd5c02994f8a6b37
2017-12-20 15:07:37 +09:00
Masayuki Nakano
e376af4b27 Bug 1425412 - part 12: Create factory methods for DeleteRangeTransaction, EditAggregateTransaction and PlaceholderTransaction for consistency with the other transaction classes r=m_kato
Although, we don't need factory methods for DeleteRangeTransaction,
EditAggregateTransaction nor PlaceholderTransaction, for consistency with the
other transaction classes, they should have factory methods for making easier
to write the code.

For not making the performance slow down, they should be inline methods.

MozReview-Commit-ID: 7jl5yZNFYmP

--HG--
extra : rebase_source : 7cd5b5e268a670b3c8855407cc72dec12d34d8ff
2017-12-18 18:08:43 +09:00
Masayuki Nakano
0dd5b5022a Bug 1425412 - part 11: Create factory methods for ChangeStyleTransaction and remove CSSEditUtils::CreateCSSPropertyTxn() r=m_kato
This patch creates factory methods for ChangeStyleTransaction and removes
CSSEditUtils::CreateCSSPropertyTxn().

MozReview-Commit-ID: 1h8ZAj2PP5O

--HG--
extra : rebase_source : 3da3070ad179bac1aadbfc6984b4c2922a052ec0
2017-12-18 17:46:57 +09:00
Masayuki Nakano
bbbb83c937 Bug 1425412 - part 10: Create factory methods for AddStyleSheetTransaction and RemoveStyleSheetTransaction, and remove EditorBase::CreateTxnForAddStyleSheet() and EditorBase::CreateTxnForRemoveStyleSheet() r=m_kato
This patch creates factory methods for AddStyleSheetTransaction and
RemoveStyleSheetTransaction, and removes EditorBase::CreateTxnForAddStyleSheet()
and EditorBase::CreateTxnForRemoveStyleSheet() instead.

MozReview-Commit-ID: 6dnZctDtNik

--HG--
extra : rebase_source : 43eaadbde06e4a0b061ea8136e12ffeccfaf5592
2017-12-18 17:29:32 +09:00
Masayuki Nakano
07e48c2f29 Bug 1425412 - part 9: Create factory methods of ChangeAttributeTransaction and remove EditorBase::CreateTxnForSetAttribute() and EditorBase::CreateTxnForRemoveAttribute() r=m_kato
This patch creates two factory methods of ChangeAttributeTransaction.  One is
for setting an attribute to specific value.  The other is for removing an
attribute.  So, EditorBase::CreateTxnForSetAttribute() and
EditorBase::CreateTxnForRemoveAttribute() are unnecessary anymore.

MozReview-Commit-ID: 2fEVd3pDXsf

--HG--
extra : rebase_source : 674005a5b9fc623999a0f51dc8697027970f06c9
2017-12-18 17:07:52 +09:00
Masayuki Nakano
f2369df116 Bug 1425412 - part 8: Create JoinNodeTransaction::MaybeCreate() and remove EditorBase::CreateTxnForJoinNode() r=m_kato
EditorBase::CreateTxnForJoinNode() just hides what it does.
For making the caller clearer, let's create a factory method,
JoinNodeTransaction::MaybeCreate().

MozReview-Commit-ID: 8vADXdzMeuV

--HG--
extra : rebase_source : 6a281aff11bfa019c292d26cadd0cd29da12753f
2017-12-15 21:53:08 +09:00
Masayuki Nakano
2b43d139dd Bug 1425412 - part 7: Create SplitNodeTransaction::Create() and remove EditorBase::CreateTxnForSplitNode() r=m_kato
SplitNodeTransaction::Create() just hides what it does.  For making its caller
clearer, let's create a factory method, SplitNodeTransaction::Create().

MozReview-Commit-ID: KDiC8dDrLuQ

--HG--
extra : rebase_source : ac04544e10644b8a73375fb2b786e0bc86eb56ae
2017-12-15 21:37:23 +09:00
Masayuki Nakano
015555162f Bug 1425412 - part 6: Create DeleteNodeTransaction::MaybeCreate() and remove EditorBaseTransaction::CreateTxnForDeleteNode() r=m_kato
EditorBaseTransaction::CreateTxnForDeleteNode() just hides what it does.
Instead, let's create a factory method, DeleteNodeTransaction::MaybeCreate()
for making callers clearer.

MozReview-Commit-ID: 8WUYN0BjKSU

--HG--
extra : rebase_source : e0ff8b8434b720dc124c770cd7371d84b949ca8d
2017-12-15 21:24:33 +09:00
Masayuki Nakano
6b8e286ddc Bug 1425412 - part 5: Create some factory methods of DeleteTextTransaction and remove EditorBase::CreateTxnForDeleteText() and EditorBase::CreateTxnForDeleteCharacter() r=m_kato
DeleteTextTransaction should have 3 factory methods.  One is, simply to create
an instance with a pair of offset and length.  The others are, to create an
instance for deleting a previous or next character at offset.

The former was EditorBase::CreateTxnForDeleteText() and the latter was
EditorBase::CreateTxnForDeleteCharacter(), but this patch creates
DeleteTextTransaction::MaybeCreate() for the former,
DeleteTextTransaction::MaybeCreateForPreviousCharacter() and
DeleteTextTransaction::MaybeCreateForNextCharacter() for the latter.

MozReview-Commit-ID: DFELbmAJDo3

--HG--
extra : rebase_source : 1600984c704b460e1cc09777b81df2906c154cce
2017-12-15 20:43:26 +09:00
Masayuki Nakano
a5bd93a76e Bug 1425412 - part 4: Create CompositionTransaction::Create() and remove EditorBase::CreateTxnForComposition() r=m_kato
EditorBase::CreateTxnForComposition() just hides what it does.  For its caller,
creating a factory method, CompositionTransaction::Create(), is clearer what
it does.

Additionally, capsuling the creation in CompositionTransaction class can make
the text node information in TextComposition updated automatically.  So, now,
it might be better to update them in DoTransaction() because there is a lag
between creating the transaction and calling DoTransaction().  However, this
patch doesn't want to change any existing behavior.  So, this doesn't fix this
issue.

MozReview-Commit-ID: K8ci7ytwh1u

--HG--
extra : rebase_source : d468a0fc997c99f78f7eb46451082e7f1e052890
2017-12-15 18:26:37 +09:00
Masayuki Nakano
7443737c19 Bug 1425412 - part 3: Create CreateElementTransaction::Create() and remove EditorBase::CreateTxnForCreateElement() r=m_kato
EditorBase::CreateTxnForCreateElement() just hides what it does. Let's make
the caller what it does with creating CreateElementTransaction::Create().

MozReview-Commit-ID: DYcfQV6KiUZ

--HG--
extra : rebase_source : d3f31b8db92bd3b2af464c66e064dd7b21018960
2017-12-15 17:54:10 +09:00
Masayuki Nakano
1623a99bae Bug 1425412 - part 2: Create InsertNodeTransaction::Create() and remove EditorBase::CreateTxnForInsertNode() r=m_kato
EditorBase::CreateTxnForInsertNode() just hides what it does.  Let's create
InsertNodeTransaction::Create() and make the caller clearer.

MozReview-Commit-ID: 2J2WV73cdsm

--HG--
extra : rebase_source : 15b6391aee5beca4401e7c7a4ee8bf350a7590fd
2017-12-15 17:34:52 +09:00
Masayuki Nakano
ab059453f1 Bug 1425412 - part 1: Create InsertTextTransaction::Create() and remove EditorBase::CreateTxnForInsertText() r=m_kato
EditorBase::CreateTxnForInsertText() just hides what it exactly does.

Rewriting it with a static factory method, InsertTextTransaction::Create()
should be clearer for its caller.

MozReview-Commit-ID: Er7Zlhtbnb0

--HG--
extra : rebase_source : 9dc71b3baab839f61153b96806fac5baae5d46cb
2017-12-15 17:26:52 +09:00
Masayuki Nakano
30d3307a79 Bug 1426318 - Get rid of EditorBase::IsContainer(nsIDOMNode*) r=m_kato
The only caller is HTMLEditor::IsEmptyNodeImpl().  So, we can get rid of it.

MozReview-Commit-ID: GTJiXwSCrwM

--HG--
extra : rebase_source : a44b277547d0641f244ff363f5cde8ae44b13eda
2017-12-20 16:18:47 +09:00
Cosmin Sabou
4620ebda6e Backed out 3 changesets (bug 1426494) for build bustages on dom/base/FuzzingFunctions.h:25:44 r=backout on a CLOSED TREE
Backed out changeset 8d07cb1ef232 (bug 1426494)
Backed out changeset 74a8ebb0f5d3 (bug 1426494)
Backed out changeset 07c4aa18a0b6 (bug 1426494)
2017-12-21 03:09:22 +02:00
Emilio Cobos Álvarez
7e7dee971b Bug 1426494: Share more code among Document / ShadowRoot. r=smaug
MozReview-Commit-ID: C4cJrSFPnIb
2017-12-21 00:24:27 +01:00
Makoto Kato
42a03792a6 Bug 1425467 - mInlineEditedCell should be Element. r=masayuki
mInlineEditedCell for inline table editor is still nsIDOMElement.  To avoid QI
and virtual call, we should replace it with Element.

MozReview-Commit-ID: 76yfQJxwm9d

--HG--
extra : rebase_source : e89de17faa20d16a8823e1016b6ba8a6f78993b6
2017-12-15 10:14:54 -06:00
Masayuki Nakano
59ff865ade Bug 1425390 - part 2: Make the constructor of CompositionTransaction take TextComposition to reduce its arguments r=m_kato
Most arguments of the constructor of CompositionTransaction are now stored by
EditorBase::mComposition.  So, making it take TextComposition reduces the
number of its arguments.

Note that this patch doesn't make it retrieve TextComposition with
EditorBase::GetComposition() for guaranteeing that the editor has non-nullptr
mComposition.

MozReview-Commit-ID: 3O5wL52UBUy

--HG--
extra : rebase_source : 7f48465ef3f2f040e8c526fb7837060ecb6c9147
2017-12-15 16:45:41 +09:00
Masayuki Nakano
6e8192fd45 Bug 1425390 - part 1: Move some IME related members of EditorBase into TextComposition r=m_kato
EditorBase stores a text node, offset in it and length in it of composition
string directly.  However, this wastes memory space if user never uses IME
or user only sometimes uses IME.  Additionally, storing all data in
TextComposition is better than current design when other classes like
CompositionTransaction wants some information of both EditorBase and
TextComposition.

This patch moves those 3 members from EditorBase to TextComposition.

MozReview-Commit-ID: 4N7wmGGfxmt

--HG--
extra : rebase_source : bd7cb37fe9631b959ec21da40c20751fec269dca
2017-12-15 13:14:51 +09:00
Jonathan Kew
1a613e00cb Bug 1424898 - patch 2 - De-virtualize nsIWordBreaker and rename to mozilla::intl::WordBreaker. r=m_kato
--HG--
rename : intl/lwbrk/nsSampleWordBreaker.cpp => intl/lwbrk/WordBreaker.cpp
rename : intl/lwbrk/nsIWordBreaker.h => intl/lwbrk/WordBreaker.h
2017-12-13 22:17:38 -06:00
Jonathan Kew
574a922078 Bug 1424898 - patch 1 - De-virtualize nsILineBreaker and rename to mozilla::intl::LineBreaker. r=m_kato
--HG--
rename : intl/lwbrk/nsJISx4051LineBreaker.cpp => intl/lwbrk/LineBreaker.cpp
rename : intl/lwbrk/nsILineBreaker.h => intl/lwbrk/LineBreaker.h
2017-12-13 22:17:32 -06:00
Makoto Kato
75dffc067d Bug 1424677 - Don't use wstring for nsIEditorSpellCheck. r=masayuki
nsIEditorSpellCheck still uses wstring.  We should replace it with AString
to avoid additional memory allocation.

MozReview-Commit-ID: H4jKY2tylqg

--HG--
extra : rebase_source : c1f0325eb2efbfb07f53514b96121a5ceb58efd4
2017-12-13 04:14:27 -06:00
Masayuki Nakano
510e325f07 Bug 1424676 - part 3: Redesign HTMLEditRules::StandardBreakImpl() with |const EditorDOMPoint&| r=m_kato
HTMLEditRules::StandardBreakImpl() should take |const EditorDOMPoint&| to
specify where a new <br> element inserted before.

Additionally, we should rename it to InsertBRElement().

MozReview-Commit-ID: 4BR7xGFFrpk

--HG--
extra : rebase_source : 873af2c4167227a570878fe03d6dec61dffe9528
2017-12-11 18:28:46 +09:00
Masayuki Nakano
ddf72056f7 Bug 1424676 - part 2: Redesign TextEditRules::CreateBR(), TextEditRules::CreateMozBR() and TextEditRules::CreateBRInternal() with |const EditorRawDOMPoint&| r=m_kato
TextEditRules has some wrappers of TextEditor::CreateBR().  Also they should
take |const EditorRawDOMPoint&| to specify the insertion point of new <br>
element.

Additionally, this patch makes them just return add-refed Element instead of
nsresult.  So, we can get rid of out param from it.

MozReview-Commit-ID: 3wfKGaTM89c

--HG--
extra : rebase_source : 47f0d89bc16f0858c7141b2035164adb9105493c
2017-12-11 16:37:10 +09:00
Masayuki Nakano
315b823d03 Bug 1424676 - part 1: Make TextEditor::CreateBR() take |const EditorRawDOMPoint&| to specify the insertion point r=m_kato
TextEditor::CreateBR() should take |const EditorRawDOMPoint&| to specify the
insertion point instead of a set of container node and offset in it.

MozReview-Commit-ID: 4PrWzwmIgfD

--HG--
extra : rebase_source : c509907002693f3b77cd00bf77cfd0f26704fd65
2017-12-11 16:01:50 +09:00
Masayuki Nakano
6b577ea0fa Bug 1423835 - part 3: Rename EditorDOMPointBase::GetChildAtOffset() to EditorDOMPointBase::GetChild() r=m_kato
Different from RangeBoundaryBase, EditorDOMPointBase can store only child node.
I.e., mOffset may be invalid until its Offset() is called.  So,
GetChildAtOffset() isn't good name.  It should be just GetChild().

Similarly, GetNextSiblingOfChildAtOffset() and
GetPreviousSiblingOfChildAtOffset() should be renamed to GetNextSiblingOfChild()
and GetPreviousSiblingOfChild().

MozReview-Commit-ID: WpkPmDwkrL

--HG--
extra : rebase_source : 2be1fcbee129f4c96e9b166be5a924845340708f
2017-12-07 19:08:56 +09:00
Masayuki Nakano
dacd109e2f Bug 1423835 - part 2: Rename EditorDOMPointBase::Container() to EditorDOMPointBase::GetContainer() and add some useful methods to access its container r=m_kato
EditorDOMPointBase::Container() may return nullptr.  So, it should be renamed
to GetContainer().

Then, the method name becomes longer and a lot of callers access the result
directly.  So, there should be following methods to make the callers shorter:

- GetContainerAsContent() to return the container as nsIContent*.
- GetContainerAsElement() to return the container as dom::Element*.
- GetContainerAsText() to return the container as dom::Text.
- GetContainerAsDOMNode() to return the container as nsIDOMNode*.
- CanContainerHaveChildren() to check if the container can have child nodes.
- IsInDataNode() to check if the point is in a data node including text node.
- IsInTextNode() to check if the point is in a text node.
- IsContainerHTMLElement() to check if the container is specific HTML element.
- IsContainerAnyOfHTMLElements() to check if the container is one of the
  specified HTML elements.

MozReview-Commit-ID: LkN2WBbCPj0

--HG--
extra : rebase_source : 9da1e70d4c74f7ad573e244cf6c7b21a0c7b4410
2017-12-07 18:45:52 +09:00
Masayuki Nakano
d95c27869d Bug 1423835 - part 1: Add EditorDOMPointBase::SetToEndOf() to initialize the instance at end of container node r=m_kato
Editor code sometimes sets a DOM point to end of a node.  In this case, we
need to write |Set(node, node->Length())|.  So, it should have
|void SetToEndOf(const nsINode* aContainer)| for making meaning of the code
clearer.

MozReview-Commit-ID: 91shMCD2d84

--HG--
extra : rebase_source : 3401af50aabc1b677deeae664e8c56506182d28c
2017-12-07 17:27:20 +09:00
Masayuki Nakano
ed66480149 Bug 1423097 - part 3: Fix new orange caused by an existing bug of EditorBase::DeleteSelectionAndCreateElement() r=m_kato
Even after EditorBase::DeleteSelectionAndCreateElement() creates a new element,
it tries to collapse selection with |pointToInsert| which is outdated after
inserting new element.

So, it should recompute the caret position with new DOM tree.

MozReview-Commit-ID: DKh2uhItIol

--HG--
extra : rebase_source : c0c30e1c809784af64e87596b471c472350857a8
2017-12-07 13:57:35 +09:00
Masayuki Nakano
bab72d08e8 Bug 1423097 - part 2: Add overloads of nsRange::SetStart(), nsRange::SetEnd(), nsRange::IsPointInRange() and nsRange::ComparePoint() to use them with RawRangeBoundary r=smaug
nsRange::SetStart(), nsRange::SetEnd(), nsRange::IsPointInRange() and
nsRange::ComparePoint() take a set of container node and offset in it to
specifying a DOM point.  However, the caller may not have computed the offset
but may know the child node at the point.  In such case, they can avoid
computing the offset with nsINode::IndexOf() if they have overloads which
take RawRangeBoundary.

Therefore, this patch implements the overloads and changes the callers in
editor.

MozReview-Commit-ID: E4DLbAgTTCI

--HG--
extra : rebase_source : 8d1632a030f1e0a0dd2b81c3996c19d427e8b0bd
2017-12-05 17:50:13 +09:00
Masayuki Nakano
0021ffcddf Bug 1423097 - part 1: Implement Selection::AnchorRef() and Selection::FocusRef() r=smaug
Some methods of editor retrieves anchor and focus of selection.  However, there
are no methods which directly access RangeBoundary of anchor and focus.

This patch adds it for making editor code simpler and avoiding unnecessary
child offset computation.

MozReview-Commit-ID: EvepQpFMi8S

--HG--
extra : rebase_source : 38f3c506db5c9d8790bbd625d552bfbc8d99cebc
2017-12-05 16:36:57 +09:00
Masayuki Nakano
d942210f2e Bug 1408125 - part 5: Redesign HTMLEditor::NormalizeEOLInsertPosition() with EditorRawDOMPoint r=m_kato
HTMLEditor::NormalizeEOLInsertPosition() takes a set of container node and
offset in it for specifying insertion point.  So, this should be replaced
with |const EditorRawDOMPoint&| and it should return |EditorDOMPoint| rather
than modifying the argument.

Additionally, perhaps, GetBetterInsertionPointFor() is better name for it.

MozReview-Commit-ID: IB1FhrkzK2G

--HG--
extra : rebase_source : 55f8c1d9fa1f149e81114c929f6e6232aba03905
2017-12-05 15:36:49 +09:00
Masayuki Nakano
36d48397f0 Bug 1408125 - part 4: Redesign HTMLEditor::InsertNodeAtPoint() with EditorRawDOMPoint r=m_kato
HTMLEditor::InsertNodeAtPoint() should take |const EditorRawDOMPoint&| as
an argument which specifies point to insert.  Additionally, it should take
|EditorDOMPoint*| to return the next point of actual insertion point.

Additionally, this patch renames it to InsertNodeAtProperAncestor() for
explaining what it will do.

MozReview-Commit-ID: HYUzSlyPxAd

--HG--
extra : rebase_source : 57033cdc4458b45a5fe9d6aa642c185133a79304
2017-11-28 22:28:07 +09:00
Masayuki Nakano
f6e37d5fe3 Bug 1408125 - part 3: Redesign nsIEditActionListener::(Will|Did)InsertNode() r=m_kato
Although nsIEditActionListener::WillInsertNode() nobody implements actually,
we should remove it in a follow up bug.

nsIEditActionListener::DidInsertNode() is implemented only by HTMLEditRules.
So, if we make it not use nsIEditActionListener, we can remove it too.
However, keep it for now.

On the other hand, they don't need to receive index of the insertion point.
WillInsertNode() needs next sibling of the insert point, but DidInsertNode()
needs nothing because listener can compute it with new inserted node.

MozReview-Commit-ID: GiTKkVyZJlN

--HG--
extra : rebase_source : 9ee38c28217d25d1a3f79b0b458c7b2121350a76
2017-11-28 21:26:10 +09:00
Masayuki Nakano
8496023596 Bug 1408125 - part 2: EditorBase::CreateTxnForInsertNode() and EditorBase::InsertNode() should take |const EditorRawDOMPoint&| as an argument specifying point to insert r=m_kato
EditorBase::CreateTxnForInsertNode() and EditorBase::InsertNode() should take
|const EditorRawDOMPoint&| as an argument specifying point to insert.

MozReview-Commit-ID: KhK19xS7wXb

--HG--
extra : rebase_source : f7b08b7d049eef8a9c03ee681e53e8d469915b15
2017-11-22 21:25:05 +09:00
Masayuki Nakano
2e842218a1 Bug 1408125 - part 1: Make InsertNodeTransaction use EditorRawDOMPoint and RangeBoundary instead of pair of container node and offset in it r=m_kato
Like CreateNodeTransaction, InsertNodeTransaction should use EditorRawDOMPoint
for temporary variable and arguments of its methods and should use RangeBoudary
to store it as its member.

MozReview-Commit-ID: FCGY8x97egb

--HG--
extra : rebase_source : bd5ce45944b8b367afc9b782e881727061d83035
2017-11-22 17:29:22 +09:00
Sylvestre Ledru
9bfe27d903 Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 7duJk2gSd4m

--HG--
extra : rebase_source : 7312fe276e561e8c034a5f6749774ae812727f9c
2017-12-07 22:09:15 +01:00
Neil Deakin
60e7f4183f Bug 1419925, implement a promise-oriented version of waitForClipboard, promiseClipboardChange, change a selection of tests to use this instead. Simplify some other clipboard tests that were unreliable before the fix for 1394757. r=jmaher 2017-12-07 08:39:50 -05:00
Emilio Cobos Álvarez
74b31155f7 Bug 1423167: Move most attribute-related methods from nsIContent to Element. r=bz
MozReview-Commit-ID: 6WXqNiODttD
2017-12-06 16:05:59 +01:00
Masayuki Nakano
0b2f749b62 Bug 1422668 - Back out changes of RangeBoundary.h which were added for EditorDOMPoint r=catalinb
EditorDOMPoint was a subclass of RangeBoundary.  Therefore, for heavy
use of it in editor, we've implemented a lot of complicated feature
into RangeBoundary.  However, EditorDOMPoint stopped inheriting
RangeBoundary.  So, we can get simple RangeBoundary implementation
back now.

This patch makes RangeBoundary.h almost same as 3f7cbec2446b except
keeps implementing GetPreviousSiblingOfChildAtOffset() and
GetNextSiblingOfChildAtOffset() because the former is used by
Selection and both of them are simple.  And also keeps making it
a friend of EditorDOMPoint because EditorDOMPoint still needs to
copy to/from RangeBoundary.

MozReview-Commit-ID: Hr5SA52ScK0

--HG--
extra : rebase_source : a00a46ff931a5c4fcabf910510fa448b513f50c5
2017-12-04 16:28:50 +09:00
Masayuki Nakano
32f2446662 Bug 1408227 - part 6: WSRunObject::CheckTrailingNBSP() should take |const EditorRawDOMPoint&| instead of a set of container node and offset in it r=m_kato
The name, WSRunObject::CheckTrailingNBSP(), is unclear what it does.  It
replaces previous character of specified point with ASCII space if it is NBSP
and it's not necessary.

So, it should be renamed to ReplacePreviousNBSPIfUnncessary().

Additionally, it should take |const EditorRawDOMPoint&| instead of a set of
container node and offset in it.

MozReview-Commit-ID: 2vq46OiAzo6

--HG--
extra : rebase_source : 132bb71361ff1e60268863cd4ef86bfbd0ddc9d1
2017-11-22 02:45:08 +09:00
Masayuki Nakano
b75f048daa Bug 1408227 - part 5: Redesign GetCharAfter(), GetCharBefore(), GetWSPointAfter() and GetWSPointBefore() of WSRunObject r=m_kato
WSRunObject::GetChar(After|Before)(nsINode*, int32_t) returns next/previous
character's DOM point as WSPoint.  If the container node is a text node in
mNodeArray, it calls WSRunObject::GetChar(After|Before)(const WSPoint&) which
returns next/previous offset if the point isn't end/start of the text node.
If the point is at end/start of the text node, it returns start/end of
next/previous text node in mNodeArray.  If the container node is not a text
node in mNodeArray, it calls WSRunObject::GetWSPoint(After|Before)().  It looks
for next/previous text node in mNodeArray from the point.  Then, it calls
WSRunObject::GetChar(After|Before)(const WSPoint&) and returns the result.

So, we should rename GetCharAfter() to GetNextCharPoint(), GetCharBefore() to
GetPreviousCharPoint(), GetWSPointAfter() to GetNextCharPointInternal() and
GetWSPointBefore() to GetPreviousCharPointInternal().

Then, they should take |const EditorRawDOMPoint&| instead of a set of container
node and offset in it.

So, looks like that "WS"RunObject is not good name for this class, perhaps,
AutoTextRunManager or something? But I'm still not sure.

MozReview-Commit-ID: 85cX3MdlFwz

--HG--
extra : rebase_source : 217dbb75653bf2a4c593fb9a0498824b1b764cf4
2017-11-22 02:12:27 +09:00
Masayuki Nakano
d5a3f638a3 Bug 1408227 - part 4: WSRunObject::DeleteChars() should take two |const EditorRawDOMPoint&| arguments to specify a range to remove r=m_kato
WSRunObject::DeleteChars() should take two |const EditorRawDOMPoint&| arguments
to represent a range to remove.

Additionally, this renames it to DeleteRange() because it also removes any
nodes in the range.  So, "Chars" isn't good word for this method's name.

MozReview-Commit-ID: 5Dmxnia1JPO

--HG--
extra : rebase_source : a4fd44c9354762db0e37fa156790dc20fdbe23a1
2017-11-22 01:00:35 +09:00
Masayuki Nakano
304f2a7e0f Bug 1408227 - part 3: Redesign WSRunObject::FindRun() with EditorRawDOMPoint r=m_kato
WSRunObject::FindRun() finds the nearest run from aPoint to specified direction.
So, it uses nsContentUtils::ComparePoints() a lot.  Therefore, it should use
an overload which takes RawRangeBoundary.  Although, it's not optimized for
RawRangeBoundary, but if it'd be optimized, this method becomes faster.

And this patch renames it to FindNearestRun().

MozReview-Commit-ID: 2NkR5E1st6d

--HG--
extra : rebase_source : 387ecc9d483c7cd88306197391fc2940b2000e28
2017-11-21 19:03:03 +09:00
Masayuki Nakano
3ad91ac0fd Bug 1408227 - part 2: WSRunObject::InsertBreak() should take |const EditorRawDOMPoint&| as an argument r=m_kato
WSRunObject::InsertBreak() should take |const EditorRawDOMPoint&| instead of
a pair of container node and offset in it.

MozReview-Commit-ID: 38OAn4dvR7x

--HG--
extra : rebase_source : 8e48ba2cec07c1dd4daf3cd9ec44751c860bc3da
2017-11-21 18:12:12 +09:00
Masayuki Nakano
7c6b57669f Bug 1408227 - part 1: TextEditor::CreateBRImpl() should take |const EditorRawDOMPoint&| for insertion point of new <br> element r=m_kato
TextEditor::CreateBRImpl() should take |const EditorRawDOMPoint&| as insertion
point of new <br> element.  Additionally, it doesn't need to have out argument
for the point of after <br> element because callers can get it with
EditorRawDOMPoint(nsINode*) and the new <br> node, and calling AdvanceOffset().
This cost must be enough cheap.

MozReview-Commit-ID: Hxawz3D2dCd

--HG--
extra : rebase_source : 866ff50efd70499ed733da9efcce7399f44bd4a0
2017-11-21 14:38:19 +09:00
Masayuki Nakano
5c35d9705d Bug 1421504 - EditorBase should move children carefully r=m_kato
While moving children of a container to another container, mutation observer
may move children before moving and/or move node immediately after the
insertion point.  Therefore, EditorBase should store all children which
should be moved with a local variable.  Then, move one by one carefully.
E.g., if a child before being moved is moved to different container, it
shouldn't be moved because JS already handles it as expected for the web
app.  If next sibling of the insertion point has been moved, EditorBase
should stop moving the remaining children because it may move children to
odd position and it may cause dataloss.

This patch creates EditorBase::MoveChildren() and it moves children carefully
with above checks.  Additionally, making its callers simpler, this patch also
creates EditorBase::MovePreviousSiblings() and MoveAllChildren().

MozReview-Commit-ID: FJDdSqXIlqD

--HG--
extra : rebase_source : 54bded29dbbd9547339a2c6e1a1264e22fbdc740
2017-11-29 17:57:00 +09:00
Makoto Kato
99a7861946 Bug 1421553 - Part 2. Remove nsIDOMRange usages from nsTextServicesDocument. r=masayuki
nsITextServicesDocument isn't scriptable, so there is no reason to use
nsIDOMRange.

MozReview-Commit-ID: AVPgrwmz38H

--HG--
extra : rebase_source : 0cb03cdb9b0dc4ef85b1b5582b7e3a54cb002904
2017-11-29 17:55:12 +09:00