Bug 7366 - window.resize*() prevents user from subsequently changing window height
Summary: window.resize*() prevents user from subsequently changing window height
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 417.x
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2006-02-19 11:41 PST by Christian Swinehart
Modified: 2022-07-24 16:10 PDT (History)
7 users (show)

See Also:


Attachments
Testcase (788 bytes, text/html)
2006-02-19 12:59 PST, Joost de Valk (AlthA)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Swinehart 2006-02-19 11:41:12 PST
Each time window.resizeBy() is called in the attached script, the minimum height of the window seems to creep up by ten or twenty pixels. To reproduce the bug, click the 'Resize' link a dozen times or so then try to resize the window vertically and you'll find that you're limited in how much shorter you can make the window. If you clicked the link enough, you won't be able to shorten the window at all.

For whatever reason, the doResizeHack() function seems to get around this.

An additional bit of weirdness is that simply reloading the page won't restore normal resizing. You actually need to open a new window to get control back.

---
The code:

<html>
<head>
<title>WebKit Vertical Resize Bug</title>
</head>
<body>
<script>

var whichState=true;
function doResize(){
	if (whichState){
		window.resizeBy(-140,0);
	}else{
		window.resizeBy(140,0);
	}
	whichState = !whichState;
}

function doResizeHack(){
	var winHeight = window.outerHeight - 100;
	if (whichState){
		window.resizeBy(-140,0);
		window.resizeBy(0,-winHeight);
		window.resizeBy(0,winHeight);
	}else{
		window.resizeBy(140,0);
		window.resizeBy(0,-winHeight);
		window.resizeBy(0,winHeight);
	}
	whichState = !whichState;
}
</script>
<a href="javascript:doResize()">Resize</a>

</body>
</html>
Comment 1 Joost de Valk (AlthA) 2006-02-19 12:59:15 PST
Created attachment 6615 [details]
Testcase
Comment 2 Joost de Valk (AlthA) 2006-02-19 13:03:19 PST
Confirmed. Very, very weird....
Comment 3 Ahmad Saleem 2022-07-24 16:00:20 PDT
I am able unable to reproduce this bug in Safari 15.6 on macOS 12.5 using attached test case and the test case didn't had any warning in Console. I performed the test in Private Window.

> Open the test case
> Checked the window height - how small, I can make
> Clicked "RESIZE" multiple time (definitely lost the count)
> Resize and I was able to resize as much as I can before (vertically)

I am not able to reproduce the behaviour mentioned in Comment 0 where the resize script will restrict Safari ability to resize window vertically.

It might be platform or webkit dependent browser specific but it is not reproducible in Safari 15.6. It does not work across other browsers as well and change their minimum height vertically.

I think this can be marked as "RESOLVED CONFIGURATION CHANGED". Thanks!