Bug 148773

Summary: Range.deleteContents cannot delete DocType
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, cdumez, commit-queue, darin, esprehn+autocc, kangil.han, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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.