<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
<head>
<script>
function log(frame, success, isWidth, size) {
if (window.testRunner) {
document.getElementById("results").contentWindow.postMessage({
type: "log",
message: (success ? "PASS: " : "FAIL: ") + frame.name + " resized correctly"
}, "*");
} else {
frame.document.close();
if (success)
frame.document.write('<p>Success!</p>');
else {
var rect = frame.frameElement.getBoundingClientRect();
frame.document.write('<p>Resize until ');
frame.document.write(isWidth ? 'width:' : 'height:');
frame.document.write(isWidth ? rect.width : rect.height);
frame.document.write(' = ' + size + '</p>');
}
}
}
function checkProgress() {
if (!window.testRunner) {
checkSuccess();
}
}
function run() {
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.dumpChildFrames();
document.getElementById("results").contentWindow.postMessage({
type: "description",
message: "\nThis tests that frames with frameborder=0 can be resized. See WebKit Bug 23750. On success, two 'PASS' messages will be shown below."
}, "*");
// Move the One/* vertical resizer ten pixels west.
eventSender.mouseMoveTo(90, 400);
eventSender.mouseDown();
eventSender.mouseMoveTo(100, 400);
eventSender.mouseUp();
// Move the Two/Three horizontal resizer ten pixels south.
eventSender.mouseMoveTo(400, 70);
eventSender.mouseDown();
eventSender.mouseMoveTo(400, 80);
eventSender.mouseUp();
checkSuccess();
} else {
checkProgress();
}
}
function checkSuccess() {
log(One, One.frameElement.getBoundingClientRect().width == 100, true, 100)
log(Two, Two.frameElement.getBoundingClientRect().height == 80, false, 80)
}
window.onload = run;
</script>
</head>
<frameset cols="90,*" onmousemove="checkProgress()" onmouseup="checkProgress()" onmousedown="checkProgress()">
<frame frameborder=0 name="One" style="border-right: 2px solid green;"></frame>
<frameset rows="70,*" onmousemove="checkProgress()" onmouseup="checkProgress()" onmousedown="checkProgress()">
<frame frameborder=0 name="Two" style="border-bottom: 2px solid green;"></frame>
<frame id="results" frameborder=0 name="Three" src="data:text/html,<body bgcolor='gray'> <p id='description'>To resize frames drag the top or left of this frame </p><pre id='console'</pre><script>window.onmessage = e => { if (e.data.type === 'description') { document.getElementById('description').innerText = e.data.message; } else { document.getElementById('console').appendChild(document.createTextNode(e.data.message + '\n')); } }</script></body>"></frame>
</frameset>
</frameset>
</html>