Commit Graph

9 Commits

Author SHA1 Message Date
Makoto Kato
42a03792a6 Bug 1425467 - mInlineEditedCell should be Element. r=masayuki
mInlineEditedCell for inline table editor is still nsIDOMElement.  To avoid QI
and virtual call, we should replace it with Element.

MozReview-Commit-ID: 76yfQJxwm9d

--HG--
extra : rebase_source : e89de17faa20d16a8823e1016b6ba8a6f78993b6
2017-12-15 10:14:54 -06:00
Makoto Kato
012ef9e1c1 Bug 1380292 - Don't turn on object resizer, inline table editor and etc when element isn't into editor. r=masayuki 2017-09-09 10:49:02 -04:00
Makoto Kato
e9bdbc5bb1 Bug 1387945 - Use nsIContent for CreateAnonymousElement. r=masayuki
CreateAnonymousElement still uses nsIDOMNode, but we should use nsIContent for it.

MozReview-Commit-ID: 2xgzlE6NVra

--HG--
extra : rebase_source : c93a9acb230604da391f705b0038e3cf7fbd4f23
2017-08-07 14:09:51 +09:00
Bobby Holley
1bd3bc937c Bug 1386110 - Use a smart pointer to reliably de-register NAC regardless of how it goes away. r=masayuki
MozReview-Commit-ID: HTSu5BjxD8I
2017-08-03 20:26:11 -07:00
Makoto Kato
9b683468d5 Bug 699703 - Need reframe before calling SetSelectionAfterTableEdit. r=masayuki
HTMLEditor::TabInTable inserts row element, then it selects a cell.  But when enabling lazy frame construction for editable node, it selects invalid cell and table.

Because HTMLEditor::SetSelectionAfterTableEdit doesn't select cell correctly on InsertTableRow().

HTMLEditor::SetSelectionAfterTableEdit uses HTMLEditor::GetCellAt, so it depends on frame.  So we need flush frame before calling it.

Also, a comment of HTMLEditor::InsertTableRow is invalid now because we don't use nsresult version of CreateElementWithDefualts.

MozReview-Commit-ID: 698TvmMZgwB

--HG--
extra : rebase_source : 95df12f1f870a2c68d02b24b8758dfe6d381a416
2017-07-14 15:48:40 +09:00
Cameron McCormack
fdb731a4d4 Bug 1377256 - Part 1: Don't pass parent explicitly into HTMLEditor::DeleteRefToAnonymousNode. r=m_kato
MozReview-Commit-ID: HUySaoG07jg

--HG--
extra : rebase_source : adb3a65387eb209073d95211fa185bcab2791b0f
2017-07-04 17:01:32 +08:00
Makoto Kato
ef514b53ec Bug 1313986 - Part 4. Use Element instead of nsIDOMElement for resizer. r=masayuki
Resizer and etc attributes on table editor still use nsIDOMElement.  Converting to Element makes both implementation and the callers simpler.

MozReview-Commit-ID: TTFSvqn5GE

--HG--
extra : rebase_source : 705576c4eb0fe5f8f566f3415a8a72842c919edd
2016-11-24 15:58:01 +09:00
Masayuki Nakano
2773c4d0ef Bug 1310618 Replace nsresult variables |res| with |rv| under editor/ r=Ehsan
In our coding rules, variable names of nsresult should be rv.  Indeed, when you see |rv| in the code, you must assume that its type if nsresult.

However, a lot of code under editor/ uses |res| for the variables of nsresult.  Let's replace |res| with |rv|.

And this patch improves following points:

1. When |rv| is set in both |if| and |else| block and they are check outside of them, this moves the check into each |if| and |else| block because even if the failure is notified with warning, you cannot see which case was performed and failed.  This change makes it clear.

2. When |return rv;| returns non-error code because |rv| is checked with NS_ENSURE_SUCCESS() immediately before, setting replacing it with |return NS_OK;| is clearer.

3. Move declaration of |nsresult rv| into smaller scope as far as possible.  This prevents setting rv to unexpected value and easier to check its value at reading the code.

MozReview-Commit-ID: 9MAqj7sFey3

--HG--
extra : rebase_source : 0fd316b851ea616b3a95d8c1afc111ff55e11993
2016-10-19 18:09:33 +09:00
Masayuki Nakano
9b6e26f0bb Bug 1260651 part.56 Rename nsHTMLEditor to mozilla::HTMLEditor and related stuff r=mccr8
This patch renames classes/structs as:

nsHTMLEditor -> mozilla::HTMLEditor
nsHTMLEditor::BlobReader -> mozilla::HTMLEditor::BlobReader
SetSelectionAfterTableEdit -> mozilla::AutoSelectionSetterAfterTableEdit

nsHTMLEditor.h -> HTMLEditor.h (exposed as mozilla/editor/HTMLEditor.h)
nsHTMLAbsPosition.cpp -> HTMLAbsPositionEditor.cpp
nsHTMLAnonymousUtils.cpp -> HTMLAnonymousNodeEditor.cpp
nsHTMLDataTransfer.cpp -> HTMLEditorDataTransfer.cpp
nsHTMLEditorStyle.cpp -> HTMLStyleEditor.cpp
nsHTMLInlineTableEditor.cpp -> HTMLInlineTableEditor.cpp
nsHTMLObjectResizer.cpp -> HTMLEditorObjectResizer.cpp
nsTableEditor.cpp -> HTMLTableEditor.cpp

These new file names are clearer names which related to HTMLEditor than old names.

MozReview-Commit-ID: DTWaoFvy0DF

--HG--
rename : editor/libeditor/nsHTMLAbsPosition.cpp => editor/libeditor/HTMLAbsPositionEditor.cpp
rename : editor/libeditor/nsHTMLAnonymousUtils.cpp => editor/libeditor/HTMLAnonymousNodeEditor.cpp
rename : editor/libeditor/nsHTMLEditor.cpp => editor/libeditor/HTMLEditor.cpp
rename : editor/libeditor/nsHTMLEditor.h => editor/libeditor/HTMLEditor.h
rename : editor/libeditor/nsHTMLDataTransfer.cpp => editor/libeditor/HTMLEditorDataTransfer.cpp
rename : editor/libeditor/nsHTMLObjectResizer.cpp => editor/libeditor/HTMLEditorObjectResizer.cpp
rename : editor/libeditor/nsHTMLInlineTableEditor.cpp => editor/libeditor/HTMLInlineTableEditor.cpp
rename : editor/libeditor/nsHTMLEditorStyle.cpp => editor/libeditor/HTMLStyleEditor.cpp
rename : editor/libeditor/nsTableEditor.cpp => editor/libeditor/HTMLTableEditor.cpp
2016-07-09 11:42:33 +09:00