Bug 1363632 - rewrite test_497898.html. r=smaug

test_497898.html uses encoded URI in data:text/html, so I am going to
replace it with srcdoc attribute and also decode the URI into plain
html.
This commit is contained in:
Yoshi Huang 2017-05-10 11:52:33 +08:00
Родитель 87ffcf52fe
Коммит b823849d69
2 изменённых файлов: 22 добавлений и 2 удалений

Просмотреть файл

@ -18,7 +18,18 @@ setTimeout(function() {
}
</script>
<iframe src="data:application/xhtml+xml;charset=utf-8,%3Chtml%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%3E%0A%0A%3Ciframe%2F%3E%0A%3Cframeset%20onblur%3D%22window.frameElement.parentNode.removeChild(window.frameElement)%22%20id%3D%22frame%22%2F%3E%0A%0A%3Cscript%3E%0Afunction%20doe(i)%7B%0Adocument.getElementById('frame').focus()%3B%0Adocument.getElementsByTagName('*')%5B1%5D.focus()%3B%0A%7D%0Atop.opener.SimpleTest.waitForFocus(function%20()%20setTimeout(doe%2C%20100)%2C%20top)%3B%0A%3C%2Fscript%3E%0A%3C%2Fhtml%3E" onload="doe()" id="content"></iframe>
<iframe srcdoc="<html xmlns='http://www.w3.org/1999/xhtml'>
<iframe/>
<frameset onblur='window.frameElement.parentNode.removeChild(window.frameElement)' id='frame'/>
<script>
function doe(i){
document.getElementById('frame').focus();
document.getElementsByTagName('*')[1].focus();
}
top.opener.SimpleTest.waitForFocus(function () setTimeout(doe, 100), top);
</script>
</html>" onload="doe()" id="content"></iframe>
</body>
</html>

Просмотреть файл

@ -19,7 +19,16 @@ function switchFocus()
</script>
</head>
<body>
<iframe src="data:text/html;charset=utf-8,%3Chtml%3E%0A%3Chead%3E%3C/head%3E%0A%3Cbody%3E%0A%3Cbutton%20id%3D%22a%22%20onfocus%3D%22parent.switchFocus%28%29%22%20onblur%3D%22window.frameElement.parentNode.removeChild%28window.frameElement%29%22%3ESwitching%20focus%20to%20a%20different%20program%20should%20not%20crash%20Mozilla%3C/button%3E%0A%3Cscript%3E%0Adocument.getElementById%28%27a%27%29.focus%28%29%3B%0A%3C/script%3E%0A%3C/body%3E%0A%3C/html%3E"></iframe>
<iframe srcdoc="<html><meta charset='utf-8'>
<head></head>
<body>
<button id='a' onfocus='parent.switchFocus()' onblur='window.frameElement.parentNode.removeChild(window.frameElement)'>Switching focus to a different program should not crash Mozilla</button>
<script>
document.getElementById('a').focus();
</script>
</body>
</html>">
</iframe>
<p id="display"></p>
<div id="content" style="display: none"></div>