Closed Bug 1425412 Opened 2 years ago Closed 2 years ago

Get rid of methods just creating transaction instances

Categories

(Core :: DOM: Editor, enhancement)

56 Branch
enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(12 files)

59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
EditorBase::CreateTxnFor*() just creates an instance of *Transaction classes. I think that this should be replaced with static *Transaction::Create() methods.  Then, EditorBase saves its body size of the code and callers become clearer what they do.
Comment on attachment 8937590 [details]
Bug 1425412 - part 1: Create InsertTextTransaction::Create() and remove EditorBase::CreateTxnForInsertText()

https://reviewboard.mozilla.org/r/208124/#review214736
Attachment #8937590 - Flags: review?(m_kato) → review+
Comment on attachment 8937591 [details]
Bug 1425412 - part 2: Create InsertNodeTransaction::Create() and remove EditorBase::CreateTxnForInsertNode()

https://reviewboard.mozilla.org/r/208126/#review214738
Attachment #8937591 - Flags: review?(m_kato) → review+
Comment on attachment 8937592 [details]
Bug 1425412 - part 3: Create CreateElementTransaction::Create() and remove EditorBase::CreateTxnForCreateElement()

https://reviewboard.mozilla.org/r/208128/#review214740
Attachment #8937592 - Flags: review?(m_kato) → review+
Comment on attachment 8937592 [details]
Bug 1425412 - part 3: Create CreateElementTransaction::Create() and remove EditorBase::CreateTxnForCreateElement()

https://reviewboard.mozilla.org/r/208128/#review214750
Comment on attachment 8937593 [details]
Bug 1425412 - part 4: Create CompositionTransaction::Create() and remove EditorBase::CreateTxnForComposition()

https://reviewboard.mozilla.org/r/208130/#review214752
Attachment #8937593 - Flags: review?(m_kato) → review+
Comment on attachment 8937594 [details]
Bug 1425412 - part 5: Create some factory methods of DeleteTextTransaction and remove EditorBase::CreateTxnForDeleteText() and EditorBase::CreateTxnForDeleteCharacter()

https://reviewboard.mozilla.org/r/208132/#review214890
Attachment #8937594 - Flags: review?(m_kato) → review+
Comment on attachment 8937595 [details]
Bug 1425412 - part 6: Create DeleteNodeTransaction::MaybeCreate() and remove EditorBaseTransaction::CreateTxnForDeleteNode()

https://reviewboard.mozilla.org/r/208134/#review214892
Attachment #8937595 - Flags: review?(m_kato) → review+
Comment on attachment 8937596 [details]
Bug 1425412 - part 7: Create SplitNodeTransaction::Create() and remove EditorBase::CreateTxnForSplitNode()

https://reviewboard.mozilla.org/r/208136/#review214896
Attachment #8937596 - Flags: review?(m_kato) → review+
Comment on attachment 8937597 [details]
Bug 1425412 - part 8: Create JoinNodeTransaction::MaybeCreate() and remove EditorBase::CreateTxnForJoinNode()

https://reviewboard.mozilla.org/r/208138/#review214900
Attachment #8937597 - Flags: review?(m_kato) → review+
Comment on attachment 8937598 [details]
Bug 1425412 - part 9: Create factory methods of ChangeAttributeTransaction and remove EditorBase::CreateTxnForSetAttribute() and EditorBase::CreateTxnForRemoveAttribute()

https://reviewboard.mozilla.org/r/208140/#review214914
Attachment #8937598 - Flags: review?(m_kato) → review+
Comment on attachment 8937599 [details]
Bug 1425412 - part 10: Create factory methods for AddStyleSheetTransaction and RemoveStyleSheetTransaction, and remove EditorBase::CreateTxnForAddStyleSheet() and EditorBase::CreateTxnForRemoveStyleSheet()

https://reviewboard.mozilla.org/r/208142/#review214918
Attachment #8937599 - Flags: review?(m_kato) → review+
Comment on attachment 8937600 [details]
Bug 1425412 - part 11: Create factory methods for ChangeStyleTransaction and remove CSSEditUtils::CreateCSSPropertyTxn()

https://reviewboard.mozilla.org/r/208144/#review214964
Attachment #8937600 - Flags: review?(m_kato) → review+
Comment on attachment 8937601 [details]
Bug 1425412 - part 12: Create factory methods for DeleteRangeTransaction, EditAggregateTransaction and PlaceholderTransaction for consistency with the other transaction classes

https://reviewboard.mozilla.org/r/208146/#review214982
Attachment #8937601 - Flags: review?(m_kato) → review+
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/41a28234be87
part 1: Create InsertTextTransaction::Create() and remove EditorBase::CreateTxnForInsertText() r=m_kato
https://hg.mozilla.org/integration/autoland/rev/d692dc23699b
part 2: Create InsertNodeTransaction::Create() and remove EditorBase::CreateTxnForInsertNode() r=m_kato
https://hg.mozilla.org/integration/autoland/rev/35cddb12f139
part 3: Create CreateElementTransaction::Create() and remove EditorBase::CreateTxnForCreateElement() r=m_kato
https://hg.mozilla.org/integration/autoland/rev/cbde98b345fc
part 4: Create CompositionTransaction::Create() and remove EditorBase::CreateTxnForComposition() r=m_kato
https://hg.mozilla.org/integration/autoland/rev/05aab5d7c6fa
part 5: Create some factory methods of DeleteTextTransaction and remove EditorBase::CreateTxnForDeleteText() and EditorBase::CreateTxnForDeleteCharacter() r=m_kato
https://hg.mozilla.org/integration/autoland/rev/be2bafa5c666
part 6: Create DeleteNodeTransaction::MaybeCreate() and remove EditorBaseTransaction::CreateTxnForDeleteNode() r=m_kato
https://hg.mozilla.org/integration/autoland/rev/1af2984c6a7c
part 7: Create SplitNodeTransaction::Create() and remove EditorBase::CreateTxnForSplitNode() r=m_kato
https://hg.mozilla.org/integration/autoland/rev/adacb161f917
part 8: Create JoinNodeTransaction::MaybeCreate() and remove EditorBase::CreateTxnForJoinNode() r=m_kato
https://hg.mozilla.org/integration/autoland/rev/d4351f088a6e
part 9: Create factory methods of ChangeAttributeTransaction and remove EditorBase::CreateTxnForSetAttribute() and EditorBase::CreateTxnForRemoveAttribute() r=m_kato
https://hg.mozilla.org/integration/autoland/rev/bfbe1d3bf377
part 10: Create factory methods for AddStyleSheetTransaction and RemoveStyleSheetTransaction, and remove EditorBase::CreateTxnForAddStyleSheet() and EditorBase::CreateTxnForRemoveStyleSheet() r=m_kato
https://hg.mozilla.org/integration/autoland/rev/98e9140f291d
part 11: Create factory methods for ChangeStyleTransaction and remove CSSEditUtils::CreateCSSPropertyTxn() r=m_kato
https://hg.mozilla.org/integration/autoland/rev/278ae84e7aea
part 12: Create factory methods for DeleteRangeTransaction, EditAggregateTransaction and PlaceholderTransaction for consistency with the other transaction classes r=m_kato
You need to log in before you can comment on or make changes to this bug.