[Webkit-unassigned] [Bug 56682] Opening link with unspecific hash in a new tab (except context menu) twice in a row results in hash for current window changing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 24 23:59:23 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=56682





--- Comment #9 from ChangSeok Oh <kevin.cs.oh at gmail.com>  2011-04-24 23:59:23 PST ---
(In reply to comment #8)
> (From update of attachment 90367 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=90367&action=review
> 
> > Source/WebCore/loader/FrameLoader.cpp:1381
> > +    if (event && event->isMouseEvent()) {
> > +        RefPtr<MouseEvent> mouseEvent = static_pointer_cast<MouseEvent>(event);
> > +#if PLATFORM(MAC)
> > +        if (mouseEvent->metaKey()) {
> > +#else
> > +        if (mouseEvent->ctrlKey() || mouseEvent->button() == MiddleButton) {
> > +#endif
> > +            policyChecker()->checkNewWindowPolicy(action, FrameLoader::callContinueLoadAfterNewWindowPolicy,
> > +                request, formState.release(), frameName, this);
> > +            return;
> > +        }
> 
> This is the wrong place to do this work.  The FrameLoader shouldn't understand anything about the meta or ctrl keys.  Even worse, it shouldn't be encoding platform-specific behavior!

Then, what do you think about this way like following...??
First, we add new API (like .. needToOpenNewWindow?) in PlatformMouseEvent & MouseEvent. This API is just getter function of boolean value m_needToOpenNewWindow which is decided when PlatformMouseEvent is initialized.
Second, we check whether new window should be opened or not with this common API in FrameLoader::loadURL.

I think we can avoid decoding platform specific behavior with this way in FrameLoader.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list