Bug 16727 - Different frame navigation policy in various browsers.
Summary: Different frame navigation policy in various browsers.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-03 22:24 PST by Yuzhu Shen
Modified: 2008-07-28 14:08 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuzhu Shen 2008-01-03 22:24:40 PST
According to the policy discussed in bug 15936, I've created a scenario
in which various browsers act differently.

Assume that the following files are located at http://aaa.bbb.com/
Note: If you want to try out this example, change the value of document.domain
accordingly in these files! It should be a suffix of the real domain in which
these files reside.
====================================
<!-- navigation.htm -->
<html>
<head>
    <title></title>
    <script language="javascript">document.domain='bbb.com';</script>
</head>
<frameset name="main" cols="503,*">
        <frame name="left" src="left.htm" />
        <frame name="right" src="right.htm" />
</frameset>
</html>
================================
<!-- left.htm -->
<html>
<head>
    <title></title>
    <base target='right'>
</head>
<body>
    <a href='helloWorld.htm'>HelloWorld</a>
</body>
</html>
=================================
<!-- right.htm -->
<html>
<head>
    <title></title>
</head>
<body>
    <script language="javascript">document.domain='bbb.com';</script>
</body>
</html>
=================================
<!-- helloWorld.htm -->
<html>
<body>
    <h1>Hello World!</h1>
</body>
</html>
=================================

Open navigation.htm, and then click the "HelloWorld" link:
IE7: will open the link in a new tab instead of the target frame.
IE6, Firefox2/3, Safari 3.0.3: will open the link in the target frame.
Current WebKit: will do nothing.

This problem affects a popular forum in China: http://dzh.mop.com
In this forum, if you click a link in the left panel, current WebKit will not
open the link. (Due to some other reasons, IE7 works fine with this site.)
Comment 1 Collin Jackson 2008-01-03 22:49:44 PST
When the browser's frame navigation policy wants to prevent a frame from being navigated, the most user-friendly behavior is to open a new window, as in IE7. I think the patch for bug 16522 will provide this behavior.
Comment 2 Yuzhu Shen 2008-01-03 23:31:39 PST
(In reply to comment #1)
> When the browser's frame navigation policy wants to prevent a frame from being
> navigated, the most user-friendly behavior is to open a new window, as in IE7.
> I think the patch for bug 16522 will provide this behavior.
> 

I have no right to access bug 16522. Has the patch been submitted into the WebKit code base? I compiled WebKit 2 or 3 hours ago, and ran safari with it. And it did exactly what I described in previous post.

Comment 3 Adam Barth 2008-01-04 18:26:48 PST
I tried using http://dzh.mop.com in IE7.  Clicking on links in the left-hand frame opens a new tab with the content.  WebKit should have the same behavior after the patch for Bug 16522 lands.

> I have no right to access bug 16522. Has the patch been submitted into the
> WebKit code base?

The patch has not been committed yet, but hopefully it will be soon.  I don't have authorization to add you to the bug, but it's a bug about this and one other issue with frame navigation.

If you'd like the links to open in the right-hand frame instead of in new tabs in IE7 (and future-Safari), you can put the left-hand frame in the same origin as either the top or right-hand frame (or both).  The simplest way to do this is to set document.domain = "mop.com" in the left-hand frame.
Comment 4 Collin Jackson 2008-01-10 17:13:07 PST
The behavior in WebKit (as of r29380) now matches the IE7 behavior. Clicking links in the left frame now causes a new window to be opened.
Comment 5 Robert Blaut 2008-07-28 14:08:19 PDT
After testing the reported issue I can report that WebKit, Firefox 3 and IE7 matches the same behavior - they open links in new tab/window. Only Opera 9.5 behaves differently, but I think they changes his behavior in a future.

I think we can close the report now since three major browsers behave identically now.