mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1057677 - Crash in nsHTMLEditor::DoInsertHTMLWithContext; r=ehsan
This commit is contained in:
parent
21cc341295
commit
e4b461d0b3
9
editor/libeditor/crashtests/1057677.html
Normal file
9
editor/libeditor/crashtests/1057677.html
Normal file
@ -0,0 +1,9 @@
|
||||
<html><body></body><script>
|
||||
document.designMode = "on";
|
||||
var hrElem = document.createElement("HR");
|
||||
var select = window.getSelection();
|
||||
document.body.appendChild(hrElem);
|
||||
select.collapse(hrElem,0);
|
||||
document.execCommand("InsertHTML", false, "<div>foo</div><div>bar</div>");
|
||||
</script>
|
||||
</html>
|
@ -58,3 +58,4 @@ needs-focus load 771749.html
|
||||
load 772282.html
|
||||
load 776323.html
|
||||
needs-focus load 793866.html
|
||||
load 1057677.html
|
||||
|
@ -411,9 +411,9 @@ nsHTMLEditor::DoInsertHTMLWithContext(const nsAString & aInputString,
|
||||
// this is because if there is a br at end of what we paste, it will make
|
||||
// the invisible br visible.
|
||||
nsWSRunObject wsObj(this, parentNode, offsetOfNewNode);
|
||||
if (nsTextEditUtils::IsBreak(wsObj.mEndReasonNode) &&
|
||||
!IsVisBreak(wsObj.mEndReasonNode) )
|
||||
{
|
||||
if (wsObj.mEndReasonNode &&
|
||||
nsTextEditUtils::IsBreak(wsObj.mEndReasonNode) &&
|
||||
!IsVisBreak(wsObj.mEndReasonNode)) {
|
||||
rv = DeleteNode(wsObj.mEndReasonNode);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user