Bug 24122

Summary: REGRESSION: DOM Range extractContents/deleteContents bug
Product: WebKit Reporter: Johan "Spocke" Sörlin <spocke>
Component: DOMAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Critical CC: ap, justin.garcia, nicksantos
Priority: P1 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://tinymce.moxiecode.com/safari/range_tests.html
Attachments:
Description Flags
Test case for the DOM Range implementation
none
proposed fix darin: review+

Johan "Spocke" Sörlin
Reported 2009-02-24 07:40:10 PST
The current implementation of the DOM Range is not compatible with other browsers or previous versions of WebKit. If you test the attached test case in Safari 3, FF 3, Opera 9 it will only fail on one point the cloneContents but on the latest WebKit it fails on both extractContents and deleteContents. If you run the same tests on the latest nightly of FF and the latest build of Opera it will pass all tests so the attached test case is compatible to the spec or at least to the latest implementations by other browser vendors.
Attachments
Test case for the DOM Range implementation (22.06 KB, text/html)
2009-02-24 07:45 PST, Johan "Spocke" Sörlin
no flags
proposed fix (6.06 KB, patch)
2009-03-19 16:36 PDT, Alexey Proskuryakov
darin: review+
Johan "Spocke" Sörlin
Comment 1 2009-02-24 07:45:35 PST
Created attachment 27917 [details] Test case for the DOM Range implementation Run this test file in latest WebKit.
Johan "Spocke" Sörlin
Comment 2 2009-02-24 07:49:11 PST
Check the URL not the attached file since it requests things using https and it fails from https.
Alexey Proskuryakov
Comment 3 2009-02-25 06:53:30 PST
Confirmed that the test passes in Safari/WebKit 3.2.1 and in Minefield, but fails in r41181.
Alexey Proskuryakov
Comment 4 2009-03-12 02:40:42 PDT
Alexey Proskuryakov
Comment 5 2009-03-19 16:36:22 PDT
Created attachment 28771 [details] proposed fix I couldn't find any remnants of code that could make this work, so it's surprising that this is a regression. Perhaps this code was removed in hopes that Document::textRemoved() would automatically take care of fixing the range? It does not, and it is not supposed to - I've verified that a range that's equal to the one that deleteContents is invoked on ends up being different from it in Firefox: var range1 = something var range2 = the same range1.deleteContents() // Both ranges are fixed, but differently - range1 is always collapsed, but range2 may not be.
Darin Adler
Comment 6 2009-03-19 18:04:14 PDT
Comment on attachment 28771 [details] proposed fix r=me I was probably the one who broke this. Thanks for fixing it!
Alexey Proskuryakov
Comment 7 2009-03-20 01:19:00 PDT
*** Bug 24677 has been marked as a duplicate of this bug. ***
Alexey Proskuryakov
Comment 8 2009-03-20 01:19:23 PDT
Julie Parent
Comment 9 2009-03-28 10:02:16 PDT
*** Bug 24896 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.