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

8893 Коммитов

Автор SHA1 Сообщение Дата
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
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
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
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
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
Makoto Kato f47367829a Bug 1487305 - Make HTMLEditor::IsInLink as static method. r=masayuki
Summary:
Now HTMLEditor::IsInLink returns boolean and nsINode if returning true.

I would like to return Element instead of boolean for reducing refcounting
and QI like HTMLEditRules::IsInListItem.

Reviewers: masayuki

Tags: #secure-revision

Bug #: 1487305

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

--HG--
extra : rebase_source : 275629d7e1108b4e56fb39fa745f491bfb55963d
2018-08-30 14:20:24 +09:00
Margareta Eliza Balazs 2fe43133db Merge inbound to mozilla-central. a=merge 2018-08-29 12:43:37 +03:00
Masayuki Nakano 9440d9e3e5 Bug 1485935 - Use NS_IMETHODIMP for implementation of HTMLEditor::GetIsCSSEnabled() r=m_kato
Even though HTMLEditor::GetIsCSSEnabled() is an implementation of an XPCOM
method, it uses nsresult as its return type.  We should change it to
NS_IMETHODIMP.

Additionally, SetDocumentStateCommand::GetCommandStateParams() calls this,
but HTMLEditor can expose non-virtual method, HTMLEditor::IsCSSEnabled().
Therefore, this patch makes it public and makes SetDocumentStateCommand use
HTMLEditor::IsCSSEnabled().

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

--HG--
extra : moz-landing-system : lando
2018-08-28 09:46:53 +00:00
Masayuki Nakano f4b10b4e0f Bug 1485934 - Get rid of nsIHTMLEditor.getFontColorState() r=m_kato
Neither comm-central nor BlueGriffon uses nsIHTMLEditor.getFontColorSetate().
So, we can get rid of this from nsIHTMLEditor.  However, we need to keep it
as a non-virtual public method since it's used by FontColorStateCommand.

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

--HG--
extra : moz-landing-system : lando
2018-08-27 06:52:35 +00:00
Masayuki Nakano ea71b3e52c Bug 1484129 - part 1: Create HTMLEditor::GetNextSelectedTableCellElement() for internal use of nsITableEditor::GetNextCellElement() r=m_kato
nsITableEditor::GetNextCellElement() is an XPCOM method but it's used internally
a lot.  So, HTMLEditor should implement it with non-virtual method and
internal users should use the non-virtual method.

Therefore, this patch creates HTMLEditor::GetNextSelectedTableCellElement().

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

--HG--
extra : moz-landing-system : lando
2018-08-27 06:50:12 +00:00
Masayuki Nakano a010e89cbf Bug 1484129 - part 0: Add automated tests for nsITableEditor::GetNextSelectedCell() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D4193

--HG--
extra : moz-landing-system : lando
2018-08-27 06:50:41 +00:00
arthur.iakab 5527acb8d8 Merge inbound to mozilla-central a=merge 2018-08-25 01:08:22 +03:00
Nicholas Nethercote ac5efebb4b Bug 1486690 - Remove unnecessary checks after moz_xmalloc() calls. r=glandium
There are surprisingly many of them.

(Plus a couple of unnecessary checks after `new` calls that were nearby.)

--HG--
extra : rebase_source : 47b6d5d7c5c99b1b50b396daf7a3b67abfd74fc1
2018-08-28 15:56:01 +10:00
Ehsan Akhgari 35f7627ddb Bug 1485871 - Remove some unused XPCOM registrations for editor; r=masayuki 2018-08-24 09:33:18 -04:00
Masayuki Nakano 5bf1468b39 Bug 1485369 - part 1: HTMLEditor::HideResizers() should not stop cleaning up even if there is no window r=m_kato
Oddly, on 63 Beta simulation, nsIDocument::GetWindow() may return nullptr
when HTMLEditor is being destroyed by unload of the page.  I'm not sure if
this is an expected change.  However, HTMLEditor::HideResizers() should
not stop cleaning up even if it meets unexpected situation.

