Commit Graph

8963 Commits

Author SHA1 Message Date
Masayuki Nakano
1c08e312af Bug 1497815 - Rename EditorEventListener::EnsureCommitCompoisition() to EditorEventListener::EnsureCommitComposition() r=m_kato
Just fixing typo of the method name.

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

--HG--
extra : moz-landing-system : lando
2018-10-11 09:12:15 +00:00
Masayuki Nakano
5c47cf2ccf Bug 1461708 - part 8: Make EventStateManager handle middle click paste as a default action of mouseup event r=smaug
This patch makes EventStateManager handle middle click paste as a default
action.

Unfortunately, we cannot remove the call of HandleMiddleClickPaste() in
EditorEventListener because it's important to consume middle click event
before any elements in the editor.  For example, if clicked HTMLEditor has
non-editable <a href> element, middle click event needs to be handled by the
editor rather than contentAreaUtils which handles click events of <a href>
elements.  The cause of this kind of issues is, any click event handlers
which handle non-primary button events still listen to "click" events.
Therefore, this patch makes HandleMiddleClickPaste() do nothing if the mouseup
event is fired on an editor.

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

--HG--
extra : moz-landing-system : lando
2018-10-10 12:06:17 +00:00
Masayuki Nakano
9b40433ef6 Bug 1461708 - part 7: Make EventStateManager::HandleMiddleClickPaste() dispatch ePaste event by itself r=smaug
This is preparation of the last patch.  Even if no editor is clicked with
middle button, we need to do:
- collapse Selection at the clicked point.
- dispatch "paste" event.

Therefore, HandleMiddleClickPaste() should dispatch ePaste event by itself
and each editor methods should have a bool argument which the caller wants
ePaste event automatically.

Note that Chromium dispatches "paste" event and pastes clipboard content
into clicked editor even if preceding "auxclick" event is consumed.
However, our traditional behavior is not dispatching "paste" event nor
pasting clipboard content.  Unless Chromium developer keeps their odd
behavior, we should keep our traditional behavior since our behavior is
conforming to DOM event model.

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

--HG--
extra : moz-landing-system : lando
2018-10-10 12:05:39 +00:00
Masayuki Nakano
d581c69689 Bug 1461708 - part 6: Make EditorEventListener::MouseClick() use WidgetMouseEvent instead of dom::MouseEvent r=m_kato
The event argument of only EditorEventListener::MouseClick() can be replaced
with WidgetMouseEvent simply.  So, for avoiding unnecessary RefPtr in
EditorEventListener::HandleEvent(), we should fix this now.

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

--HG--
extra : moz-landing-system : lando
2018-10-10 12:05:21 +00:00
Masayuki Nakano
fd4e78f2a1 Bug 1461708 - part 5: Move EditorEventListener::HandleMiddleClickPaste() to EventStateManager r=smaug
EventStateManager needs to handle middle click paste without editor.
Therefore, the handler should be in EventStateManager.

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

--HG--
extra : moz-landing-system : lando
2018-10-10 12:04:17 +00:00
Masayuki Nakano
d472d6f312 Bug 1461708 - part 4: Move implementation of UIEvent::GetRangeParent() and UIEvent::RangeOffset() to nsLayoutUtils r=smaug
We need to move EditorEventListener::HandleMiddleClickPaste() into
EventStateManager to handle middle click paste after all click events are
dispatched.  This is preparation of the change.

HandleMiddleClickPaste() uses UIEvent::GetRangeParent() and
UIEvent::RangeOffset() to collapse Selection at clicked point.  However,
EventStateManager cannot access them since EventStateManager can handle it
with WidgetMouseEvent.  Fortunately, only WidgetMouseEvent is necessary for
implementing them.  Therefore, we can move the implementation into
nsLayoutUtils and merge them.

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

--HG--
extra : moz-landing-system : lando
2018-10-10 12:03:34 +00:00
Dão Gottwald
b1186958ff Bug 1473927 - Load textbox.css and numberbox.css as document stylesheets. r=paolo 2018-10-09 10:22:15 +02:00
Makoto Kato
e851a155cb Bug 1487301 - Part 2. Set ancestor limitter if no set yet. r=masayuki
The ancestor limiter is set by focus event handler of editor. But window that
is run script has no focus, this event isn't fired by addRange etc.

Some execCommand's commands such as 'forwardDelete' uses WillDeleteSelection
then selection for deletion is set by selection controller (in
TextEditor::ExtendSelectionForDelete). So, due to no ancestor limiter, caret
(and any for delete commands such as CharacterExtendForDelete) can move to out
of editor's root.

So we should set ancestor limiter if nothing. If focus event is received by
user interaction etc, limiter will be set again.

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

--HG--
extra : rebase_source : 240c3bc09b37d46d1ce3245bcca55cafc59454c5
2018-09-20 19:03:24 +09:00
Makoto Kato
eed71e1db2 Bug 1487301 - Part 1. FindSelectionRoot should return Element. r=masayuki
FindSelectionRoot isn't const method and returns already_AddRefed<nsIContent>.
But this method doesn't modify any members and nodes, so we can change to const
method

Also, this method already returns Element, so it shouldn't return nsIContent.

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

--HG--
extra : rebase_source : d4a5dbe96dfc0a71b39f3d5c6d1a4c7ce85f4fa9
2018-09-20 18:53:35 +09:00
arthur.iakab
326255bed6 Backed out changeset 82b600b76a38 (bug 1473927)for marionette failures on test_element_state_chrome.py CLOSED TREE 2018-10-08 23:34:50 +03:00
Dão Gottwald
3444ae75f8 Bug 1473927 - Load textbox.css and numberbox.css as document stylesheets. r=paolo
--HG--
extra : source : 4b1f939f4f3be1dd74f069083032bc1ebd9ea2ff
extra : amend_source : 21277b867aba288c321b1471655fec2302cc7aec
2018-10-08 19:47:56 +02:00
arthur.iakab
b406acca82 Backed out changeset 4b1f939f4f3b (bug 1473927)for build bustages on config/tests/test_mozbuild_reading.py CLOSED TREE 2018-10-08 21:21:21 +03:00
Dão Gottwald
6abcd86863 Bug 1473927 - Load textbox.css and numberbox.css as document stylesheets. r=paolo 2018-10-08 19:47:56 +02:00
Gurzau Raul
ca3641419f Merge inbound to mozilla-central. a=merge
--HG--
rename : docshell/test/bug123696-subframe.html => docshell/test/mochitest/bug123696-subframe.html
rename : docshell/test/bug404548-subframe.html => docshell/test/mochitest/bug404548-subframe.html
rename : docshell/test/bug404548-subframe_window.html => docshell/test/mochitest/bug404548-subframe_window.html
rename : docshell/test/bug413310-post.sjs => docshell/test/mochitest/bug413310-post.sjs
rename : docshell/test/bug413310-subframe.html => docshell/test/mochitest/bug413310-subframe.html
rename : docshell/test/bug529119-window.html => docshell/test/mochitest/bug529119-window.html
rename : docshell/test/bug530396-noref.sjs => docshell/test/mochitest/bug530396-noref.sjs
rename : docshell/test/bug530396-subframe.html => docshell/test/mochitest/bug530396-subframe.html
rename : docshell/test/bug570341_recordevents.html => docshell/test/mochitest/bug570341_recordevents.html
rename : docshell/test/bug668513_redirect.html => docshell/test/mochitest/bug668513_redirect.html
rename : docshell/test/bug668513_redirect.html^headers^ => docshell/test/mochitest/bug668513_redirect.html^headers^
rename : docshell/test/bug691547_frame.html => docshell/test/mochitest/bug691547_frame.html
rename : docshell/test/dummy_page.html => docshell/test/mochitest/dummy_page.html
rename : docshell/test/file_anchor_scroll_after_document_open.html => docshell/test/mochitest/file_anchor_scroll_after_document_open.html
rename : docshell/test/file_bfcache_plus_hash_1.html => docshell/test/mochitest/file_bfcache_plus_hash_1.html
rename : docshell/test/file_bfcache_plus_hash_2.html => docshell/test/mochitest/file_bfcache_plus_hash_2.html
rename : docshell/test/file_bug1121701_1.html => docshell/test/mochitest/file_bug1121701_1.html
rename : docshell/test/file_bug1121701_2.html => docshell/test/mochitest/file_bug1121701_2.html
rename : docshell/test/file_bug1151421.html => docshell/test/mochitest/file_bug1151421.html
rename : docshell/test/file_bug1186774.html => docshell/test/mochitest/file_bug1186774.html
rename : docshell/test/file_bug1450164.html => docshell/test/mochitest/file_bug1450164.html
rename : docshell/test/file_bug385434_1.html => docshell/test/mochitest/file_bug385434_1.html
rename : docshell/test/file_bug385434_2.html => docshell/test/mochitest/file_bug385434_2.html
rename : docshell/test/file_bug385434_3.html => docshell/test/mochitest/file_bug385434_3.html
rename : docshell/test/file_bug475636.sjs => docshell/test/mochitest/file_bug475636.sjs
rename : docshell/test/file_bug509055.html => docshell/test/mochitest/file_bug509055.html
rename : docshell/test/file_bug511449.html => docshell/test/mochitest/file_bug511449.html
rename : docshell/test/file_bug540462.html => docshell/test/mochitest/file_bug540462.html
rename : docshell/test/file_bug580069_1.html => docshell/test/mochitest/file_bug580069_1.html
rename : docshell/test/file_bug580069_2.sjs => docshell/test/mochitest/file_bug580069_2.sjs
rename : docshell/test/file_bug590573_1.html => docshell/test/mochitest/file_bug590573_1.html
rename : docshell/test/file_bug590573_2.html => docshell/test/mochitest/file_bug590573_2.html
rename : docshell/test/file_bug598895_1.html => docshell/test/mochitest/file_bug598895_1.html
rename : docshell/test/file_bug598895_2.html => docshell/test/mochitest/file_bug598895_2.html
rename : docshell/test/file_bug634834.html => docshell/test/mochitest/file_bug634834.html
rename : docshell/test/file_bug598895_1.html => docshell/test/mochitest/file_bug637644_1.html
rename : docshell/test/file_bug598895_2.html => docshell/test/mochitest/file_bug637644_2.html
rename : docshell/test/file_bug640387.html => docshell/test/mochitest/file_bug640387.html
rename : docshell/test/file_bug653741.html => docshell/test/mochitest/file_bug653741.html
rename : docshell/test/file_bug660404 => docshell/test/mochitest/file_bug660404
rename : docshell/test/file_bug660404-1.html => docshell/test/mochitest/file_bug660404-1.html
rename : docshell/test/file_bug660404^headers^ => docshell/test/mochitest/file_bug660404^headers^
rename : docshell/test/file_bug653741.html => docshell/test/mochitest/file_bug662170.html
rename : docshell/test/file_bug668513.html => docshell/test/mochitest/file_bug668513.html
rename : docshell/test/file_bug669671.sjs => docshell/test/mochitest/file_bug669671.sjs
rename : docshell/test/file_bug675587.html => docshell/test/mochitest/file_bug675587.html
rename : docshell/test/file_bug680257.html => docshell/test/mochitest/file_bug680257.html
rename : docshell/test/file_bug703855.html => docshell/test/mochitest/file_bug703855.html
rename : docshell/test/file_bug728939.html => docshell/test/mochitest/file_bug728939.html
rename : docshell/test/file_close_onpagehide1.html => docshell/test/mochitest/file_close_onpagehide1.html
rename : docshell/test/file_close_onpagehide2.html => docshell/test/mochitest/file_close_onpagehide2.html
rename : docshell/test/file_framedhistoryframes.html => docshell/test/mochitest/file_framedhistoryframes.html
rename : docshell/test/file_pushState_after_document_open.html => docshell/test/mochitest/file_pushState_after_document_open.html
rename : docshell/test/historyframes.html => docshell/test/mochitest/historyframes.html
rename : docshell/test/mochitest.ini => docshell/test/mochitest/mochitest.ini
rename : docshell/test/start_historyframe.html => docshell/test/mochitest/start_historyframe.html
rename : docshell/test/test_anchor_scroll_after_document_open.html => docshell/test/mochitest/test_anchor_scroll_after_document_open.html
rename : docshell/test/test_bfcache_plus_hash.html => docshell/test/mochitest/test_bfcache_plus_hash.html
rename : docshell/test/test_bug1045096.html => docshell/test/mochitest/test_bug1045096.html
rename : docshell/test/test_bug1121701.html => docshell/test/mochitest/test_bug1121701.html
rename : docshell/test/test_bug1151421.html => docshell/test/mochitest/test_bug1151421.html
rename : docshell/test/test_bug1186774.html => docshell/test/mochitest/test_bug1186774.html
rename : docshell/test/test_bug123696.html => docshell/test/mochitest/test_bug123696.html
rename : docshell/test/test_bug1450164.html => docshell/test/mochitest/test_bug1450164.html
rename : docshell/test/test_bug384014.html => docshell/test/mochitest/test_bug384014.html
rename : docshell/test/test_bug385434.html => docshell/test/mochitest/test_bug385434.html
rename : docshell/test/test_bug387979.html => docshell/test/mochitest/test_bug387979.html
rename : docshell/test/test_bug402210.html => docshell/test/mochitest/test_bug402210.html
rename : docshell/test/test_bug404548.html => docshell/test/mochitest/test_bug404548.html
rename : docshell/test/test_bug413310.html => docshell/test/mochitest/test_bug413310.html
rename : docshell/test/test_bug475636.html => docshell/test/mochitest/test_bug475636.html
rename : docshell/test/test_bug509055.html => docshell/test/mochitest/test_bug509055.html
rename : docshell/test/test_bug511449.html => docshell/test/mochitest/test_bug511449.html
rename : docshell/test/test_bug529119-1.html => docshell/test/mochitest/test_bug529119-1.html
rename : docshell/test/test_bug529119-2.html => docshell/test/mochitest/test_bug529119-2.html
rename : docshell/test/test_bug530396.html => docshell/test/mochitest/test_bug530396.html
rename : docshell/test/test_bug540462.html => docshell/test/mochitest/test_bug540462.html
rename : docshell/test/test_bug551225.html => docshell/test/mochitest/test_bug551225.html
rename : docshell/test/test_bug570341.html => docshell/test/mochitest/test_bug570341.html
rename : docshell/test/test_bug580069.html => docshell/test/mochitest/test_bug580069.html
rename : docshell/test/test_bug590573.html => docshell/test/mochitest/test_bug590573.html
rename : docshell/test/test_bug598895.html => docshell/test/mochitest/test_bug598895.html
rename : docshell/test/test_bug634834.html => docshell/test/mochitest/test_bug634834.html
rename : docshell/test/test_bug637644.html => docshell/test/mochitest/test_bug637644.html
rename : docshell/test/test_bug640387_1.html => docshell/test/mochitest/test_bug640387_1.html
rename : docshell/test/test_bug640387_2.html => docshell/test/mochitest/test_bug640387_2.html
rename : docshell/test/test_bug653741.html => docshell/test/mochitest/test_bug653741.html
rename : docshell/test/test_bug660404.html => docshell/test/mochitest/test_bug660404.html
rename : docshell/test/test_bug662170.html => docshell/test/mochitest/test_bug662170.html
rename : docshell/test/test_bug668513.html => docshell/test/mochitest/test_bug668513.html
rename : docshell/test/test_bug669671.html => docshell/test/mochitest/test_bug669671.html
rename : docshell/test/test_bug675587.html => docshell/test/mochitest/test_bug675587.html
rename : docshell/test/test_bug680257.html => docshell/test/mochitest/test_bug680257.html
rename : docshell/test/test_bug691547.html => docshell/test/mochitest/test_bug691547.html
rename : docshell/test/test_bug694612.html => docshell/test/mochitest/test_bug694612.html
rename : docshell/test/test_bug703855.html => docshell/test/mochitest/test_bug703855.html
rename : docshell/test/test_bug728939.html => docshell/test/mochitest/test_bug728939.html
rename : docshell/test/test_bug797909.html => docshell/test/mochitest/test_bug797909.html
rename : docshell/test/test_close_onpagehide_by_history_back.html => docshell/test/mochitest/test_close_onpagehide_by_history_back.html
rename : docshell/test/test_close_onpagehide_by_window_close.html => docshell/test/mochitest/test_close_onpagehide_by_window_close.html
rename : docshell/test/test_forceinheritprincipal_overrule_owner.html => docshell/test/mochitest/test_forceinheritprincipal_overrule_owner.html
rename : docshell/test/test_framedhistoryframes.html => docshell/test/mochitest/test_framedhistoryframes.html
rename : docshell/test/test_pushState_after_document_open.html => docshell/test/mochitest/test_pushState_after_document_open.html
rename : docshell/test/test_triggeringprincipal_location_seturi.html => docshell/test/mochitest/test_triggeringprincipal_location_seturi.html
rename : docshell/test/test_windowedhistoryframes.html => docshell/test/mochitest/test_windowedhistoryframes.html
rename : docshell/test/url1_historyframe.html => docshell/test/mochitest/url1_historyframe.html
rename : docshell/test/url2_historyframe.html => docshell/test/mochitest/url2_historyframe.html
rename : third_party/rust/syn/src/parsers.rs => third_party/rust/syn-0.14.6/src/parsers.rs
rename : third_party/rust/syn/src/verbatim.rs => third_party/rust/syn-0.14.6/src/verbatim.rs
rename : third_party/rust/uuid/.travis.yml => third_party/rust/uuid-0.5.1/.travis.yml
rename : third_party/rust/uuid/src/rustc_serialize.rs => third_party/rust/uuid-0.5.1/src/rustc_serialize.rs
rename : third_party/rust/uuid/src/serde.rs => third_party/rust/uuid-0.5.1/src/serde.rs
2018-10-02 19:03:40 +03:00
Andrew McCreight
837f0af066 Bug 1493737 - Fix many trivial calls to do_QueryInterface r=smaug
If class A is derived from class B, then an instance of class A can be
converted to B via a static cast, so a slower QI is not needed.

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

