mirror of
https://github.com/servo/servo.git
synced 2025-10-01 09:09:15 +01:00
Auto merge of #6826 - dzbarsky:deletecontents, r=jdm
Implement Range#deleteContents Sadly calling ExtractContents and discarding the result doesn't do the right thing. It may be worth having a CutContents method that takes an `Option<DocumentFragment>` and switch the behavior based on it, to share the code between DeleteContents and ExtractContents, like what Gecko does. Maybe a followup. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6826) <!-- Reviewable:end -->
This commit is contained in:
commit
e7b1924948
6 changed files with 116 additions and 299 deletions
|
@ -5469,6 +5469,12 @@
|
|||
"url": "/_mozilla/mozilla/proxy_setter.html"
|
||||
}
|
||||
],
|
||||
"mozilla/range_deleteContents.html": [
|
||||
{
|
||||
"path": "mozilla/range_deleteContents.html",
|
||||
"url": "/_mozilla/mozilla/range_deleteContents.html"
|
||||
}
|
||||
],
|
||||
"mozilla/response-data-brotli.htm": [
|
||||
{
|
||||
"path": "mozilla/response-data-brotli.htm",
|
||||
|
|
18
tests/wpt/mozilla/tests/mozilla/range_deleteContents.html
Normal file
18
tests/wpt/mozilla/tests/mozilla/range_deleteContents.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test(function() {
|
||||
var range = document.createRange();
|
||||
range.setStart(document, 0);
|
||||
range.setEnd(document, 1);
|
||||
range.deleteContents();
|
||||
assert_equals(document.childNodes.length, 1);
|
||||
}, "Deleting range containing doctype");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue