Chromium Code Reviews| Index: LayoutTests/fast/dom/Range/surroundContents-for-mutation.html |
| diff --git a/LayoutTests/fast/dom/Range/surroundContents-for-mutation.html b/LayoutTests/fast/dom/Range/surroundContents-for-mutation.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..194301e8c4123e0a10e9702dbe5946b630b774de |
| --- /dev/null |
| +++ b/LayoutTests/fast/dom/Range/surroundContents-for-mutation.html |
| @@ -0,0 +1,31 @@ |
| +<html> |
| +<head> |
| +<script src="../../../resources/js-test.js"></script> |
| +</head> |
| +<body> |
| +<div id='container'> |
| + <p id='start'>start</p> |
| + <iframe id='test'></iframe> |
| + <p id='end'>end</p> |
| +</div> |
| +<script> |
| +var range = document.createRange(); |
| +var start = document.getElementById('start'); |
| +range.setStart(start.firstChild, 0); |
| +range.setEnd(start.firstChild, 0); |
| + |
| +function loaded(ev) { |
|
Yuta Kitamura
2014/08/08 06:20:58
Urm okay, you were trying to use window.event. I d
kangil_
2014/08/08 06:32:50
Done.
|
| + var srcElement = event.srcElement; |
| + range.surroundContents(document.getElementById('end')); |
| + srcElement.outerHTML = ''; |
| +} |
| +document.addEventListener("load", loaded, true); |
| + |
| +var testFrame = document.getElementById('test'); |
| +shouldThrow("range.surroundContents(testFrame)", '"HierarchyRequestError: Failed to execute \'surroundContents\' on \'Range\': This operation would set range\'s end to parent with new offset, but there\'s no parent into which to continue."'); |
| + |
| +if (window.testRunner) |
| + document.getElementById('container').outerHTML = ''; |
| +</script> |
| +</body> |
| +</html> |