Bug 16727
Summary: | Different frame navigation policy in various browsers. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Yuzhu Shen <yuzhu.shen> |
Component: | Frames | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | abarth, bdakin, collinj, sam, webkit, yuzhu.shen |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
Yuzhu Shen
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.)
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Collin Jackson
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.
Yuzhu Shen
(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.
Adam Barth
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.
Collin Jackson
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.
Robert Blaut
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.