Closed
Bug 1423835
Opened 5 years ago
Closed 5 years ago
Clean up EditorDOMPointBase
Categories
(Core :: DOM: Editor, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(3 files)
EditorDOMPointBase should have a method, SetToEndOf() which automatically initializes with mParent->Length(). And its Container() should be renamed to GetContainer() because it may return nullptr. And GetChildAtOffset() should be renamed to GetChild() because different from RangeBoundary, EditorDOMPointBase may store only child node.
Assignee | ||
Comment 1•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=53110f803232aac0dfad67aa5c3a0e5f233d7f35
Assignee | ||
Comment 2•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=dd3b80845b8ab2d02c13cdda384fdba02a782a37
Assignee | ||
Comment 3•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=022bcd0562f15b3f9ec0326afdd8abb7e4e67e46
Assignee | ||
Comment 4•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=398a55536b6c900f811defb3f7b7dc44d084389b
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 8•5 years ago
|
||
mozreview-review |
Comment on attachment 8935689 [details] Bug 1423835 - part 1: Add EditorDOMPointBase::SetToEndOf() to initialize the instance at end of container node https://reviewboard.mozilla.org/r/206590/#review212642
Attachment #8935689 -
Flags: review?(m_kato) → review+
Comment 9•5 years ago
|
||
mozreview-review |
Comment on attachment 8935690 [details] Bug 1423835 - part 2: Rename EditorDOMPointBase::Container() to EditorDOMPointBase::GetContainer() and add some useful methods to access its container https://reviewboard.mozilla.org/r/206592/#review212646 ::: editor/libeditor/HTMLEditRules.cpp:6862 (Diff revision 1) > EditorRawDOMPoint pointToInsertBR; > if (doesCRCreateNewP && > - atStartOfSelection.Container() == &aParentDivOrP) { > + atStartOfSelection.GetContainer() == &aParentDivOrP) { > // We are at the edges of the block, so, we don't need to create new <br>. > brNode = nullptr; > - } else if (EditorBase::IsTextNode(atStartOfSelection.Container())) { > + } else if (EditorBase::IsTextNode(atStartOfSelection.GetContainer())) { atStartOfSelection.IsInTextNode? ::: editor/libeditor/HTMLEditRules.cpp:8074 (Diff revision 1) > - return CreateMozBR(*point.Container(), point.Offset()); > + return CreateMozBR(*point.GetContainer(), point.Offset()); > } > } > > // are we in a text node? > - if (EditorBase::IsTextNode(point.Container())) { > + if (EditorBase::IsTextNode(point.GetContainer())) { point.IsInTextNode? ::: editor/libeditor/HTMLEditorDataTransfer.cpp:372 (Diff revision 1) > > // Remember if we are in a link. > - bool bStartedInLink = IsInLink(pointToInsert.Container()->AsDOMNode()); > + bool bStartedInLink = IsInLink(pointToInsert.GetContainerAsDOMNode()); > > // Are we in a text node? If so, split it. > - if (IsTextNode(pointToInsert.Container())) { > + if (IsTextNode(pointToInsert.GetContainer())) { pointToInsert.IsInTextNode? ::: editor/libeditor/TextEditor.cpp:587 (Diff revision 1) > > // node might be anonymous DIV, so we find better text node > EditorRawDOMPoint insertionPoint = > FindBetterInsertionPoint(atStartOfSelection); > > - if (IsTextNode(insertionPoint.Container())) { > + if (IsTextNode(insertionPoint.GetContainer())) { insertionPoint.IsInTextNode? ::: editor/libeditor/TextEditor.cpp:766 (Diff revision 1) > return NS_ERROR_FAILURE; > } > MOZ_ASSERT(pointToInsert.IsSetAndValid()); > > // don't put text in places that can't have it > - if (!IsTextNode(pointToInsert.Container()) && > + if (!IsTextNode(pointToInsert.GetContainer()) && pointToInsert.IsInTextNode? ::: editor/libeditor/WSRunObject.cpp:1329 (Diff revision 1) > // Nothing to delete > return NS_OK; > } > > - if (aStartPoint.Container() == aEndPoint.Container() && > - aStartPoint.Container()->GetAsText()) { > + if (aStartPoint.GetContainer() == aEndPoint.GetContainer() && > + aStartPoint.GetContainerAsText()) { aStartPoint.IsInTextNode?
Attachment #8935690 -
Flags: review?(m_kato) → review+
Comment 10•5 years ago
|
||
mozreview-review |
Comment on attachment 8935691 [details] Bug 1423835 - part 3: Rename EditorDOMPointBase::GetChildAtOffset() to EditorDOMPointBase::GetChild() https://reviewboard.mozilla.org/r/206594/#review212648
Attachment #8935691 -
Flags: review?(m_kato) → review+
Assignee | ||
Comment 11•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ddba1394714ad8e946e267533d5ac7830c5660a6
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 15•5 years ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/1427b2fca8d7 part 1: Add EditorDOMPointBase::SetToEndOf() to initialize the instance at end of container node r=m_kato https://hg.mozilla.org/integration/autoland/rev/c41a81c80769 part 2: Rename EditorDOMPointBase::Container() to EditorDOMPointBase::GetContainer() and add some useful methods to access its container r=m_kato https://hg.mozilla.org/integration/autoland/rev/92403ed2a488 part 3: Rename EditorDOMPointBase::GetChildAtOffset() to EditorDOMPointBase::GetChild() r=m_kato
Comment 16•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1427b2fca8d7 https://hg.mozilla.org/mozilla-central/rev/c41a81c80769 https://hg.mozilla.org/mozilla-central/rev/92403ed2a488
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in
before you can comment on or make changes to this bug.
Description
•