Граф коммитов

1172 Коммитов

Автор SHA1 Сообщение Дата
Mark Banner 3720c020c0 Bug 1489980 - Editor ESLint for editor/ - Initial setup adding configs for tests. r=masayuki
Also block-disables no-multi-spaces for test_resizers_resizing_elements.html

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

--HG--
extra : moz-landing-system : lando
2018-09-13 07:57:57 +00:00
Ehsan Akhgari 5aedfad186 Bug 1489793 - Part 2: Remove nsComposerRegistration.cpp; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D5372
2018-09-12 18:58:53 -04:00
Ehsan Akhgari 6d56a36888 Bug 1489793 - Part 1: Remove the XPCOM component registration for EditorSpellCheck; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D5371
2018-09-12 18:58:53 -04:00
Ehsan Akhgari 1675c25fae Bug 1489790 - Part 11: Remove the overload of nsEditingSession::SetupEditorCommandController which takes a string and uses the XPCOM service manager to create the controller; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5366
2018-09-11 09:58:33 -04:00
Ehsan Akhgari 751c62d2ae Bug 1489790 - Part 10: Remove the XPCOM component registration for @mozilla.org/editor/editordocstatecontroller;1; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5365
2018-09-11 09:58:33 -04:00
Ehsan Akhgari f3142db64e Bug 1489790 - Part 9: Remove the XPCOM component registration for @mozilla.org/editor/htmleditorcontroller;1; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5364
2018-09-11 09:58:33 -04:00
Ehsan Akhgari c9bfa076d5 Bug 1489790 - Part 7: Remove the XPCOM component registration for @mozilla.org/editor/editingcontroller;1; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5362
2018-09-11 09:58:33 -04:00
Ehsan Akhgari 935e51caab Bug 1489790 - Part 6: Add an overload of nsEditingSession::SetupEditorCommandController which takes a creator function argument instead of a contract ID; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5361
2018-09-11 09:58:33 -04:00
Ehsan Akhgari 554d3d7b44 Bug 1489790 - Part 1: Remove the XPCOM component registration for nsControllerCommandTable as well as kHTMLEditorCommandTableCID and kHTMLEditorDocStateCommandTableCID; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5356
2018-09-11 09:58:33 -04:00
shindli 53d4f9c065 Backed out 2 changesets (bug 1489793) for failures in editor/spellchecker/tests/test_bug1219928.html
Backed out changeset 9d793ccd3fca (bug 1489793)
Backed out changeset 30219dab424e (bug 1489793)
2018-09-12 05:59:31 +03:00
Ehsan Akhgari 8f6c449995 Bug 1489793 - Part 2: Remove nsComposerRegistration.cpp; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D5372
2018-09-11 19:17:46 -04:00
Ehsan Akhgari d536808f38 Bug 1489793 - Part 1: Remove the XPCOM component registration for EditorSpellCheck; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D5371
2018-09-11 19:17:46 -04:00
Ehsan Akhgari 72c28b2f81 Bug 1489787 - Part 2: Remove the XPCOM component registration for nsComposeTxtSrvFilter; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D5354
2018-09-10 08:15:00 -04:00
Ehsan Akhgari aa4cb10397 Bug 1489786 - Remove the XPCOM component registration for nsEditingSession; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D5351
2018-09-09 15:47:00 -04:00
Nicholas Nethercote 6f5be00d2a Bug 1488628 - Change some nsIWebNavigation method arguments from wstring to AString. r=nika
--HG--
extra : rebase_source : a64af3af30b05e6a97b25550e6983121cc47add9
2018-09-05 13:42:16 +10:00
Ehsan Akhgari b26b734898 Bug 1488112 - Remove the XPCOM component registration for nsBaseCommandController; r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D4835
2018-09-04 15:03:22 -04:00
Adrian Wielgosik be0c1a4f55 Bug 1481645 - Remove some redundant uses of do_QueryInterface. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D2893

--HG--
extra : moz-landing-system : lando
2018-08-13 09:05:19 +00:00
Boris Zbarsky 754087a992 Bug 1446940 part 5. Stop getting docshells from windows via getInterface in dom/editor/etc code. r=kmag 2018-08-01 13:07:11 -04:00
Chris Peterson 2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Makoto Kato d7d2ea2a38 Bug 1468708 - Part 6. Move HTMLEditorCommands and HTMLEditorController to libeditor. r=masayuki
HTMLEditorController and HTMLEditorCommands is for execCommand, so we should
move from composer to libeditor since HTML editor code is in libeditor.