--HG--
extra : moz-landing-system : lando
2018-10-01 21:38:01 +00:00
Ehsan Akhgari
5f0be07390 Bug 1493563 - Part 5: Present the old state and the content blocking log to the web progress listeners; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D6595
2018-09-28 14:46:02 -04:00
Noemi Erli
4419e20e14 Backed out 12 changesets (bug 1493563) for failures in test_css-logic-getCssPath.html CLOSED TREE
Backed out changeset d2e83655082f (bug 1493563)
Backed out changeset 1ce58f004593 (bug 1493563)
Backed out changeset 344298c73ee7 (bug 1493563)
Backed out changeset 02b8b073f7d7 (bug 1493563)
Backed out changeset 3ef707008502 (bug 1493563)
Backed out changeset bb2720a401fe (bug 1493563)
Backed out changeset ce0211be57a1 (bug 1493563)
Backed out changeset 83d6c2bf8dc6 (bug 1493563)
Backed out changeset 1844af4cc25b (bug 1493563)
Backed out changeset c8ab17addb7a (bug 1493563)
Backed out changeset a1ff0cd62563 (bug 1493563)
Backed out changeset 932b41e211e0 (bug 1493563)
2018-09-28 21:31:18 +03:00
Ehsan Akhgari
f0108e78c2 Bug 1493563 - Part 5: Present the old state and the content blocking log to the web progress listeners; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D6595
2018-09-28 13:24:41 -04:00
Emilio Cobos Álvarez
864a303a8c Bug 1494622 - Remove nsDOMCSSRGBColor. r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D7068
2018-09-27 16:11:42 +02:00
Masayuki Nakano
20d1804f6b Bug 1484111 - part 1: Create HTMLEditor::InsertTableCellsWithTransaction() for internal use of nsITableEditor::InsertTableCell() r=m_kato
nsITableEditor::InsertTableCell() is an XPCOM method but used internally.  So,
HTMLEditor should implement it with a non-virtual method and all internal users
should use it instead.

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

