Assertion failure: aEnd.Offset(RawRangeBoundary::OffsetFilter::kValidOffsets).value() == mEditorBase->GetRoot()->Length(), at editor/libeditor/DeleteRangeTransaction.cpp:227
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
People
(Reporter: MatsPalmgren_bugz, Assigned: masayuki)
References
(Depends on 1 open bug)
Details
(Keywords: assertion)
Crash Data
Attachments
(1 file, 1 obsolete file)
Fwiw, I got this fatal assertion when editing a CSS property value in DevTools (using a local debug build on Linux):
Assertion failure: aEnd.Offset(RawRangeBoundary::OffsetFilter::kValidOffsets).value() == mEditorBase->GetRoot()->Length(), at editor/libeditor/DeleteRangeTransaction.cpp:227
Sorry, I don't have exact STR, nor did I try to reproduce it...
I guess that violation isn't very dangerous, because textNode->TextDataLength()
is called afterwards at https://searchfox.org/mozilla-central/rev/477950cf9ca9c9bb5ff6f34e0d0f6ca4718ea798/editor/libeditor/DeleteRangeTransaction.cpp#233-235, but I'm not very familiar with that code.
Kagami: since the violated assertion, https://searchfox.org/mozilla-central/rev/477950cf9ca9c9bb5ff6f34e0d0f6ca4718ea798/editor/libeditor/DeleteRangeTransaction.cpp#225-227, was added by you, could you please set severity and priority for this ticket?
Incidental remark: having MOZ_ASSERT_EQ
would be nice.
Comment 2•3 years ago
|
||
Hmm, something does look odd there, but if that doesn't cause a crash on release build I guess it's fine to give S3.
Some work need to be done to make "100% sure nothing does so", so filed bug 1734846.
Assignee | ||
Comment 3•3 years ago
|
||
Could be caused by the selection selects only the text node, but there is a trailing <br>
, e.g., in <textarea>
? So, perhaps, the MOZ_ASSERT
should check whether it's less than the child count of the root (anonymous <div>
)?
Comment 4•3 years ago
|
||
That would be also weird since I think we removed trailing <br>
from TextEditors 👀
Assignee | ||
Comment 5•3 years ago
|
||
Okay, I got it. If our internal code select from and to outside the text node, i.e., the container is the anonymous <div>
element, TextEditor
tries to delete the text node due to its completely in the range.
Assignee | ||
Comment 6•3 years ago
|
||
Our internal code can touch internal Selection
object of <input>
and
<textarea>
, thus, selection ranges in them may set selection ranges not
in the text node. Therefore, we should make TextEditor
instance won't
try to delete ranges which crosses the range boundaries of the text node.
In a followup bug (perhaps, bug 1734846), we should split the deletion code into
TextEditor
and HTMLEditor
for making the code simpler and never regressed.
Assignee | ||
Comment 7•3 years ago
|
||
Our internal code can touch internal Selection
object of <input>
and
<textarea>
, thus, selection ranges in them may be not in the text node.
Therefore, we should make TextEditor
instance try to shrink the deleting
ranges into the text node first.
In a followup bug (perhaps, bug 1734846), we should split the deletion code into
TextEditor
and HTMLEditor
for making the code simpler and never regressed.
Updated•3 years ago
|
Comment 9•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Updated•3 years ago
|
Description
•