It really needs to be split into 2 buttons: "Back" and "Parent" (or "Up"). People use the back button for both purposes. And when you involve Iframes and Ajax-heavy web applications, the context of "back" gets entirely lost and broken.
It's a big problem. There is an HTML5 api to give some level of control over the back button, and this may help to a certain degree. But I really believe it would be preferable to just move these concepts (navigate back and up) right into the web page, or the web application.
There is absolutely nothing preventing web applications from giving a superior navigation experience than a one-size-fits-all web browser buttons.