Bug 1442506: Adjust assertion to allow empty appends. r=xidorn

Deletion at the end of a text-node ends up translated to an empty append. It's
harmless though.

Reviewers: xidorn

Bug #: 1442506

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

MozReview-Commit-ID: DqheOYVWx8o
This commit is contained in:
Emilio Cobos Álvarez 2018-03-02 12:07:24 +01:00
parent 32245cbe28
commit 549e302e25
3 changed files with 12 additions and 1 deletions

View File

@ -207,7 +207,7 @@ WhitespaceOnlyChangedOnAppend(const CharT* aBuffer,
size_t aOldLength,
size_t aNewLength)
{
MOZ_ASSERT(aOldLength < aNewLength);
MOZ_ASSERT(aOldLength <= aNewLength);
if (!WhitespaceOnly(aBuffer, aOldLength)) {
// The old text was already not whitespace-only.
return false;

View File

@ -0,0 +1,10 @@
<script>
function go() {
var b = window.getSelection();
var c = document.getSelection();
b.setBaseAndExtent(document.getElementById("a"), 0, document.body.firstChild, 1);
c.deleteFromDocument();
}
</script>
<body onload=go()>
<p id="a">

View File

@ -525,3 +525,4 @@ load 1429961.html
load 1435015.html
load 1429962.html
pref(dom.webcomponents.shadowdom.enabled,true) load 1439016.html
load 1442506.html