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

16 Коммитов

Автор SHA1 Сообщение Дата
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 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 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 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 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 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 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
Boris Zbarsky 0f8f7f6fba Bug 1463981 part 2. Remove use of nsIDOMNode in editor xpidl. r=masayuki 2018-05-24 13:18:34 -04:00
Boris Zbarsky 40d2bf9d7f Bug 1377980 part 1. Remove use of nsIDOMRange in xpidl. r=mcc8 2018-05-17 12:01:37 -04:00
Boris Zbarsky abdd178705 Bug 1387143 part 7. Move the TABLESELECTION_* constants from nsISelectionPrivate to a TableSelection enum. r=mats 2018-05-08 13:52:36 -04:00
Boris Zbarsky 2348052be1 Bug 1455674 part 3. Stop using nsIDOMElement in nsITableEditor. r=masayuki
The patch is a bit large because all these methods except
SswitchTableCellHeaderType call each other; doing it piecemeal would have
required introducing, then removing, a bunch of QIs.
2018-04-26 23:35:18 -04:00
Masayuki Nakano 20fc8ab477 Bug 1387317 - part1: Make AutoSelectionSetterAfterTableEdit use HTMLEditor instead of nsITableEditor r=m_kato
nsITableEditor is now a builtin class.  So, it's implemented only by HTMLEditor.  Therefore, AutoSelectionSetterAfterTableEdit can use HTMLEditor.

Then, nsITableEditor.setSelectionAfterTableEdit() can be removed from nsITableEditor and moved to HTMLEditor as non-virtual method since nobody uses it from JS.

MozReview-Commit-ID: KnN6Fw4TYyn

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

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

MozReview-Commit-ID: 93WfsSDuJiJ

--HG--
extra : rebase_source : 39151eb4ffaaf195fec57234ea84c9f4066c58d1
2017-08-04 13:57:56 +09:00
Masayuki Nakano 274f4c6cb1 Bug 1169139 Remove all trailing whitespaces in editor (IGNORE IDL) r=ehsan 2015-05-29 00:58:42 +09:00
Birunthan Mohanathas 4f1864539d Bug 1028565 - Part 5: Flatten editor/{idl,public}/ directories. r=ehsan
--HG--
rename : editor/public/nsEditorCID.h => editor/nsEditorCID.h
rename : editor/idl/nsIContentFilter.idl => editor/nsIContentFilter.idl
rename : editor/idl/nsIDocumentStateListener.idl => editor/nsIDocumentStateListener.idl
rename : editor/idl/nsIEditActionListener.idl => editor/nsIEditActionListener.idl
rename : editor/idl/nsIEditor.idl => editor/nsIEditor.idl
rename : editor/idl/nsIEditorIMESupport.idl => editor/nsIEditorIMESupport.idl
rename : editor/idl/nsIEditorMailSupport.idl => editor/nsIEditorMailSupport.idl
rename : editor/idl/nsIEditorObserver.idl => editor/nsIEditorObserver.idl
rename : editor/idl/nsIEditorSpellCheck.idl => editor/nsIEditorSpellCheck.idl
rename : editor/idl/nsIEditorStyleSheets.idl => editor/nsIEditorStyleSheets.idl
rename : editor/idl/nsIHTMLAbsPosEditor.idl => editor/nsIHTMLAbsPosEditor.idl
rename : editor/idl/nsIHTMLEditor.idl => editor/nsIHTMLEditor.idl
rename : editor/idl/nsIHTMLInlineTableEditor.idl => editor/nsIHTMLInlineTableEditor.idl
rename : editor/idl/nsIHTMLObjectResizeListener.idl => editor/nsIHTMLObjectResizeListener.idl
rename : editor/idl/nsIHTMLObjectResizer.idl => editor/nsIHTMLObjectResizer.idl
rename : editor/idl/nsIPlaintextEditor.idl => editor/nsIPlaintextEditor.idl
rename : editor/idl/nsITableEditor.idl => editor/nsITableEditor.idl
rename : editor/idl/nsIURIRefObject.idl => editor/nsIURIRefObject.idl
rename : editor/idl/nsPIEditorTransaction.idl => editor/nsPIEditorTransaction.idl
2014-07-16 12:02:34 -07:00