WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 11997
16766
DOM Range doesn't correctly update when modifying contents (Acid3)
https://bugs.webkit.org/show_bug.cgi?id=16766
Summary
DOM Range doesn't correctly update when modifying contents (Acid3)
Andrew Wellington
Reported
2008-01-06 17:54:35 PST
This is related to
http://bugs.webkit.org/show_bug.cgi?id=16764
but applies to changing the contents of the range not using the range API, but just directly messing with the DOM that contains the range. Test 16: FAIL (collapsed is wrong after deletion) // test 16: Ranges under mutations: deletion var doc = getTestDocument(); var p = doc.createElement('p'); p.appendChild(doc.createTextNode("12345")); doc.body.appendChild(p); var r = doc.createRange(); r.setEnd(doc.body, 1); r.setStart(p.firstChild, 2); assert(!r.collapsed, "collapsed is wrong at start"); assertEquals(r.commonAncestorContainer, doc.body, "commonAncestorContainer is wrong at start"); assertEquals(r.startContainer, p.firstChild, "startContainer is wrong at start"); assertEquals(r.startOffset, 2, "startOffset is wrong at start"); assertEquals(r.endContainer, doc.body, "endContainer is wrong at start"); assertEquals(r.endOffset, 1, "endOffset is wrong at start"); doc.body.removeChild(p); assert(r.collapsed, "collapsed is wrong after deletion"); assertEquals(r.commonAncestorContainer, doc.body, "commonAncestorContainer is wrong after deletion"); assertEquals(r.startContainer, doc.body, "startContainer is wrong after deletion"); assertEquals(r.startOffset, 0, "startOffset is wrong after deletion"); assertEquals(r.endContainer, doc.body, "endContainer is wrong after deletion"); assertEquals(r.endOffset, 0, "endOffset is wrong after deletion"); return 1;
Attachments
Add attachment
proposed patch, testcase, etc.
Eric Seidel (no email)
Comment 1
2008-01-13 02:23:51 PST
ccing justin since he lives in the editing code so much.
Eric Seidel (no email)
Comment 2
2008-01-13 02:24:26 PST
actually, I meant to CC justin on the one that I'd solved, not the one I was about to solve. :)
Darin Adler
Comment 3
2008-02-10 12:35:28 PST
*** This bug has been marked as a duplicate of
11997
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug