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

8937 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 3113cbebc3 Bug 1484119 - part 2: Make HTMLEditor::DeleteTableCellWithTransaction() remove <table> element if it becomes empty r=m_kato
HTMLEditor::DeleteTableCellWithTransaction() does not remove <table> element
even if it becomes empty only when 2 or more cell elements are selected.
Therefore, we should check table size before removing a row and if it's the
last row, the method should remove <table>.

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

--HG--
extra : moz-landing-system : lando
2018-09-19 09:00:06 +00:00
Masayuki Nakano 80a2f99daf Bug 1484119 - part 1: Create HTMLEditor::DeleteTableCellWithTransaction() for internal use of nsITableEditor::DeleteTableCell() r=m_kato
nsITableEditor::DeleteTableCell() is an XPCOM method but used internally.
So, HTMLEditor should implement it with non-virtual method and use it
internally.

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

--HG--
extra : moz-landing-system : lando
2018-09-19 08:50:11 +00:00
Masayuki Nakano 45c321017b Bug 1484119 - part 0: Add automated tests for nsITableEditor.deleteTableCell.html r=m_kato
Although this has a lot of todo_is() since this API is really broken.

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

--HG--
extra : moz-landing-system : lando
2018-09-19 02:03:29 +00:00
Masayuki Nakano 2e78564a84 Bug 1484120 - part 1: Create HTMLEditor::DeleteTableCellContentsWithTransaction() for internal use of nsITableEditor::DeleteTableCellContents() r=m_kato
nsITableEditor::DeleteTableCellContents() is an XPCOM method but it's used
internally.  So, HTMLEditor should implement it with a non-virtual method
and all internal users should use the non-virtual method instead.

This patch adds HTMLEditor::DeleteTableCellContentsWithTransaction() for that.
Additionally, this patch renames its helper method DeleteCellContents() to
DeleteAllChidlrenWithTransaction() and moves it to HTMLEditor.cpp since it can
handle any element nodes.

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

--HG--
extra : moz-landing-system : lando
2018-09-19 01:58:48 +00:00
Masayuki Nakano 1ad41381cc Bug 1484120 - part 0: Add automated tests for nsITableEditor.deleteTableCellContents.html r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D6173

--HG--
extra : moz-landing-system : lando
2018-09-19 01:58:51 +00:00
Masayuki Nakano 1a3e84fbef Bug 1484121 - part 2: Clean up HTMLEditor::DeleteColumn() r=m_kato
This patch renames HTMLEditor::DeleteColumn() to
HTMLEditor::DeleteTableColumnWithTransaction() and cleans up its implementation.

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

--HG--
extra : moz-landing-system : lando
2018-09-19 06:39:31 +00:00
Masayuki Nakano 7f96a82ad5 Bug 1484121 - part 1: Create HTMLEditor::DeleteSelectedTableColumnsWithTransaction() for internal use of nsITableEditor::DeleteTableColumn() r=m_kato
nsITableEditor::DeleteTableColumn() is an XPCOM method but used internally.
So, it should be implemented with non-virtual method and internal users
should use it.

Note that this changes only one thing.  This moves
|AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(...| from
below DeleteTableElementAndChildrenWithTransaction() to above it.
I.e., DeleteTableElementAndChildrenWithTransaction() works under
EditSubAction::eDeleteNode as the top level sub-action now.  This is same
as DeleteSelectedTableRowsWithTransaction().  Therefore, the difference
with it when it removes <table> is now fixed.

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

--HG--
extra : moz-landing-system : lando
2018-09-19 06:34:33 +00:00
Masayuki Nakano cf2eb50a7b Bug 1484121 - part 0: Add automated tests for nsITableEditor.deleteTableColumn() r=m_kato
This add automated tests for nsITableEditor.deleteTableColumn().

However, this contains some fixes of existing code since with those bugs,
the test isn't passed even in the simplest case.

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

--HG--
extra : moz-landing-system : lando
2018-09-19 04:32:10 +00:00
Makoto Kato a5335ab3ea Bug 1491199 - Get rid of nsIEditorBlobListener. r=masayuki
Since bug 1489812 is landed, we can get rid of nsIEditorBlobListener.

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

--HG--
extra : moz-landing-system : lando
2018-09-18 04:34:21 +00:00
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