Commit Graph

8928 Commits

Author SHA1 Message Date
Masayuki Nakano
ee53372956 Bug 1484122 - part 2: Clean up HTMLEditor::DeleteRow() r=m_kato
This patch renames HTMLEditor::DeleteRow() to
HTMLEditor::DeleteTableRowWithTransaction() and cleans up its implementation.

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

--HG--
extra : moz-landing-system : lando
2018-09-18 08:31:00 +00:00
Masayuki Nakano
47fa32ffd8 Bug 1484122 - part 1: Create HTMLEditor::DeleteSelectedTableRowsWithTransaction() for internal use of nsITableEditor::DeleteTableRow() r=m_kato
nsITableEditor::DeleteTableRow() is an XPCOM method but there are some internal
users.  So, it should be implemented as non-virtual protected method and
internal users should use it instead.

This also renames (and reimplement) HTMLEditor::DeleteTable2() since it's
really bad name and the code dispatches unnecessary "selectionchange" events.

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

--HG--
extra : moz-landing-system : lando
2018-09-18 07:56:45 +00:00
Masayuki Nakano
3d69a1f95e Bug 1484122 - part 0: Add automated tests for nsITableEditor.deleteTableRow.html r=m_kato
This patch changes a bit in HTMLEditor::DeleteTableRow() because calling
DeleteTable2() without those helper classes hits MOZ_ASSERT().

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

--HG--
extra : moz-landing-system : lando
2018-09-18 07:25:58 +00:00
Makoto Kato
f3b8a60bde Bug 1491191 - Remove unused methods in nsIEditorMailSupport. r=masayuki
Since I have landed bug 1489939, comm-central only uses rewrap method in
nsIEditorMailSupport.  And insertAsCitedQuotation is used by the test of
editor/libeditor/tests/test_bug616590.xul.

Other methods are unused now, so let's remove these from nsIEditorMailSupprt,
and move it to HTMLEditor.  Also, pasteAsQuotation is unused now even if
BlueGriffon.

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

--HG--
extra : moz-landing-system : lando
2018-09-14 10:03:24 +00:00
Ehsan Akhgari
9fe0e0670a Bug 1491605 - Remove nsIControllerCommandGroup because it is dead code; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5965
2018-09-17 09:54:04 -04:00
Ehsan Akhgari
ad7b8c9b02 Bug 1491569 - Remove the XPCOM registration for mozSpellChecker; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D5946
2018-09-15 20:13:51 -04:00
Masayuki Nakano
6dae86b837 Bug 1484133 - part 1: Create non-virtual HTMLEditor::GetSelectedOrParentTableElement() r=m_kato
nsITableEditor::GetSelectedOrParentTableElement() is of course an XPCOM method,
but it's used internally.  So, there should be non-virtual method.

On the other hand, this API is too ugly.  Returns various information but each
meaning is not clear.  So, result of the new non-virtual method should be
simpler.

This patch creates the new method as:
- returns found element
- takes ErrorResult to return error code.
- takes optional out-param for returning if a cell is selected.

Then, nsITableEditor::GetSelectedOrParentTableElement() can compute its
result from them with Selection.

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

--HG--
extra : moz-landing-system : lando
2018-09-14 12:56:22 +00:00
Masayuki Nakano
9162d2e014 Bug 1484133 - part 0: Add automated tests for nsITableEditor.getSelectedOrParentTableElement() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D5727

--HG--
extra : moz-landing-system : lando
2018-09-14 12:54:43 +00:00
Masayuki Nakano
34e624bd86 Bug 1484131 - part 1: Create HTMLEditor::CellAndIndexes struct to store cell element and its indexes in the <table> r=m_kato
If a cell element and its indexes in the <table> are stored in a struct,
it makes the user methods easier to read.  Therefore, this patch implement
such struct as HTMLEditor::CellAndIndexes and make it finds first selected
cell and indexes with its method.  Finally, this reimplement
HTMLEditor::GetFirstSelectedCellInTable() with it.

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

--HG--
extra : moz-landing-system : lando
2018-09-14 12:51:05 +00:00
Masayuki Nakano
c6464efa59 Bug 1484131 - part 0: Add automated tests for nsITableEditor.getFirstSelectedCellInTable() and fixes a crash bug of it r=m_kato
This adds automated tests for nsITableEditor.getFirstSelectedCellInTable().
However, this test crashes due to regression of bug 1484128.  So, we need
to uplift only this fix into the Beta.

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

--HG--
extra : moz-landing-system : lando
2018-09-14 12:49:46 +00:00
Masayuki Nakano
a5d4bac990 Bug 1484123 - Create non-virtual HTMLEditor::NormalizeTable() for internal use of nsITableEditor::NormalizeTable() r=m_kato
I tried to create automated tests for nsITableEditor::NormalizeTable().
However, this method cannot normalize any broken table element.  The method
always returns error after calling HTMLEditor::FixBadRowSpan().  The reason
is that HTMLEditor::FixBadRowSpan() scans all cells in each row with a for
loop, and then, when it fails to find a cell element, it returns error even
though this method needs to fix the odd situation.  According to the history
of editor changes, each important point hasn't been changed since first
implementation.  So, perhaps, table layout API behavior was changed but
no automated tests couldn't detect the regression since we really don't have
enough tests for editor.