Additionally, this patch moves all HTMLEditor members related to resizers
to local variables since while HideResizers() is cleaning up old resizers,
the members may be overwritten by ShowResizers() if mutation event listener
or something does something.

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

--HG--
extra : moz-landing-system : lando
2018-08-24 06:27:48 +00:00
Masayuki Nakano 7e89c94490 Bug 1485369 - part 0: Clean up HTMLEditor::HideResizers() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D4056

--HG--
extra : moz-landing-system : lando
2018-08-24 03:46:18 +00:00
Cosmin Sabou 3211507dfb Merge mozilla-inbound to mozilla-central. a=merge 2018-08-24 00:40:14 +03:00
Masayuki Nakano 2306bb5b40 Bug 1484128 - part 1: Create HTMLEditor::GetFirstSelectedTableCellElement() for internal use of HTMLEditor::GetFirstSelectedCell() r=m_kato
HTMLEditor::GetFirstSelectedCell() is an XPCOM method, but used internally a
lot.  Therefore, we should create a non-virtual method for internal use.

This patch creates HTMLEditor::GetFirstSelectedTableCellElement(), and it
won't return NS_SUCCESS_EDITOR_ELEMENT_NOT_FOUND since nobody needs the
value.  It's enough to check whether the result is nullptr without error for
any callers.

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

--HG--
extra : moz-landing-system : lando
2018-08-24 08:29:12 +00:00
Masayuki Nakano 42c125ffe6 Bug 1484128 - part 0: Add automated tests for nsITableEditor::GetFirstSelectedCell() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D4059

--HG--
extra : moz-landing-system : lando
2018-08-24 08:28:06 +00:00
Masayuki Nakano 8799893651 Bug 1485293 - Make test_resizers_resizing_elements.html allow 2px difference of the result r=m_kato
Oddly, on Android, size of resized objects may be 2px different from ideal
value.  I don't know the reason, could be zoom level or something is affected.
However, fortunately, this difference is not important for this test because
this test checks whether resizers actually works with specific elements.
So, even if the result is 2px smaller or bigger than ideal value, we succeeded
to check the resizer makes the element bigger or smaller as expected.

Therefore, this patch makes the test allow 2px differences of the result.

Additionally, on Android, this test is always timed out if TV (even opt build).
So, this patch disables TV on Android.

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

--HG--
extra : moz-landing-system : lando
2018-08-24 08:13:07 +00:00
Masayuki Nakano 65f8dc42b1 Bug 1484127 - part 1: Create HTMLEditor::GetTableCellElementAt() for internal use of nsITableEditor::GetCellAt() r=m_kato
nsITableEditor::GetCellAt() is an XPCOM method, but this is called internally
a lot.  So, we should create non-virtual method for internal use.

The XPCOM method retrieves a <table> element if given element is nullptr.
However, no internal user needs this feature.  So, we can create
GetTableCellElementAt() simply.  Then, we can get rid of nsresult and
ErrorResult from it.

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

--HG--
extra : moz-landing-system : lando
2018-08-23 06:39:30 +00:00
Masayuki Nakano 17d425da91 Bug 1484127 - part 0: Add automated tests for nsITableEditor::GetCellAt() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D3955

--HG--
extra : moz-landing-system : lando
2018-08-23 06:13:22 +00:00
Masayuki Nakano 41eb258e25 Bug 1484125 - part 1: Create TableSize struct to compute and store number of rows and columns of a <table> element r=m_kato
HTMLEditor::GetTableSize() is an XPCOM method but used internally a lot.
Therefore, it shouldn't be called for internal use.  Additionally, the
callers need to declare two int32_t variables, but this causes the code
messy.  Therefore, this patch creates TableSize struct and it implements
HTMLEditor::GetTableSize().  Then, all callers of it is replaced with
TableSize struct.

