Chromium Code Reviews| Index: LayoutTests/editing/style/apply-style-crash3.html |
| diff --git a/LayoutTests/editing/style/apply-style-crash3.html b/LayoutTests/editing/style/apply-style-crash3.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8d3b1a266e146e950652bc68f38b98887f2f72e4 |
| --- /dev/null |
| +++ b/LayoutTests/editing/style/apply-style-crash3.html |
| @@ -0,0 +1,41 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<script src="../../resources/js-test.js"></script> |
| +</head> |
| +<body> |
| +<unknown> |
| +<script> |
| + |
| +if (window.testRunner) { |
| + testRunner.dumpAsText(); |
| + testRunner.waitUntilDone(); |
| +} |
| + |
| +window.jsTestIsAsync = true; |
| + |
| +function onDOMNodeRemoved(e) { |
| + try { |
| + e.srcElement.insertAdjacentHTML('afterbegin', ' '); |
| + document.execCommand('FontSizeDelta', false, '1px'); |
| + } catch(e) {} |
|
leviw_travelin_and_unemployed
2015/05/05 18:21:40
Is this try/catch necessary?
sof
2015/05/05 19:47:32
An alternative is to add an Element type check, wh
|
| +} |
| +document.addEventListener("DOMNodeRemoved", onDOMNodeRemoved, false); |
| + |
| +function runTest() { |
| + document.designMode = document.designMode == "on" ? "off" : "on"; |
| + document.execCommand("SelectAll", false) |
| + var unknown = document.getElementsByTagName("unknown")[0]; |
| + unknown.textContent = "sss"; |
| + unknown.outerHTML = ""; |
| + document.execCommand("SelectAll", false); |
| + // Put description() here so as to not upset test condition. |
| + description("Verify that changing the style over an unknown element does not crash."); |
| + finishJSTest(); |
| +} |
| + |
| +window.onload = runTest; |
|
leviw_travelin_and_unemployed
2015/05/05 18:21:40
If you move this script tag to the end, you probab
sof
2015/05/05 19:47:32
Moved stuff around a bit to avoid having to trigge
|
| +</script> |
| +<textarea> |
| +</body> |
|
leviw_travelin_and_unemployed
2015/05/05 18:21:40
Nit: </body> and </html> aren't necessary.
sof
2015/05/05 19:47:32
Just following local convention :)
|
| +</html> |