Anyway, this patch makes most part of nsITableEditor::NormalizeTable() with
non-virtual method, HTMLEditor::NormalizeTable().

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

--HG--
extra : moz-landing-system : lando
2018-09-13 08:03:56 +00:00
Masayuki Nakano
d9b9a8b93b Bug 1490882 - Fix a bug of test_middle_click_paste.html r=m_kato
When I added some tests into test_middle_click_paste.html, I realized that
SimpleTest.waitForClipboard() in copyHTMLContent() fails to copy the
HTML fragment to clipboard and just quit the test.  Therefore, only the
last tests are ignored always.

The reason is, iframe.contentDocument.getSelection() returns nullptr
since the frame becomes visible immediately before accessing the Selection.

This patch makes flushing the pending layout with scrollTop.  This makes
getSelection() return non-null.

However, unfortunately, only on Linux, it fails to copy the content.  I'm
still not sure the reason. This patch just avoids running the last part
only on Linux.

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

--HG--
extra : moz-landing-system : lando
2018-09-14 07:20:04 +00:00
Makoto Kato
678de76911 Bug 1459108 - Skip spellcheck-textarea-ref2.html on Andorid. r=masayuki
Although this reftest is sometimes failure on Android, it is no meaning to run
this test on Android due to no spellchekcer on Firefox Android.

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

--HG--
extra : moz-landing-system : lando
2018-09-13 08:31:59 +00:00
Andreea Pavel
dbdfde9c61 Bug 1489980 - Enable ESLint for editor/ - Follow-up: Remove unused Ci. r=eslint-fix on a CLOSED TREE
--HG--
extra : amend_source : b2b05ef32c8d217120e280d364db0c70f09300f9
2018-09-13 13:29:24 +03:00
Margareta Eliza Balazs
850a93cf13 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-09-13 13:02:36 +03:00
Mark Banner
e824d800fb Bug 1489980 - Enable ESLint for editor/ - Manual fixes. r=masayuki
This enables the editor directory to be linted, and fixes the remaining issues raised by ESLint. Various rules were fixed here including, no-shadow, no-undef, no-unused-vars and others.

I've generally gone conservative, disabling rules where it doesn't make sense to fix them (e.g. sometimes suggests use-services for tests, but it is only used once, or within a Chrome script).

Depends on D5585

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

--HG--
extra : moz-landing-system : lando
2018-09-13 07:59:47 +00:00
Mark Banner
d5e3a6a9e5 Bug 1489980 - Enable ESLint for editor/ - automatic fixes r=masayuki
These are all automatically generated by ESLint with the --fix option.

Depends on D5584

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

--HG--
extra : moz-landing-system : lando
2018-09-13 07:58:19 +00:00
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
Bogdan Tara
11a51e4c3d Merge inbound to mozilla-central. a=merge 2018-09-12 01:12:32 +03: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
65f44ebf27 Bug 1489790 - Part 8: Remove the XPCOM component registration for @mozilla.org/editor/editorcontroller;1; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5363
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
Cosmin Sabou
de7676288a Merge mozilla-inbound to mozilla-central. a=merge 2018-09-11 13:06:37 +03:00
Masayuki Nakano
a527ce6536 Bug 1484136 - Create HTMLEditor::RefreshGrabberInternal() for internal use r=m_kato
HTMLEditor::RefereshGrabber() is an XPCOM method which is used by BlueGriffon.
Additionally, it's called internally.  Therefore, we should create a non-virtual
method for this and all internal users should use it.

This patch renames all other related methods to *Internal() for consistency.
Additionally, this fixes a bug of nested calls of ShowGrabber() and
HideGrabber().  This makes CreateGrabber() sets mGrabber directly since
it may be cleared by HideGrabber() while it's running, and also makes
HideGrabber() moves all members who will be cleaned up with local variables
and always clean them up even if it meats an error.

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

--HG--
extra : moz-landing-system : lando
2018-09-11 05:30:33 +00:00
Ehsan Akhgari
9fcc4e5b9a Bug 1489812 - Part 2: Remove @mozilla.org/editor-utils;1; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D5374
2018-09-10 08:42:27 -04:00
Ehsan Akhgari
d19f79f590 Bug 1489812 - Part 1: Port nsIEditorUtils.slurpBlob() to C++; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D5373
2018-09-10 08:42:26 -04:00
Ehsan Akhgari
7a9998cefe Bug 1489787 - Part 3: Decomtaminate nsComposeTxtSrvFilter; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D5355
2018-09-10 08:15:00 -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
d212ff2809 Bug 1489787 - Part 1: Remove nsITextServicesFilter and replace nsIEditorSpellCheck.setFilter() with nsIEditorSpellCheck.setFilterType(); r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D5353
2018-09-10 08:14:59 -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
Masayuki Nakano
63856d6d6e Bug 1485929 - Create HTMLEditor::RefreshInlineTableEditingUIInternal() for internal use r=m_kato
HTMLEditor::RefreshInlineTableEditingUI() is an XPCOM method.  Therefore,
we should create a non-virtual method for internal use.