New TableSize struct does not support computes <table> element from anchor
of Selection since there is no user of this in C++ code.

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

--HG--
extra : moz-landing-system : lando
2018-08-23 07:32:16 +00:00
Masayuki Nakano c5f59ca2f9 Bug 1484125 - part 0: Add automated tests for nsITableEditor::GetTableSize() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D3951

--HG--
extra : moz-landing-system : lando
2018-08-23 06:42:11 +00:00
Masayuki Nakano 6bba243c2c Bug 1484124 - part 1: Create HTMLEditor::GetCellIndexes() class to get and store indexes of a table cell r=m_kato
HTMLEditor::GetCellIndexes() is an XPCOM method and used a lot internally.
So, we need alternative way to retrieve indexes of a cell without virtual
calls.  In a lot of places, receiving indexes with 2 int32_t variables causes
the code messy and that causes making it harder to understand which are
index for same cell and where they come from.  So, making both of them stored
one variable makes the callers simpler.  Therefore, this patch creates
CellIndexes stack class to get and store the result simply.  Then, this makes
all callers of GetCellIndexes() use this new class and makes GetCellIndexes()
also use this new class.

FYI: This patch does NOT put ErrorResult instances in small block scope as far as
possible. The reason is, I see its destructor in profile sometimes. I don't think
that we should use nsresult& instead of ErrorResult& only for this performance
reason, but I think that creating each instance in loops does not make sense.

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

--HG--
extra : moz-landing-system : lando
2018-08-22 03:34:40 +00:00
Masayuki Nakano d344ead994 Bug 1484124 - part 0: Add automated tests for nsITableEditor::GetCellIndexes() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D3848

--HG--
extra : moz-landing-system : lando
2018-08-22 03:35:05 +00:00
Masayuki Nakano 28c6b4ddec Bug 1484115 - part 2: Get rid of nsITableEditor.getNextRow() r=m_kato
Nobody uses nsITableEditor.getNextRow().  Therefore, this patch removes this
XPCOM API.

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

--HG--
extra : moz-landing-system : lando
2018-08-22 06:52:16 +00:00
Masayuki Nakano 9bcbe841c9 Bug 1484115 - part 1: Create HTMLEditor::GetNextTableRowElement() for internal use of nsITableEditor::GetNextRow() r=m_kato
nsITableEditor::GetNextRow() is an XPCOM method.  Therefore, we should have
a non-virtual method for internal use of it.

This changes the definition in nsITableEditor.  First, it allows only <tr>
element as what HTMLEditor::GetNextRow() has actually done.  Then, changes
the return type to Element since it always returns an element node.

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

--HG--
extra : moz-landing-system : lando
2018-08-22 06:52:07 +00:00
Masayuki Nakano 7b00fb391b Bug 1484693 - Fix some nits of test_resizers_resizing_elements.html r=m_kato
There are 2 bugs:

One is a simple mistake. kTest is each item of the tests, kTests is array of
all tests.  When it needs to refer kTest.isAbsolutePosition, it referred
kTests.isAbsolutePosiiton.  Therefore, the test always failed to enable
editing UI for absolute positioned element.

The other is, this test requires to disable inline-table-editing UI (which is
add or remove rows and columns).  Note that even if the UI is disabled,
resizers is available for <table> elements.

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

--HG--
extra : moz-landing-system : lando
2018-08-22 06:44:51 +00:00
Masayuki Nakano 57ac6bcbf2 Bug 1484113 - part 1: Create HTMLEditor::GetFirstTableRowElement() for internal use of nsITableEditor::GetFirstRow() r=m_kato
nsITableEditor::GetFirstRow() is an XPCOM method, so, for internal use,
we should create non-virtual method, that is GetFirstTableRowElement().

This patch makes it never return NS_SUCCESS_EDITOR_ELEMENT_NOT_FOUND since
nobody refers it and it's detectable.  If the method returns nullptr without
error, it's the case of NS_SUCCESS_EDITOR_ELEMENT_NOT_FOUND.

