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

17 Коммитов

Автор SHA1 Сообщение Дата
Olli Pettay 045eeefaaa Bug 1390402, add a faster variant of TextEditor::GetDocumentIsEmpty(), r=masayuki
--HG--
extra : rebase_source : 3238aec96be5b0393c395ce8cce9a0489d2e671d
2017-08-24 13:53:34 +03:00
Masayuki Nakano e4fb1c57a7 Bug 1385905 - part2: HTMLEditRules::SplitParagraph() should insert normal <br> element rather than moz-<br> element if split element and/or new element is empty r=m_kato
Currently, HTMLEditRules::SplitParagraph() inserts moz-<br> element when split element and/or new element causes empty line.  However, PlaintextSerializer ignores moz-<br> elements.  Therefore, empty lines which are created by SplitParagraph() will be removed when it's converted to plaintext.

So, it should insert normal <br> element for placeholder of empty lines instead.  Note that moz-<br> elements are appeared as normal <br> elements in the result of Element.innerHTML.  Additionally, Chromium always inserts a <br> element for empty block elements which are created by Enter key press.  Therefore, using normal <br> element in this case shouldn't cause any compatibility problems.

MozReview-Commit-ID: FNV41zEFWqQ

--HG--
extra : rebase_source : ece6c2e275e2a75d9d2871d62ed4204115792b99
2017-08-01 22:38:50 +09:00
Bevis Tseng 95b18d794e Bug 1382172 - Name nsITimerCallback instances in native implementation. r=billm
--HG--
extra : rebase_source : 84de1abfcc30a6964144c2e6718a508c71027b65
2017-07-27 02:18:20 +08:00
Masayuki Nakano 7231604754 Bug 596501 TextEditRules::WillOutputText() should handle itself if it can return only the text of first text node r=m_kato
TextEditor::OutputToString() uses DocumentEncoder if TextEditRules::WillOutputText() doesn't handle it.  However, TextEditRules::WillOutputText() doesn't handle it even if it's really simple case of <input type="text"> and <textarea>.
This patch makes TextEditRules::WillOutputText() handle it if DOM tree in the editor root element is expected and there is no special flag which requires complicated handling.

MozReview-Commit-ID: 3HvdTAWRpw0

--HG--
extra : rebase_source : ab3e630faa95ce8d4c1e9eb1786b7ece7212e38f
2017-06-16 19:08:10 +09:00
Makoto Kato da0ebf60c0 Bug 1358025 - Part 2. Add SetText Transaction API. r=masayuki
Actually, input.value setter behaviour (when editor has focus) is the following.

- select all
- delete selection
 - delete text node
- insert text
 - create text node
  - create nsIFrame since we don't support lazy construction for editable element

It is too expensive to change text.  So I would like to change like the following when there is 1 text node only (normal case).  If child nodes isn't 1 text node only, use original way.

- set text on existed text node

So, for this fast path, I would like to add SetText transaction API.

MozReview-Commit-ID: A7bjXtCtSoB

--HG--
extra : rebase_source : ff6348d7a3304e676a0a4b897f91623962961ae0
2017-05-25 14:30:50 +09:00
Makoto Kato 353b47086e Bug 1360154 - Part 1. DocumentIsBody should return bool, not nsresult. r=masayuki
nsIEditRules::GetDocumentIsEmpty doesn't return error without null parameter, so we should use bool as return value instead.

MozReview-Commit-ID: HIoQmKu6ETF

--HG--
extra : rebase_source : 570452e7072d8e0e837bb2822c9c0ab9c0d1a8cf
2017-05-11 14:03:26 +09:00
Makoto Kato bba54a63e6 Bug 1359008 - Don't use nsIDOM* in TextEditRules's member. r=masayuki
To clean up TextEditRules, I would like to replace nsIDOMNode with nsINode and nsIContent in TextEditRules.

GetTopEnclosingPre is unused define, so I also remove it.

MozReview-Commit-ID: 6LraexH5t4m

--HG--
extra : rebase_source : 1037dcfd949d544282dc30360bd43773f21fd929
2017-04-24 19:40:12 +09:00
Boris Zbarsky f80dd7a663 Bug 1345237. Propagate uint32_t deeper into the editor state and text control frame code. r=mystor
MozReview-Commit-ID: KeUo8My6eBJ
2017-03-09 14:44:45 -05:00
Makoto Kato 6b3afdd60e Bug 1337273 - Don't use mTextEditor from HTMLEditRules. r=masayuki
HTMLEditRules can access both mTextEditor and mHTMLEditor, but we should use mHTMLEditor only on HTMLEditRules for readability.

MozReview-Commit-ID: HfzwAD554XQ

--HG--
extra : rebase_source : 7d722915a41eb878e2cd2ff711ac4925bd91d1d8
2017-02-08 18:32:32 +09:00
Makoto Kato 93a16746ac Bug 1328558 - Remove unused insertElement member from TextEditRules. r=masayuki
Remove insertElement from TextEditRules due to unused.  Also, comments into TextEditRules is out of date.  We should update it using currect enum.

MozReview-Commit-ID: B1wczFWh2Ya

--HG--
extra : rebase_source : 910338b2f5d20316dcf11928e964346fa4aa8411
2017-01-04 18:51:44 +09:00
Masayuki Nakano f382711dc3 Bug 1260651 part.59 Rename nsEditor to mozilla::EditorBase (and also their file names) r=mccr8
This patch also renames:

EditorInputEventDispatcher -> mozilla::EditorInputEventDispatcher

And some variable names are renamed from aEditor or mEditor to aEditorBase or mEditorBase for making their types clearer.

MozReview-Commit-ID: 2FCXWpLMn8e

--HG--
rename : editor/libeditor/nsEditor.cpp => editor/libeditor/EditorBase.cpp
rename : editor/libeditor/nsEditor.h => editor/libeditor/EditorBase.h
2016-07-08 13:10:13 +09:00
Masayuki Nakano a4ac19d311 Bug 1260651 part.58 Rename nsPlaintextEditor to mozilla::TextEditor (and their file names too) r=mccr8
This patch renames nsPlaintextEditor to mozilla::TextEditor.

Additionally, renames TextEditRules::mEditor to TextEditRules::mTextEditor for making its type clearer.

Finally, renaming following files:

nsPlaintextEditor.h -> TextEditor.h (exposed as mozilla/editor/TextEditor.h)
nsPlaintextEditor.cpp -> TextEditor.cpp
nsPlaintextDataTransfer.cpp -> TextEditorDataTransfer.cpp

MozReview-Commit-ID: Lw8oJi4WglA

--HG--
rename : editor/libeditor/nsPlaintextEditor.cpp => editor/libeditor/TextEditor.cpp
rename : editor/libeditor/nsPlaintextEditor.h => editor/libeditor/TextEditor.h
rename : editor/libeditor/nsPlaintextDataTransfer.cpp => editor/libeditor/TextEditorDataTransfer.cpp
2016-07-09 11:54:50 +09:00
Masayuki Nakano 5c69175a0a Bug 1260651 part.53 Rename nsRulesInfo to mozilla::RulesInfo and rename nsEditRules.h to nsIEditRules.h r=mccr8
MozReview-Commit-ID: LGqyvjv9pr6

--HG--
rename : editor/libeditor/nsEditRules.h => editor/libeditor/nsIEditRules.h
2016-07-07 19:33:32 +09:00
Masayuki Nakano baafefc66e Bug 1260651 part.52 Rename nsAutoLockListener to mozilla::AutoLockListener r=mccr8
MozReview-Commit-ID: 728oPlrpb3Q
2016-06-24 21:22:26 +09:00
Masayuki Nakano d8f7c7cf33 Bug 1260651 part.51 Rename nsAutoLockRulesSniffing to mozilla::AutoLockRulesSniffing r=mccr8
MozReview-Commit-ID: BnZ1Y3YXfMK
2016-06-24 21:19:18 +09:00
Masayuki Nakano a0b8f02f00 Bug 1260651 part.50 Rename nsTextRulesInfo to mozilla::TextRulesInfo r=mccr8
MozReview-Commit-ID: Iny5k7WQlbS
2016-06-24 21:12:16 +09:00
Masayuki Nakano 94713accb3 Bug 1260651 part.49 Rename nsTextEditRules to mozilla::TextEditRules (and also their file names) r=mccr8
MozReview-Commit-ID: DzNeLcT1r1e

--HG--
rename : editor/libeditor/nsTextEditRules.cpp => editor/libeditor/TextEditRules.cpp
rename : editor/libeditor/nsTextEditRules.h => editor/libeditor/TextEditRules.h
rename : editor/libeditor/nsTextEditRulesBidi.cpp => editor/libeditor/TextEditRulesBidi.cpp
2016-07-09 11:34:41 +09:00