Additionally, this patch makes related methods safer for nested calls of
ShowInlineTableEditingUI() and HideInlineTableEditingUI().  If
ShowInlineTableEditingUI() and RefreshInlineTableEditingUIInternal() detects
hiding or replacing current UI, they return error to make the callers stop
handling anything for new UI.

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

--HG--
extra : moz-landing-system : lando
2018-09-11 12:10:54 +00:00
Cosmin Sabou
5294f1000c Merge mozilla-central to autoland. a=merge
--HG--
rename : layout/tools/reftest/bootstrap.js => layout/tools/reftest/api.js
rename : layout/tools/reftest/install.rdf => layout/tools/reftest/manifest.json
extra : rebase_source : 69518845c89f7d49cb2644ee5110ff21bf46578d
2018-09-11 13:14:31 +03:00
Masayuki Nakano
811a32c96f Bug 1485927 - Get rid of nsIHTMLObjectResizers.resizedObject r=m_kato
nsIHTMLObjectResizers.resizedObject is used only for avoiding warning of
nsIHTMLObjectResizers.refreshResizers() if resizers are not visible.
Therefore, if we remove the unnecessary warnings, we can get rid of the
attribute.

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

--HG--
extra : moz-landing-system : lando
2018-09-11 05:02:30 +00:00
Masayuki Nakano
9762aae24f Bug 1485921 - Create HTMLEditor::RefreshResizersInternal() for internal use r=m_kato
HTMLEditor::RefreshResizers() is an XPCOM method but it's used internally.  So,
HTMLEditor should implement it with non-virtual method and use new one for
internal use.

This patch also makes related methods nested-creation of resizers aware.  This
issue must not be dangerous, but looks like buggy.

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

--HG--
extra : moz-landing-system : lando
2018-09-11 08:15:52 +00:00
Makoto Kato
7a9297b3ac Bug 1490192 - Get rid of nsIEditorMailSupport.getEmbeddedObjects. r=masayuki
Since I have landed bug 1478546, no one (inc. bluegriffon) uses this method.

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

--HG--
extra : moz-landing-system : lando
2018-09-11 07:24:27 +00: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
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
Andrew Swan
62bcb25a7c Bug 1451503 Move most reftest resources from chrome: to resource: r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D5232

--HG--
extra : rebase_source : 00223dacf6cfdfc4bb8505405844f66c7134e2c0
extra : histedit_source : 2d1f6e353e394520038c05b07bcd08ce06908cf2
2018-09-06 16:01:39 -07:00
Masayuki Nakano
908ba601c1 Bug 1485925 - part 1: Create HTMLEditor::HideResizersInternal() for internal use r=m_kato
HTMLEditor::HideResizers() is an XPCOM method, so, we should create non-virtual
method for internal use.

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

--HG--
extra : moz-landing-system : lando
2018-09-06 05:02:46 +00:00
Masayuki Nakano
c4c2c747a5 Bug 1485925 - part 0: Add automated test for nsIHTMLObjectResizer_hideResizers.html r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D4922

--HG--
extra : moz-landing-system : lando
2018-09-05 10:51:35 +00:00
Masayuki Nakano
3e09e244fd Bug 1485923 - Remove nsIHTMLObjectResizer.showResizers(), rename HTMLEditor::ShowResizers() to HTMLEditor::ShowResizersInternal() and merge it with HTMLEditor::ShowResizersInner() r=m_kato
First, nobody uses nsIHTMLObjectResizer.showResizers().  So, we can remove it.

Then, we have two private methods, one is non-virtual
HTMLEditor::ShowResizers(), and the other is HTMLEditor::ShowResizersInner().
HTMLEditor::ShowResizers() calls HTMLEditor::ShowResizersInner() and if
it fails, calls HideResizers().  However, in some cases, e.g., when it already
has visible resizers, hiding resizers does not make sense.

So, this patch removes non-virtual HTMLEditor::ShowResizers() method too,
then, renames HTMLEditor::ShowResizersInner() to HTMLEditor::ShowResizers(),
finally, it hides resizers only when it fails to setup resizers for keeping
resizers hidden.

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

--HG--
extra : moz-landing-system : lando
2018-09-06 04:38:00 +00:00
Masayuki Nakano
aef6842da1 Bug 1488333 - Enable some mochitests for editor which were disabled on debug build of Android due to bug 1480702 r=m_kato
Because of the rewrite of test_request.html, now, we can enable the mochitests
for editor which were disabled on debug build of Android due to bug 1480702.

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

--HG--
extra : moz-landing-system : lando
2018-09-05 09:27:01 +00:00