Summary: | when open a link with empty target frame, always create a new window | ||
---|---|---|---|
Product: | WebKit | Reporter: | ZhangYong <leonzy> |
Component: | Frames | Assignee: | Nobody <webkit-unassigned> |
Status: | UNCONFIRMED --- | ||
Severity: | Normal | CC: | ap |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | All |
Description
ZhangYong
2010-12-21 01:46:35 PST
Thank you for the report! Do you have a test case or an example URL showing the problem? does this affect any live Web sites? try this: http://club3.kdnet.net/dispbbs.asp?boardid=1&id=6659651 (note it is in Chinese!) Click the page number (at the bottom of the page), it will open a new tab while IE&firefox will open in current tab. I've fix this problem, code as below: @@ -288,8 +288,11 @@ void FrameLoader::urlSelected(const ResourceRequest& request, const String& pass return; String target = passedTarget; - if (target.isEmpty()) + if (target.isEmpty()) { target = m_frame->document()->baseTarget(); + if (target == "_blank") + target = "_self"; + } FrameLoadRequest frameRequest(request, target); sorry, the patch need a fix @@ -288,8 +288,11 @@ void FrameLoader::urlSelected(const ResourceRequest& request, const String& pass return; String target = passedTarget; - if (target.isEmpty()) + if (target.isEmpty()) { target = m_frame->document()->baseTarget(); + if (target.isEmpty()) + target = "_self"; + } FrameLoadRequest frameRequest(request, target); (In reply to comment #2) > try this: > http://club3.kdnet.net/dispbbs.asp?boardid=1&id=6659651 > (note it is in Chinese!) > > Click the page number (at the bottom of the page), it will open a new tab while IE&firefox will open in current tab. > > I've fix this problem, code as below: > > @@ -288,8 +288,11 @@ void FrameLoader::urlSelected(const ResourceRequest& request, const String& pass > return; > > String target = passedTarget; > - if (target.isEmpty()) > + if (target.isEmpty()) { > target = m_frame->document()->baseTarget(); > + if (target == "_blank") > + target = "_self"; > + } > > FrameLoadRequest frameRequest(request, target); Would you be willing to submit a patch with a test case, as described in <http://webkit.org/coding/contributing.html>? |