@Jolyon Smith: I think this is more of an "edge case" because while you're operating within allowed parameters, you're outside *recommended* ones.
To you, I recommend using the old-fashioned way to close a window: Double-clicking the system menu, which is still of infinite width and height (good luck if you're using Firefox, which no longer has a system menu in the upper-left corner.