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

20 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 3aa3b37a40 Bug 1632021 - part 1: Add `GetAs*Transaction()` methods to every subclasses of `EditTransactionBase` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D71907
2020-04-23 05:46:43 +00:00
Masayuki Nakano 8390d2e8bc Bug 1619914 - part 2: Mark transaction class methods and their caller methods as `MOZ_CAN_RUN_SCRIPT r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D69303

--HG--
extra : moz-landing-system : lando
2020-04-03 08:32:01 +00:00
Masayuki Nakano 3f95e60b07 Bug 1619914 - part 1: Make each transaction class grab their members with local variable before touching the DOM tree r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D69302

--HG--
extra : moz-landing-system : lando
2020-04-03 08:30:37 +00:00
Mihai Alexandru Michis 2f9f34de0e Backed out 2 changesets (bug 1619914) for causing gtest failures regarding TransactionManager.
CLOSED TREE

Backed out changeset d3816f82c0b9 (bug 1619914)
Backed out changeset 876b1031a6ae (bug 1619914)
2020-04-03 07:57:06 +03:00
Masayuki Nakano eb881aff87 Bug 1619914 - part 2: Mark transaction class methods and their caller methods as `MOZ_CAN_RUN_SCRIPT r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D69303

--HG--
extra : moz-landing-system : lando
2020-04-03 01:39:36 +00:00
Masayuki Nakano 5fb2cba97c Bug 1619914 - part 1: Make each transaction class grab their members with local variable before touching the DOM tree r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D69302

--HG--
extra : moz-landing-system : lando
2020-04-03 01:38:22 +00:00
Masayuki Nakano 85a0bd9a61 Bug 1620135 - Clean up trivial constructor and destructor under libeditor r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D65448

--HG--
extra : moz-landing-system : lando
2020-03-06 04:38:25 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Masayuki Nakano 537b829474 Bug 1447213 - Change editor methods which take |const EditorRawDOMPoint&| but called with EditorDOMPoint.AsRaw() to template methods r=m_kato
A lot of methods take |const EditorRawDOMPoint&| as their argument.  However,
some of them are called with EditorDOMPoint::AsRaw(). This is not good for
performance because:
1. Needs to create temporary instance of EditorRawDOMPoint.
2. EditorRawDOMPoint::AsRaw() may be used by simple mistake.
3. Such methods may call EditorRawDOMPoint::Offset(), however, it's not copied
   to the original EditorDOMPoint instance.  So, callers may need to compute
   offset again.

So, such methods should be changed to template methods if they are not virtual
method and AsRaw() should be gotten rid of for prevent it looking not expensive.

MozReview-Commit-ID: DAqqW4a2EMS

--HG--
extra : rebase_source : 120b920477fe6e7231271411a00994325acdb842
2018-03-20 14:05:47 +09:00
Masayuki Nakano 7443737c19 Bug 1425412 - part 3: Create CreateElementTransaction::Create() and remove EditorBase::CreateTxnForCreateElement() r=m_kato
EditorBase::CreateTxnForCreateElement() just hides what it does. Let's make
the caller what it does with creating CreateElementTransaction::Create().

MozReview-Commit-ID: DYcfQV6KiUZ

--HG--
extra : rebase_source : d3f31b8db92bd3b2af464c66e064dd7b21018960
2017-12-15 17:54:10 +09:00
Masayuki Nakano f989a6c4d5 Bug 1419745 - part 3: CreateElementTransaction and SplitNodeTransaction should store DOM point with EditorDOMPoint rather than RangeBoundary r=m_kato
CreateElementTransaction and SplitNodeTransaction store DOM point with
RangeBoundary now.  However, it refers next child of referring point.
Therefore, if it's moved to different container or removed from the DOM
tree, they cannot do undo/redo.  We can say for the child node, however,
it doesn't make sense depending on a node which is not directly referring.

MozReview-Commit-ID: Baohbub3RNZ

--HG--
extra : rebase_source : 6776420271cdaf91aae6213fb6e1bcf1841112b1
2017-11-28 17:13:15 +09:00
Masayuki Nakano ae419aa495 Bug 1415445 - part 1: CreateElementTransaction should use EditorRawDOMPoint and RangeBoundary r=m_kato
The constructor of CreateElementTransaction should use EditorRawDOMPoint to
receive insertion point of the new element.  Then, it should be stored with
RangeBoundary.  With this change, CreateElementTransaction doesn't need to
compute child node at insertion point.

Additionally, this creates InsertNode() method.  Current code works differently
when DoTransaction() is called and RedoTransaction() is called.

MozReview-Commit-ID: 8ujhmzn65Wg

--HG--
extra : rebase_source : 30cc045a30a3836f211d11e5f70a85804f44a72a
2017-11-08 16:49:06 +09:00
Ehsan Akhgari bf1f474a3d Bug 1407854 - Part 2: Add an optional argument to CreateNode() to allow callers to pass the child node when they know it; r=masayuki 2017-10-12 17:13:55 -04:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Nicholas Nethercote dfd3b7e7aa Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.

- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>

- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
  - Count() --> Length()
  - ObjectAt() --> ElementAt()
  - AppendObject() --> AppendElement()
  - RemoveObjectAt() --> RemoveElementAt()

- ns*Hashtable<nsISupportsHashKey, ...> -->
  ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>

- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
  - This requires adding a Get() method to nsRefPtrHashtable that it lacks but
    nsInterfaceHashtable has.

- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
  - nsArrayBase::Create() --> nsTArray()
  - GetLength() --> Length()
  - do_QueryElementAt() --> operator[]

The patch also has some changes to Rust code that manipulates nsIAtom.

MozReview-Commit-ID: DykOl8aEnUJ

--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1
2017-09-26 08:33:21 +10:00
Masayuki Nakano e877ded333 Bug 1349138 Edit transactions should store their editor instance with strong reference r=smaug
Edit transactions should store their editor instance with strong reference and they should be released at destroying the editor.

MozReview-Commit-ID: D67KU8WFxyo

--HG--
extra : rebase_source : 28c8a37498cad9f2e308eb4416cef76cf395bb9c
2017-03-21 19:00:36 +09:00
Masayuki Nakano 7f30e926b8 Bug 1260651 part.60 editor/libeditor should export some headers which are required by other modules and other modules shouldn't use local include for them r=mccr8
MozReview-Commit-ID: FZSExwkHH2B
2016-07-08 14:03:31 +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 5fb3db78b5 Bug 1260651 part.32 Rename EditTxn to mozilla::EditTransactionBase r=mccr8
This patch also renames NS_DECL_EDITTXN to NS_DECL_EDIT_TRANSACTION_BASE.

MozReview-Commit-ID: 29TQbKBBEhD

--HG--
rename : editor/libeditor/EditTxn.cpp => editor/libeditor/EditTransactionBase.cpp
rename : editor/libeditor/EditTxn.h => editor/libeditor/EditTransactionBase.h
2016-07-08 09:48:34 +09:00
Masayuki Nakano d46dfe7402 Bug 1260651 part.19 Rename mozilla::dom::CreateElementTxn to mozilla::CreateElementTransaction (and their files too) r=mccr8
MozReview-Commit-ID: 7RckfPHq1Y

--HG--
rename : editor/libeditor/CreateElementTxn.cpp => editor/libeditor/CreateElementTransaction.cpp
rename : editor/libeditor/CreateElementTxn.h => editor/libeditor/CreateElementTransaction.h
2016-07-07 14:33:56 +09:00