Closed
Bug 1419745
Opened 7 years ago
Closed 7 years ago
Editor(Raw)DOMPoint should store child node at offset by itself
Categories
(Core :: DOM: Editor, defect, P3)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox-esr52 | --- | unaffected |
firefox57 | --- | unaffected |
firefox58 | --- | wontfix |
firefox59 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
(Keywords: regression)
Attachments
(3 files)
I realized this big bug. Editor(Raw)DOMPoint does not store anything by itself. Its base class, (Raw)RangeBoundary stores container, *previous sibling of* child at offset and offset. If users of Editor(Raw)DOMPoint want to keep referring child node but the child node is moved different point unexpectedly (e.g., by mutation observer), Editor(Raw)DOMPoint keeps referring the *old* previous sibling. Therefore, GetChildAtOffset() will return different child node with current DOM tree. So, Editor(Raw)DOMPoint should cache the child node by itself. So, this bug is, we've changed HTML editor behavior in a lot of places if web apps changes position of new DOM nodes which are created by editor.
Assignee | ||
Comment 1•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b7abfb3c7ed09bae9e3eec421ec2e74fc9095515
Assignee | ||
Comment 2•7 years ago
|
||
Hmm, I was thinking that Editor(Raw)DOMPoint should override some methods of RangeBoundaryBase to cache actual child node at offset. However, that causes making EditorDOMPointBase complicated and riskier to change RangeBoundaryBase. So, probably, we should stop EditorDOMPointBase inherits RangeBoundaryBase since it's not useful base class for editor.
Assignee | ||
Comment 3•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=0a6ff5051de60f675ed1e356186c4c7c750fd08a
Assignee | ||
Comment 4•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=c0b612706952f1a00c6e3a073f71b25794f03397
Assignee | ||
Comment 5•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7ee07912b2ed5649aac3a345fabe3fdeb5114674
Updated•7 years ago
|
Priority: -- → P3
Assignee | ||
Comment 6•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7f2286c9edf87f1a45e19bb5fcc46a20e895f814
Assignee | ||
Comment 7•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=12ba7469512964944bd56968139295fa5ae5a7e2
Assignee | ||
Comment 8•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=2dcc0cbc7149655e7483de647af919c055bebf7a
Assignee | ||
Comment 9•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=88a6d75c1bf54f76c9ebeccce61c8d44adb5761c
Assignee | ||
Comment 10•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=06a3d5df2a2d8f12e02ffe5b1e6205f757460f33
Assignee | ||
Comment 11•7 years ago
|
||
The patch is too risky to uplift and fortunately, we have no regression reports depending on this bug. So, we should give up to fix this on 58. (FYI: The fixes causing this regression fixed some regressions which are new in 58. So, we shouldn't back them out.)
Assignee | ||
Comment 12•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=662edfb2a9901c3d7b639bdca2f63e3580d49d35
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 16•7 years ago
|
||
mozreview-review |
Comment on attachment 8932450 [details] Bug 1419745 - part 1: Make EditorDOMPointBase not a sub class of RangeBoundaryBase and duplicate methods of RangeBoundaryBase into EditorDOMPointBase https://reviewboard.mozilla.org/r/203496/#review209274
Attachment #8932450 -
Flags: review?(m_kato) → review+
Comment 17•7 years ago
|
||
mozreview-review |
Comment on attachment 8932451 [details] Bug 1419745 - part 2: Make EditorDOMPointBase store child node at offset instead of previous sibling of child node at offset https://reviewboard.mozilla.org/r/203498/#review209288
Attachment #8932451 -
Flags: review?(m_kato) → review+
Comment 18•7 years ago
|
||
mozreview-review |
Comment on attachment 8932452 [details] Bug 1419745 - part 3: CreateElementTransaction and SplitNodeTransaction should store DOM point with EditorDOMPoint rather than RangeBoundary https://reviewboard.mozilla.org/r/203500/#review209290
Attachment #8932452 -
Flags: review?(m_kato) → review+
Comment 19•7 years ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/31082fdbf643 part 1: Make EditorDOMPointBase not a sub class of RangeBoundaryBase and duplicate methods of RangeBoundaryBase into EditorDOMPointBase r=m_kato https://hg.mozilla.org/integration/autoland/rev/dc40e5160744 part 2: Make EditorDOMPointBase store child node at offset instead of previous sibling of child node at offset r=m_kato https://hg.mozilla.org/integration/autoland/rev/9319d599c3b0 part 3: CreateElementTransaction and SplitNodeTransaction should store DOM point with EditorDOMPoint rather than RangeBoundary r=m_kato
Comment 20•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/31082fdbf643 https://hg.mozilla.org/mozilla-central/rev/dc40e5160744 https://hg.mozilla.org/mozilla-central/rev/9319d599c3b0
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Assignee | ||
Comment 21•7 years ago
|
||
Now, EditorDOMPointBase<A, B> has stopped inheriting RangeBoundaryBase<A, B>. So, we can back some patches out from RangeBoundary.h, that were added for EditorDOMPoint. catalinb, do you think I should back them out from RangeBoundary.h to keep the implementation as far as simple? If so, I'll file a follow up bug and post a patch.
Flags: needinfo?(catalin.badea392)
Updated•7 years ago
|
status-firefox-esr52:
--- → unaffected
Comment 22•7 years ago
|
||
(In reply to Masayuki Nakano [:masayuki] (JST, +0900) from comment #21) > Now, EditorDOMPointBase<A, B> has stopped inheriting RangeBoundaryBase<A, > B>. So, we can back some patches out from RangeBoundary.h, that were added > for EditorDOMPoint. > > catalinb, do you think I should back them out from RangeBoundary.h to keep > the implementation as far as simple? If so, I'll file a follow up bug and > post a patch. Yes, please. No reason to keep them around if they aren't used anymore.
Flags: needinfo?(catalin.badea392)
You need to log in
before you can comment on or make changes to this bug.
Description
•