--HG--
extra : moz-landing-system : lando
2018-09-20 11:44:35 +00:00
Masayuki Nakano
3a48cf1623 Bug 1484111 - part 0: Add automated tests for nsITableEditor.insertTableCell.html r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D6258

--HG--
extra : moz-landing-system : lando
2018-09-20 11:44:33 +00:00
Masayuki Nakano
9c1afc4bee Bug 1484116 - part 1: Create HTMLEditor::InsertTableColumnsWithTransaction() for internal use of nsITableEditor::InsertTableColumn() r=m_kato
nsITableEditor::InsertTableColumn() is an XPCOM method but it's used internally.
So, HTMLEditor should implement it with a non-virtual method and internal
users should use it instead.

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

--HG--
extra : moz-landing-system : lando
2018-09-20 09:15:08 +00:00
Masayuki Nakano
3582509a37 Bug 1484116 - part 0: Add automated tests for nsITableEditor.insertTableColumn() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D6256

--HG--
extra : moz-landing-system : lando
2018-09-20 09:15:06 +00:00
Masayuki Nakano
aa8e14f9d7 Bug 1484117 - part 0: Add automated tests for nsITableEditor.insertTableRow() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D6178

--HG--
extra : moz-landing-system : lando
2018-09-20 04:45:18 +00:00
Masayuki Nakano
3e96aa79b3 Bug 1484117 - part 1: Create HTMLEditor::InsertTableRowsWithTransaction() for internal use of nsITableEditor::InsertTableRow() r=m_kato
nsITableEditor::InsertTableRow() is an XPCOM method but there are some internal
users.  So, HTMLEditor should implement it with a non-virtual method and
it should be used by all internal users.

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

--HG--
extra : moz-landing-system : lando
2018-09-20 06:55:17 +00:00
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