Bug 148773 - Range.deleteContents cannot delete DocType
Summary: Range.deleteContents cannot delete DocType
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-09-03 19:14 PDT by Ryosuke Niwa
Modified: 2015-09-17 08:51 PDT (History)
8 users (show)

See Also:


Attachments
Patch (6.26 KB, patch)
2015-09-16 19:50 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2015-09-03 19:14:21 PDT
<!DOCTYPE html>
<html>
<body>
<script>

var range = document.createRange();
range.setStart(document, 0);
range.setEnd(document, 1);
range.deleteContents();

</script>
</body>
</html>

throws an exception because we attempt to insert a DOCTYPE into a document fragment inside Range::processContents but it shouldn't.

This bug was found by the newly added test: LayoutTests/http/tests/w3c/dom/ranges/Range-deleteContents.html
Comment 1 Radar WebKit Bug Importer 2015-09-03 19:14:56 PDT
<rdar://problem/22571280>
Comment 2 Chris Dumez 2015-09-16 19:50:45 PDT
Created attachment 261355 [details]
Patch
Comment 3 Chris Dumez 2015-09-17 08:51:21 PDT
Comment on attachment 261355 [details]
Patch

Clearing flags on attachment: 261355

Committed r189914: <http://trac.webkit.org/changeset/189914>
Comment 4 Chris Dumez 2015-09-17 08:51:27 PDT
All reviewed patches have been landed.  Closing bug.