Closed Bug 1416080 Opened 8 years ago Closed 8 years ago

Don't use virtual function for CreateBR

Categories

(Core :: DOM: Editor, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox58 --- wontfix
firefox59 --- fixed

People

(Reporter: m_kato, Assigned: m_kato)

Details

Attachments

(2 files)

No description provided.
Priority: -- → P3
Comment on attachment 8932026 [details] Bug 1416080 - Part 1. Move all CreateBR methods to TextEditor. https://reviewboard.mozilla.org/r/203094/#review208400
Attachment #8932026 - Flags: review?(masayuki) → review+
Comment on attachment 8932027 [details] Bug 1416080 - Part 2. CreateMozBR should use native dom node. https://reviewboard.mozilla.org/r/203096/#review208402 ::: editor/libeditor/TextEditRules.cpp:1631 (Diff revision 1) > -TextEditRules::CreateBRInternal(nsIDOMNode* inParent, > +TextEditRules::CreateBRInternal(nsINode& inParent, > int32_t inOffset, > bool aMozBR, > - nsIDOMNode** outBRNode) > + Element** aOutBRElement) > { > - NS_ENSURE_TRUE(inParent, NS_ERROR_NULL_POINTER); > - > - nsCOMPtr<nsIDOMNode> brNode; > NS_ENSURE_STATE(mTextEditor); > - nsresult rv = mTextEditor->CreateBR(inParent, inOffset, address_of(brNode)); > + RefPtr<Element> brElem = mTextEditor->CreateBR(&inParent, inOffset); Could you make this method hold mTextEditor with local variable and use it instead of mTextEditor in this method? CreateBR() may be intercepted by mutation observers.
Attachment #8932027 - Flags: review?(masayuki) → review+
Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/971d5eac56e4 Part 1. Move all CreateBR methods to TextEditor. r=masayuki https://hg.mozilla.org/integration/autoland/rev/70581f6aeb1d Part 2. CreateMozBR should use native dom node. r=masayuki
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: