mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 00:05:36 +00:00
91af9cea10
This crash is that HTMLEditor::ClearStyle returns nullptr for aNode even if successful. When current start node and offset isn't within ancestor limiter, HTMLEditor::ClearStyle will return nullptr for split node even if successful. Because SplitNodeTransation returns error since Selection::Collapse is failed. Then, SplitNodeDeep in HTMLEditor::SplitStyleAvovePoint returns error. But this error is ignored. So node will becomes null even if successful. CreateStyleForInsertText will set new selection when there is split node, so we shouldn't set selection on ClearStyle. Also, InsertNodeTransation is ignored for error when Collapse is failed, but SplitNodeTransaction isn't ignored. We should create a rule when collapse is failed on transaction. And at feature, we shouldn't set selection in CreateStyleForInsertText, and then, it should return new insertion point for InsertText instead of setting new selection. MozReview-Commit-ID: BRKWLqTfrvC --HG-- extra : rebase_source : 2cd025e9d40688f643a843b39512dccc2bb7c4a2
30 lines
894 B
HTML
30 lines
894 B
HTML
<script>
|
|
function go() {
|
|
let selection = window.getSelection();
|
|
selection.setPosition(htmlvar00007, 1);
|
|
selection.setBaseAndExtent(htmlvar00011, 0, htmlvar00043, 0);
|
|
svgvar00014.before(svgvar00008.previousElementSibling);
|
|
|
|
document.execCommand("removeFormat", false);
|
|
document.execCommand("hiliteColor", false, "-moz-buttondefault");
|
|
document.execCommand("insertText", false, "");
|
|
}
|
|
function eh1() {
|
|
svgvar00007.appendChild(htmlvar00011);
|
|
htmlvar00003.appendChild(htmlvar00035);
|
|
}
|
|
</script>
|
|
<body onload=go()>
|
|
<span id="htmlvar00003">
|
|
<pre id="htmlvar00007" contenteditable="true">
|
|
<fieldset id="htmlvar00011"></fieldset>
|
|
<iframe srcdoc="H"></iframe>
|
|
<a id="htmlvar00035" hidden="hidden" contenteditable="true">
|
|
<svg>
|
|
<set onbegin="eh1()"/>
|
|
<use id="htmlvar00043">
|
|
<desc id="svgvar00007"></desc>
|
|
</use>
|
|
<font-face-uri id="svgvar00008"/>
|
|
<feComponentTransfer id="svgvar00014">
|