MozReview-Commit-ID: DEBoTqUsQnw

--HG--
rename : editor/composer/HTMLEditorCommands.cpp => editor/libeditor/HTMLEditorCommands.cpp
rename : editor/composer/HTMLEditorCommands.h => editor/libeditor/HTMLEditorCommands.h
rename : editor/composer/HTMLEditorController.cpp => editor/libeditor/HTMLEditorController.cpp
rename : editor/composer/HTMLEditorController.h => editor/libeditor/HTMLEditorController.h
rename : editor/composer/HTMLEditorDocumentCommands.cpp => editor/libeditor/HTMLEditorDocumentCommands.cpp
extra : rebase_source : 0b9627ac89803212da3377db3dfefedc3b57ce73
2018-06-13 14:49:06 -07:00
Makoto Kato 5c774c32b5 Bug 1468708 - Part 5. Rename nsComposer*Commands to HTMLEditor*Commands. r=masayuki
Rename nsComposerCommands to mozilla::*Command

Base class
- nsBaseComposerCommand -> mozilla::HTMLEditorCommandBase
- nsBaseStateUpdatingCommand -> mozilla::StateUpdatingCommandBase
- nsMultiStateCommand -> mozilla::MultiStateCommandBase

Command class
(HTMLEditorCommands)
- nsPasteNoFormattingCommand -> mozilla::PasteNoFormattingCommand
- nsStyleUpdatingCommand -> mozilla::StyleUpdatingCommand
- nsListCommand -> mozilla::ListCommand
- nsListItemCommand -> mozilla::ListItemCommand
- nsRemoveListCommand -> mozilla::RemoveListCommand
- nsIndentCommand -> mozilla::IndentCommand
- nsOutdentCommand -> mozilla::OutdentCommand
- nsParagraphStateCommand -> mozilla::ParagraphStateCommand
- nsFontFaceStateCommand -> mozilla::FontFaceStateCommand
- nsFontSizeStateCommand -> mozilla::FontSizeStateCommand
- nsFontColorStateCommand -> mozilla::FontColorStateCommand
- nsHighlightColorStateCommand -> mozilla::HighlightColorStateCommand
- nsBackgroundColorStateCommand -> mozilla::BackgroundColorStateCommand
- nsAlignCommand -> mozilla::AlignCommand
- nsAbsolutePositioningCommand -> mozilla::AbsolutePositioningCommand
- nsDecreaseZIndexCommand -> mozilla::DecreaseZIndexCommand
- nsIncreaseZIndexCommand -> mozilla::IncreaseZIndexCommand
- nsRemoveStylesCommand -> mozilla::RemoveStylesCommand
- nsIncreaseFontSizeCommand -> mozilla::IncreaseFontSizeCommand
- nsDecreaseFontSizeCommand -> mozilla::DecreaseFontSizeCommand
- nsInsertHTMLCommand -> mozilla::InsertHTMLCommand
- nsInsertTagCommand -> mozilla::InsertTagCommand

(HTMLEditorDocumentCommands)
- nsSetDocumentOptionsCommand -> mozilla::SetDocumentOptionsCommand
- nsSetDocumentStateCommand -> mozilla::SetDocumentStateCommand
- nsDocumentStateCommand -> mozilla::DocumentStateCommand

MozReview-Commit-ID: ImCLDU2JpXT

--HG--
rename : editor/composer/nsComposerCommands.cpp => editor/composer/HTMLEditorCommands.cpp
rename : editor/composer/nsComposerCommands.h => editor/composer/HTMLEditorCommands.h
rename : editor/composer/nsComposerDocumentCommands.cpp => editor/composer/HTMLEditorDocumentCommands.cpp
extra : rebase_source : a9cf88e9efe9f00dc63cca4e3e4fa1f25df9de14
2018-06-15 09:13:31 -07:00
Makoto Kato bedfd9166e Bug 1468708 - Part 4. Use EditorBase::GetPresContext to get nsPresContext in nsComposerDocumentCommands. r=masayuki
MozReview-Commit-ID: 5ubcYtk5Ylj