Additionally, this patch changes the return type of GetFirstRow() from
Node to Element since it always return an Element node if not null.

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

--HG--
extra : moz-landing-system : lando
2018-08-22 01:20:23 +00:00
Masayuki Nakano 56de772ab3 Bug 1484113 - part 0: Create automated tests for nsITableEditor::GetFirstRow() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D3779

--HG--
extra : moz-landing-system : lando
2018-08-22 02:16:36 +00:00
Makoto Kato 77fffe84be Bug 1476914 - Add fuzzy-if on Bug 1443902's reftests for Android. r=masayuki
Android's reftest of Bug 1443902 is failed rarely (Bug 1476914, Bug 1475049
Bug 1477502 and Bug 1476129) due to "image comparison, max difference: 1,
number of differing pixels: 1". But I don't know why difference is 1 and
I think that this might be reftest framework for Android or Android emulator
issue.

So I would like to add fuzzy-if as workaround.

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

--HG--
extra : moz-landing-system : lando
2018-08-21 09:29:29 +00:00
Dorel Luca 3fa761ade8 Merge mozilla-inbound to mozilla-central. a=merge 2018-08-21 19:01:08 +03:00
Makoto Kato 539755989c Bug 1484602 - Don't reuse variables in WillDeleteSelection. r=masayuki
HTMLEditRules::WillDeleteSelection is complex since some variables is reused.
So I would like to clean up this to use block scope and EditorDOMPoint
before fixing bug 685799.

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

--HG--
extra : moz-landing-system : lando
2018-08-21 06:54:47 +00:00
Makoto Kato a86db13435 Bug 1484612 - Remove EditSubActionInfo.bOrdered due to unused. r=masayuki
RemoveList doesn't use aListType parameter, but c-c still call this method.
So I keep aListType parameter even if unused.

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

--HG--
extra : moz-landing-system : lando
2018-08-20 12:23:56 +00:00
Dorel Luca d11c177f44 Merge mozilla-central to mozilla-inbound 2018-08-21 12:59:51 +03:00
Masayuki Nakano d33fe8cd6d Bug 1484110 - part 3: HTMLEditor::RefereshEditingUI() should refresh UIs when one of them is changed to enabled or disabled r=m_kato
HTMLEditor::RefereshEditingUI() works only with enabled UIs.  Therefore, if
UI is disabled while it's visible, it keeps shown.  This is too bad if web
apps tries to disable the Gecko specific UIs after we show some of them.

This patch adds HTMLEditor::HideAnonymousEditingUIsIfUnnecessary() to hide
unnecessary UIs and makes RefereshEditingUI() call it always.
2018-08-17 19:03:02 +09:00
Masayuki Nakano a24cf41019 Bug 1484110 - part 2: Rewrite HTMLEditor::HideInlineTableEditingUI() r=m_kato
First, HTMLEditor::HideInlineTableEditingUI() always returns NS_OK.  So, we
can change its return type to void.

Additionally, it removes each UI from the DOM tree one by one.  However, each
mutation could cause showing same UI again.  In such case,
ShowInlineTableEditingUI() overwrites each UI with newly created element.
Then, HTMLEditor cannot remove the old UI anymore.  Therefore, this patch
moves all members of the UI into local variables first.
2018-08-17 18:23:13 +09:00
Masayuki Nakano 7fc2bdaae1 Bug 1484110 - part 1: Create HTMLEditor::RefereshEditingUI() for internal use of nsIHTMLEditor::CheckSelectionStateForAnonymousButtons() r=m_kato
HTMLEditor::CheckSelectionStateForAnonymousButtons() is called a lot internally.
Especially, its virtual call cost may make damage to our performance since
it's called from a selection listener.

So, we should create non-virtual method, RefereshEditingUI() for internal use.
2018-08-17 17:56:28 +09:00