2007-03-07

Shame IE7 break backward compatibilty on showModelessDialog and showModalDialog

Please read Why Does IE Resize My Dialogs written by Travis, the program manager for Trident/OM. And more importantly, read the comments of this article.

Golad is totally right, and the arguments oppose him are feeble. MS IE team shouldn't, needn't change the meanings of dialogWidth/dialogHeight. Just introduce two new property (innerWidth/innerHeight is good name which Mozilla and Opera use for such case) is fine!

Ironically, it is said:

IE7 no longer provides a method for script to retrieve the dialog’s frame dimensions ('chrome' area included). This was formerly available through window.dialogHeight/Width, which now returns the content area. Future versions of IE may provide this functionality.

Does Travis try to tell us IE8 will introduce outerHeight/outerWidth(or any other names, who care?) which just have the same meaning as dialogHeight/dialogWidth before IE7? Ridiculously!! Why not leave dialogHeight/dialogWidth away, and introduce innerHeight/innerWidth?

Someone said it's good because it fix the past mistake, but I say no! The past mistake can never be fixed, because we will still face the users who use the past system. The worst thing is, this 'fix' corrupt our patch(eg. check offsetHeight/offsetWidth to adjust the dialog size) for the original mistake!!! We have had to pay for MS mistake once. Now we have to pay for it twice!!

But now, everything is too late. They, the team in the richest software company, ignored the right opinions, and released IE7 with such mistake, and we, web developers, are compelled to write tons of version-specific hack. Damn!

It's not the first time MS break the backward compatibility. See Ridiculous 'Backward Compatibility' by M$ (written in Chinese) for a example about JavaScript.

BTW, this behavior change of dialog also introduce a new bug (tested under Vista RTM). Call showModelessDialog(url, args, 'resizable:yes;dialogWidth:320px;dialogHeight:480px') to open a simplest page which only one line:

<!DOCTYPE html>

This line means the page should render in standard mode. Then resize the dialog, u will see the scrollbar will occurs if the window size is smaller than original size. If u add some contents in the page, u will see the viewport(the 'initial containing block' in css term) of the page is never resize!!

At first, I thought it may be by design for IE7, but after I found that the behavior of quirk mode is same as IE6, I soon realized that it's not a feature but a bug which IE dev team and QA team all missed. Shame MS again! No one tested any standard mode page in a resizable dialog?

It costs me two hours to get a workaround. I'll post it later.

No comments: