Bug 16766 - DOM Range doesn't correctly update when modifying contents (Acid3)
Summary: DOM Range doesn't correctly update when modifying contents (Acid3)
Status: RESOLVED DUPLICATE of bug 11997
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-06 17:54 PST by Andrew Wellington
Modified: 2008-02-10 12:35 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Wellington 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;
Comment 1 Eric Seidel (no email) 2008-01-13 02:23:51 PST
ccing justin since he lives in the editing code so much.
Comment 2 Eric Seidel (no email) 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. :)
Comment 3 Darin Adler 2008-02-10 12:35:28 PST

*** This bug has been marked as a duplicate of 11997 ***