Closed
Bug 1483144
Opened 7 years ago
Closed 7 years ago
Make HTMLEditor::GetSelectionContainer() protected
Categories
(Core :: DOM: Editor, enhancement)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(1 file)
HTMLEditor::GetSelectionContainer() is a public method, but it's not used by outer classes. So, we can make it a protected member.
Assignee | ||
Comment 1•7 years ago
|
||
Assignee | ||
Comment 2•7 years ago
|
||
Assignee | ||
Comment 3•7 years ago
|
||
Assignee | ||
Comment 4•7 years ago
|
||
Assignee | ||
Comment 5•7 years ago
|
||
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 6•7 years ago
|
||
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 masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/a28cf4300f12
Make HTMLEditor::GetSelectionContainer() protected r=m_kato
Comment 8•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•