46 bytes, text/x-phabricator-request
|Details | Review|
HTMLEditor::GetSelectionContainer() is a public method, but it's not used by outer classes. So, we can make it a protected member.
HTMLEditor::GetSelectionContainer() is a public method, but it's not used by outer classes. So, we can make it a protected member. Additionally, this patch cleans up the method. - Renames to GetSelectionContainerElement() for making clearer what will be returned. - Makes it const. - Makes it take Selection reference since most callers already have Selection. - Makes it use RangeBoundary to access start point and end point of range since nsRange::StartOffset() and nsRange::EndOffset() may be slow. - Makes it not use GetSelectedElement() since it requires unnecessary additional cost and the condition to call it means it uses only the first path in GetSelectedElement() which just returns start node of the range. - Makes it output warning when it returns nullptr since it reaches nullptr only when illegal cases, e.g., Selection is in orphan node.
Comment on attachment 9001461 [details] Bug 1483144 - Make HTMLEditor::GetSelectionContainer() protected Makoto Kato [:m_kato] has approved the revision.
Attachment #9001461 - Flags: review+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/a28cf4300f12 Make HTMLEditor::GetSelectionContainer() protected r=m_kato
You need to log in before you can comment on or make changes to this bug.