--HG--
extra : rebase_source : a83029c7f5c3b20d57ed367292baed2641f3a8bf
2018-06-12 16:55:34 -07:00
Makoto Kato 7b8d3f391a Bug 1468708 - Part 3. Clean up local functions not to calculate atom again. r=masayuki
nsComposerCommands has unnecessary atom calculation, so we should remove it.
Also, since nsStyleUpdatingCommand doesn't hava "all" tag names, we don't need
to support it.

MozReview-Commit-ID: Q0EBsK2mxr

--HG--
extra : rebase_source : eecf3314f416e0f77cc364eefc008deb81933ddf
2018-06-15 08:56:25 -07:00
Makoto Kato e4a357f9ab Bug 1468708 - Part 2. Remove unimplemented commands. r=masayuki
Some commands are C++ header only, so we should remove unnecessary headers.

MozReview-Commit-ID: IXP5rLTkW5v

--HG--
extra : rebase_source : 993b90abc00072bb125a066b5fe6d16c4523f2f2
2018-06-12 15:05:56 -07:00
Makoto Kato 95d99759d1 Bug 1468708 - Part 1. Rename nsComposerController to HTMLEditorController. r=masayuki
nsComposerController is execCommand's command controller now.  So it is better
to use mozilla::HTMLEditorController class name instead of nsComposerController.

MozReview-Commit-ID: 7QNFO2dV5Zd

--HG--
rename : editor/composer/nsComposerController.cpp => editor/composer/HTMLEditorController.cpp
rename : editor/composer/nsComposerController.h => editor/composer/HTMLEditorController.h
extra : rebase_source : 413caf298b8583b5de3c6ac011b96ccebf24341e
2018-06-08 16:34:28 +09:00
Boris Zbarsky 1fb03996f4 Bug 1387143 part 29. Remove nsISelection. r=mats 2018-05-08 13:52:42 -04:00
Boris Zbarsky a44e6132ff Bug 1387143 part 28. Remove nsISelection::AsSelection(). r=mats 2018-05-08 13:52:42 -04:00
Boris Zbarsky 1ff99d888e Bug 1387143 part 20. Remove nsISelectionPrivate. r=mats 2018-05-08 13:52:38 -04:00
Kris Maglione a259026c9d Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI. r=mccr8
This also removes any redundant Ci.nsISupports elements in the interface
lists.

This was done using the following script:

acecb401b7/processors/chromeutils-generateQI.jsm

MozReview-Commit-ID: AIx10P8GpZY

--HG--
extra : rebase_source : a29c07530586dc18ba040f19215475ac20fcfb3b
2018-04-22 20:55:06 -07:00
Boris Zbarsky 42cb3dbf9d Bug 1455674 part 6. Mostly remove use of nsIDOMElement in editor. r=masayuki 2018-04-26 23:35:18 -04:00
Boris Zbarsky aab9f97f4e Bug 1455674 part 2. Mostly stop using nsIDOMElement in nsIHTMLEditor. r=masayuki
MozReview-Commit-ID: Koxv2qS2gft
2018-04-26 23:35:18 -04:00
Emilio Cobos Álvarez a1b2e5070a Bug 1455885: Inline and make document casts fatally assert. r=bz
For consistency with AsElement / AsContent / AsDocumentFragment, etc.

MozReview-Commit-ID: 8GSj8R9hLBe
2018-04-26 17:05:12 +02:00
Kris Maglione 219ed0cc06 Bug 1454813: Part 2b - Rename SpawnTask.js to AddTask.js. r=florian
The old name no longer makes sense, since it no longer exports an spawn_task
symbol, and add_task is what we really care about.

MozReview-Commit-ID: IE7B8Czv8DH

--HG--
rename : testing/mochitest/tests/SimpleTest/SpawnTask.js => testing/mochitest/tests/SimpleTest/AddTask.js
extra : rebase_source : 03bca5aa69a7625a49b4455a6c96ce4c59de3a5a
2018-04-18 11:43:45 -07:00
Makoto Kato 6c2bc77ccf Bug 1451972 - Remove more nsIDOMDocument usages from editor. r=masayuki
We should not use nsIDOMDocument if unnecessary. Because it needs QI to access
nsIDocument.

MozReview-Commit-ID: CMF3tmvBTB9

--HG--
extra : rebase_source : e832023be8d59a2c1e01bd423e6f058b0708dfe9
2018-04-06 14:53:05 +09:00
Neil Deakin 6a995d0462 Bug 1448018, remove ContainerBoxObject which is only used to access the docshell, but bug 1448018 made the docshell accessible from the frameloader instead so the container box object is no longer being used. Change some editor tests which just access the docShell directly rather than through the box object, r=bz 2018-03-29 10:44:52 -04:00
Masayuki Nakano 52cffc3290 Bug 1447924 - part 7: Implement AddTransactionListener() and RemoveTransactionListener() in EditorBase and TransactionManager r=m_kato
nsITransactionListener::AddListener() and
nsITransactionListener::RemoveListener() are of course virtual methods.
Additionally, they are safe to call without grabbing the TransactionManager's
instance with local variable.  Therefore, if EditorBase has methods to
add/remove transaction listener to/from its transaction manager, we don't
need EditorBase::GetTransactionManager() anymore.

So, this patch adds AddTransactionListener() and RemoveTransactionListener() to
EditorBase and TransactionManager, and remove
EditorBase::GetTransactionManager() (not nsIEditor's one).

MozReview-Commit-ID: FkPa1YgfagD

--HG--
extra : rebase_source : 8ef7796136804e3d7604c5ca5417fb3379606b93
2018-03-23 18:55:56 +09:00
Masayuki Nakano 6273aa5604 Bug 1447924 - part 4: Optimize NumbeOfUndoItems(), NumbeOfRedoItems(), CanUndo() and CanRedo() of EditorBase r=m_kato
Now, both TransactionManager.h and TransactionStack.h are exposed.  So,
TransactionManager::GetNumberOfUndoItems() and
TransactionManager::GetNumberOfRedoItems() can be rewritten with non-virtual
inline methods because they just return mUndoStack.GetSize() and
mRedoStack.GetSize().  Then, we can implement EditorBase::NumbeOfUndoItems(),
EditorBase::NumberOfRedoItems(), EditorBase::CanUndo() and
EditorBase::CanRedo() as inline methods.

MozReview-Commit-ID: 3CJd0VrlvFY

--HG--
extra : rebase_source : 6848d80a395f1c161e10bfb50d15bd63de288095
2018-03-23 00:08:38 +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
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
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
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
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
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
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
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 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
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 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 151487a675 Bug 1432944 part 10. Remove nsIDOMElement::SetAttribute. r=mccr8
MozReview-Commit-ID: 6eIdX8iA5Rg
2018-01-29 23:28:00 -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 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 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 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
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
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
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
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
Nicholas Nethercote 20ffb0878f Bug 1416622 - Tighten up libpref's process checking. r=glandium
libpref only allows pref modifications in the parent process. This patch
tightens up the checking, which is a bit inconsistent.

- It removes ENSURE_MAIN_PROCESS_WITH_WARNING, which does NS_WARNING on
  failure, and replaces its uses with ENSURE_MAIN_PROCESS, which does NS_ERROR
  on failure. This required adding an XRE_IsParentProcess() check to one place
  in editor/.

- It converts XRE_IsContentProcess() tests to !XRE_IsParentProcess(), because
  we now have multiple kinds of non-parent process.

- It uses ENSURE_MAIN_PROCESS to replace other checking code in a few places.

- It improves a comment in HandleDirty().

MozReview-Commit-ID: D8znQWH7ery

--HG--
extra : rebase_source : ea0fc095b31525bde82a1be217923512d030b76d
2017-11-13 09:19:55 +11:00
Kris Maglione 4a767c7e6e Bug 1404198: Part 2j - Switch to NS_NewTimer* everywhere else. r=njn
MozReview-Commit-ID: LmGIgfmNSmk

--HG--
extra : rebase_source : bf34e852beb0c8f6eafd09184c2e0cda95f95f83
2017-09-24 19:57:48 -07:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Nicholas Nethercote dfd3b7e7aa Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.

- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>

- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
  - Count() --> Length()
  - ObjectAt() --> ElementAt()
  - AppendObject() --> AppendElement()
  - RemoveObjectAt() --> RemoveElementAt()

- ns*Hashtable<nsISupportsHashKey, ...> -->
  ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>

- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
  - This requires adding a Get() method to nsRefPtrHashtable that it lacks but
    nsInterfaceHashtable has.

- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
  - nsArrayBase::Create() --> nsTArray()
  - GetLength() --> Length()
  - do_QueryElementAt() --> operator[]

The patch also has some changes to Rust code that manipulates nsIAtom.

MozReview-Commit-ID: DykOl8aEnUJ

--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1
2017-09-26 08:33:21 +10:00
Makoto Kato daeca3277c Bug 1395443 - DictionaryFetcher::Fetch should initializate nsIContentPrefService2 by idle thread. r=masayuki
When using contenteditable with spellchecker (it is by default), spellchecker will be initialized by mozilla::EditorEventListener::Focus.  This method will call nsEditorSpellCheck::UpdateCurrentDictionary, but this method seems to be slow.

DictionaryFetcher::Fetch gets nsIContentPrefService2 that is implemented by JavaScript, so we should create nsIContentPrefService2 out of Fetch method.

MozReview-Commit-ID: 1fxug0sqD72

--HG--
extra : rebase_source : c46a54f9fc811aace20c54c4a3e468a83c2530d2
2017-09-04 19:57:45 +09:00
Makoto Kato c171902197 Bug 1395080 - Part 1. Replace nsIDOMRange::GetCollapsed with nsRange::Collapsed. r=masayuki
MozReview-Commit-ID: LefqnYBJGec

--HG--
extra : rebase_source : f85c786ee218cf6e8528be8d2d91aa9ac0e3ce97
2017-09-01 12:19:11 +09:00
Makoto Kato 1480dbb45c Bug 1391978 - Part 3. Replace nsISelection::GetIsCollapsed with Selection::IsCollapsed. r=masayuki
MozReview-Commit-ID: AYCX9V8smzm

--HG--
extra : rebase_source : 2c45cffa7d526a9e07126c90f17232b02b1612ea
extra : histedit_source : bd451bdd633df2eb155102f9c3b29b49a25b9c69
2017-08-25 17:48:04 +09:00
Makoto Kato 26ce168fcc Bug 1391978 - Part 1. Replace nsISelection::GetRangeCount with Selection::RangeCount. r=masayuki
I would like to remove more dependency of old nsISelection interface from editor if possible.  So we can replace nsISelection::GetRangeCount with Selection::RangeCount.

MozReview-Commit-ID: 2Mh5ceQI2om

--HG--
extra : rebase_source : 03c8a5b49e2929b0ce6c6af8b78c9677a55a14c4
extra : histedit_source : ca7741379c7cc5b7b938aad22a57f419a2442fd3
2017-08-28 14:52:25 +09:00
Eric Rahm a33f11e0f5 Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.

--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
2017-08-16 16:48:52 -07:00
Nicholas Nethercote 092af8e0a1 Bug 1390428 (part 5) - Remove more nsXPIDLCString uses. r=erahm.
These are all simple cases, with similarities to previous patches in this
series.

--HG--
extra : rebase_source : 6ef36382df9fef217d5cb737e218d65ac062f90a
2017-08-16 14:07:18 +10:00
Nicholas Nethercote 025461bde7 Bug 1390428 (part 1) - Remove many nsXPIDLCString local variables. r=erahm.
These are all easy cases where an nsXPIDLCString local variable is set via
getter_Copies() and then is only used in ways that nsCStrings can also be used
(i.e. no null checks or implicit conversions to |char*|).

In every case the patch trivially replaces the nsXPIDLCString with an
nsCString. (Also, there are a couple of unused nsXPIDLCString variables that
the patch simply removes.)
2017-08-16 13:58:35 +10:00
Masatoshi Kimura be91c9a266 Bug 886907 - Remove old synchronous contentPrefService from the tree. r=adw
MozReview-Commit-ID: BZsB3FR3jHC

--HG--
rename : toolkit/components/contentprefs/ContentPrefService2.jsm => toolkit/components/contentprefs/ContentPrefService2.js
rename : toolkit/components/contentprefs/nsContentPrefService.manifest => toolkit/components/contentprefs/ContentPrefService2.manifest
extra : rebase_source : ab45b7668e97734004502ea776effedcb9b74974
2017-08-11 23:29:55 +09:00
Masayuki Nakano 1bbc0d5920 Bug 1387317 - part4: Make editor flag setters use new AddFlags() or RemoveFlags() if useful r=m_kato
MozReview-Commit-ID: EMDeGfK37Lx

--HG--
extra : rebase_source : 8a2b4e809c608649fbb41edd32d2165db7e77516
2017-08-08 12:36:29 +09:00
Sebastian Hengst 2612b5bcf7 Backed out changeset f92c249cae8b (bug 886907) for failing editor/libeditor/tests/test_bug1368544.html on Android 4.3 debug. r=backout
--HG--
rename : toolkit/components/contentprefs/ContentPrefService2.js => toolkit/components/contentprefs/ContentPrefService2.jsm
rename : toolkit/components/contentprefs/ContentPrefService2.manifest => toolkit/components/contentprefs/nsContentPrefService.manifest
2017-08-15 16:35:07 +02:00
Masatoshi Kimura 8b413e305a Bug 886907 - Remove old synchronous contentPrefService from the tree. r=adw
MozReview-Commit-ID: BZsB3FR3jHC

--HG--
rename : toolkit/components/contentprefs/ContentPrefService2.jsm => toolkit/components/contentprefs/ContentPrefService2.js
rename : toolkit/components/contentprefs/nsContentPrefService.manifest => toolkit/components/contentprefs/ContentPrefService2.manifest
extra : rebase_source : 2d10305f75dbbec173ef8965d159196bfbad77b0
2017-08-11 23:29:55 +09:00
Masayuki Nakano 9ee491b79f Bug 1388001 - part3: Remove nsIEditor argument of nsIHTMLDocument::TearingDownEditor() since it's unused r=smaug
nsIHTMLDocument::TearingDownEditor() takes nsIEditor as an argument.  However, it's not used in it.  So, we can remove it.

MozReview-Commit-ID: KUmIsnVGB6H

--HG--
extra : rebase_source : ddd344b9df18e0b33d54d2f99e6335449f55df81
2017-08-07 14:25:52 +09:00
Masayuki Nakano d66337db9a Bug 1388001 - part2: nsEditingSession should treat editor as HTMLEditor r=m_kato
nsEditingSession should treat editor as HTMLEditor in its internal handling.

MozReview-Commit-ID: 51SfY4oeq3p

--HG--
extra : rebase_source : 90535267e62de17755fff9f21b6a0f74244d849a
2017-08-04 22:53:28 +09:00
Masayuki Nakano fc87c572fa Bug 1388001 - part1: Create nsIEditingSession::GetHTMLEditorForWindow() r=smaug
Some users of HTMLEditor retrieve pointer to editors with nsIEditingSession::GetEditorForWindow() but it returns nsIEditor.  So, there should be a method which returns HTMLEditor*.

MozReview-Commit-ID: Bzc1LIlTSDF

--HG--
extra : rebase_source : f6fb3e5852809487883e3e6fedda9580206b2cb5
2017-08-12 11:44:16 +09:00
Masayuki Nakano 19dc3194d7 Bug 1319340 - part9: Make nsComposerDocumentCommands use concrete class when calling methods of editor r=m_kato
MozReview-Commit-ID: 15WBfUpfo6L

--HG--
extra : rebase_source : 0e729ea9f2a37555836cca869ea1da4174895960
2017-08-07 18:27:16 +09:00
Masayuki Nakano 2978474960 Bug 1319340 - part7: Fix some warnings in nsComposerCommands.h r=m_kato
MozReview-Commit-ID: A0KnOCCWqYZ

--HG--
extra : rebase_source : 35f0ad7b68e8c010eb98532e50bfc107abeefb7f
2017-08-04 18:50:26 +09:00
Masayuki Nakano b5b8d1064d Bug 1319340 - part6: Implement some interface methods as non-virtual methods of EditorBase or HTMLEditor r=m_kato
nsComposerCommands uses some simple getter methods.  They can be simpler non-virtual methods.  So, we should do it.

Note that this changes that EditorBase::GetIsSelectionEditable() won't return error.  However, it has returned error only when selection controller isn't available.  That means that the selection controller has been destroyed and the editor will be destroyed.  So, this must not be problem since it returns false (non-editable) instead and won't break any behavior since the editor won't be editable by users nor JS anymore.

MozReview-Commit-ID: E9ccFspG6na

--HG--
extra : rebase_source : bcd1314cb386fcaf175adabfefde5885decd87c0
2017-08-04 18:30:13 +09:00
Masayuki Nakano efae799abd Bug 1319340 - part5: Make nsComposerCommands use concrete class when calling methods of editor r=m_kato
Compiler may can optimize to call virtual methods at build time if we call them with concrete classes because some of them may have final keyword.

Even if not so, we can optimize some methods with creating non-virtual methods.

MozReview-Commit-ID: K3bRlc0URml

--HG--
extra : rebase_source : 4a76635c7aed29501f71ae74f3f73e2b22ca219e
2017-08-04 17:12:01 +09:00
Masayuki Nakano 6b4db6ec7f Bug 1319340 - part4: SetState() of nsComposerCommands should take HTMLEditor* instead of nsIEditor* r=m_kato
All SetState() methods in nsComposerCommands require HTMLEditor.  So, it should take HTMLEditor* rather than nsIEditor*.

MozReview-Commit-ID: AVbnRsMsmeY

--HG--
extra : rebase_source : 23bcc585a045a39620102c4fef9c1a9e12b9ea37
2017-08-04 16:20:56 +09:00
Masayuki Nakano 505c529148 Bug 1319340 - part3: ToggleState() in nsComposerCommands should take HTMLEditor* instead of nsIEditor* r=m_kato
Similar to GetCurrentState(), all ToggleState() methods require HTMLEditor.  So, they should take HTMLEditor* instead of nsIEditor*.

MozReview-Commit-ID: BwM6WRKFn6Q

--HG--
extra : rebase_source : 425b7b405b5881b97e8113c3ab88e9d0514b6a07
2017-08-04 15:57:57 +09:00
Masayuki Nakano cf8f0ec404 Bug 1319340 - part2: GetCurrentState() of the classes in nsComposerCommands should take HTMLEditor instead of nsIEditor r=m_kato
All GetCurrentState() methods in nsComposerCommands require HTMLEditor but its argument is nsIEditor*.  So, it should take HTMLEditor* and it shouldn't be called if given editor isn't HTMLEditor since it's virtual method.

MozReview-Commit-ID: HsvYJN8hIxN

--HG--
extra : rebase_source : f8f9c8de902af5311771b71a96c76d63325970a5
2017-08-04 15:41:42 +09:00
Masayuki Nakano a2333fc4bb Bug 1060051 - Make editor related interfaces builtin classes if it's possible r=Ehsan,smaug
If we make nsIEditor a builtin class, that means that its instance can be only TextEditor or HTMLEditor.  Then, users of nsIEditor can use concrete classes such as EditorBase, TextEditor or HTMLEditor instead.  Then, the users can reduce unnecessary QI and a lot of virtual calls if we'll create non-virtual methods.

So, let's make editor related interfaces builtin classes.

MozReview-Commit-ID: 93WfsSDuJiJ

--HG--
extra : rebase_source : 39151eb4ffaaf195fec57234ea84c9f4066c58d1
2017-08-04 13:57:56 +09:00
Nicholas Nethercote d4f9aa5530 Bug 1384835 (part 2, attempt 2) - Remove the Preferences::Get*String() variants that return nsAdoptingString. r=froydnj.
--HG--
extra : rebase_source : 6c24fbacb03d4adebe5f22b5e7fc60b069913f20
2017-07-31 14:23:50 +10:00
Sebastian Hengst 1d708511f0 Backed out changeset 5df4d8778602 (bug 1384835) 2017-07-28 10:29:29 +02:00
Nicholas Nethercote 0574a6b496 Bug 1384835 (part 2) - Remove the Preferences::Get*String() variants that return nsAdoptingString. r=froydnj.
Because we want to remove nsAdoptingString. We have other variants that don't
use nsAdoptingString, which can be used instead. There are three basic
patterns.

1. The easiest case is when we don't check for success.

> nsAdoptingString s = Preferences::GetString("foo");
> foo(s);

becomes:

> nsAutoString s;
> Preferences::GetString("foo", s);
> foo(s);

2. The next case is when we check if the result is empty.

> nsAdoptingString s = Preferences::GetString("foo");
> if (s.IsEmpty()) { ... }

becomes:

> nsAutoString s;
> Preferences::GetString("foo", s);
> if (s.IsEmpty()) { ... }

3. The final case is when we null check the result.

> nsAdoptingString s = Preferences::GetString("foo");
> if (s) { ... }

becomes:

> nsAutoString s;
> nsresult rv = Preferences::GetString("foo", s);
> if (NS_SUCCEEDED(rv)) { ... }

The patch also avoids some UTF8/UTF16 conversions in a few places.

--HG--
extra : rebase_source : f339b1a3dda4dc93979d38c30c001fbe77485b55
2017-07-25 20:36:14 +10:00