Skip to content

Commit

Permalink
Make AutoMoveOneLineHandler track the new line range while moving c…
Browse files Browse the repository at this point in the history
…ontent nodes

It moves nodes in a range to new place one by one.  At this time, the moved
position range is not tracked.  Therefore, if the DOM tree is unexpectedly
changed by `HTMLEditor` itself, the range gets broken.  E.g., in this case,
deleting empty inline element causes the range after the source position is
broken.

Differential Revision: https://phabricator.services.mozilla.com/D192180

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1858794
gecko-commit: a7200c4d402a2ac9407512a17978f59356d94470
gecko-reviewers: m_kato
  • Loading branch information
masayuki-nakano authored and pull[bot] committed May 2, 2024
1 parent 89ba8fc commit 1480047
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions editing/crashtests/delete-at-text-following-svg.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
mask, li {
float: inline-start;
animation-name: kf0;
}
@keyframes kf0 {}
</style>
<script>
document.addEventListener("DOMContentLoaded", () => {
window.focus();
document.designMode = "on";
document.onpointerlockerror = onPointerLockErrorOrAnimationStart;
const mask = document.querySelector("mask");
mask.requestPointerLock();
mask.prepend(document.querySelector("table"));
});
function onPointerLockErrorOrAnimationStart() {
document.execCommand("underline");
document.execCommand("delete");
onanimationstart = onPointerLockErrorOrAnimationStart;
try {
getSelection().setBaseAndExtent(
document.querySelector("li"), 0,
document.querySelector("thead"), 0
);
} catch (e) {}
}
</script>
<body><svg>
<mask>
<clipPath>
</clipPath></mask></svg><sup>
AA
<li>
<br></li></sup><table>
<thead>
</thead></table>

0 comments on commit 1480047

Please sign in to comment.