diff options
Diffstat (limited to 'WebKit/win')
-rw-r--r-- | WebKit/win/ChangeLog | 56 | ||||
-rw-r--r-- | WebKit/win/Interfaces/IWebPreferencesPrivate.idl | 3 | ||||
-rwxr-xr-x | WebKit/win/Interfaces/IWebUIDelegatePrivate.idl | 11 | ||||
-rw-r--r-- | WebKit/win/Interfaces/WebKit.idl | 3 | ||||
-rw-r--r-- | WebKit/win/WebCoreSupport/WebChromeClient.cpp | 15 | ||||
-rw-r--r-- | WebKit/win/WebCoreSupport/WebChromeClient.h | 1 | ||||
-rw-r--r-- | WebKit/win/WebPreferenceKeysPrivate.h | 2 | ||||
-rw-r--r-- | WebKit/win/WebPreferences.cpp | 14 | ||||
-rw-r--r-- | WebKit/win/WebPreferences.h | 5 | ||||
-rw-r--r-- | WebKit/win/WebView.cpp | 67 |
10 files changed, 120 insertions, 57 deletions
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog index 18f2d73..d943cc6 100644 --- a/WebKit/win/ChangeLog +++ b/WebKit/win/ChangeLog @@ -1,3 +1,59 @@ +2010-07-03 Jon Honeycutt <jhoneycutt@apple.com> + + The missing plug-in indicator should be clickable + + https://bugs.webkit.org/show_bug.cgi?id=41550 + <rdar://problem/8132162> + + From an original patch by Kevin Decker. + + Reviewed by Darin Adler. + + * Interfaces/IWebUIDelegatePrivate.idl: + Added a new delegate interface, and declare a function + didPressMissingPluginButton(). + + * Interfaces/WebKit.idl: + Touch this file to force interfaces to be rebuilt. + + * WebCoreSupport/WebChromeClient.cpp: + (WebChromeClient::missingPluginButtonClicked): + Get the UI delegate, and query it for IWebUIDelegatePrivate3. Call its + didPressMissingPluginButton() function. + + * WebCoreSupport/WebChromeClient.h: + Declare an override of missingPluginButtonClicked(). + +2010-07-03 Erik Arvidsson <arv@chromium.org> + + Reviewed by Ojan Vafai. + + Fix issue where a contextmenu event was reporting the wrong target + if the context menu was shown due to pressing the context menu key + (or Shift+F10). + + * WebView.cpp: + (WebView::handleContextMenuEvent): + +2010-07-01 Steve Falkenburg <sfalken@apple.com> + + Reviewed by Adele Peterson. + + Provide a WebView preference to disable DNS prefetching on Windows + https://bugs.webkit.org/show_bug.cgi?id=41504 + <rdar://problem/8151939> + + * Interfaces/IWebPreferencesPrivate.idl: Added isDNSPrefetchingEnabled, setDNSPrefetchingEnabled. + * Interfaces/WebKit.idl: Touched to force IDL build. + * WebPreferenceKeysPrivate.h: Added WebKitDNSPrefetchingEnabledPreferenceKey. + * WebPreferences.cpp: + (WebPreferences::initializeDefaultSettings): Default prefetch to true. + (WebPreferences::setDNSPrefetchingEnabled): Added. + (WebPreferences::isDNSPrefetchingEnabled): Added. + * WebPreferences.h: Added isDNSPrefetchingEnabled, setDNSPrefetchingEnabled. + * WebView.cpp: + (WebView::notifyPreferencesChanged): Propagate prefetch pref into settings. + 2010-06-21 Nate Chapin <japhet@chromium.org> Unreviewed, Windows build fix. diff --git a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl index 2cb4037..119c3ff 100644 --- a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl +++ b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl @@ -112,4 +112,7 @@ interface IWebPreferencesPrivate : IUnknown HRESULT javaScriptCanAccessClipboard([out, retval] BOOL *enabled); HRESULT setJavaScriptCanAccessClipboard([in] BOOL enabled); + + HRESULT isDNSPrefetchingEnabled([out, retval] BOOL *enabled); + HRESULT setDNSPrefetchingEnabled([in] BOOL enabled); } diff --git a/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl b/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl index 215c427..1431db2 100755 --- a/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl +++ b/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl @@ -99,3 +99,14 @@ interface IWebUIDelegatePrivate2 : IWebUIDelegatePrivate HRESULT decidePolicyForGeolocationRequest([in] IWebView* sender, [in] IWebFrame* frame, [in] IWebSecurityOrigin* origin, [in] IWebGeolocationPolicyListener* listener); } + +[ + object, + oleautomation, + uuid(e9834891-233b-48a0-984b-8f8a19abdd0f), + pointer_default(unique) +] +interface IWebUIDelegatePrivate3 : IWebUIDelegatePrivate2 +{ + HRESULT didPressMissingPluginButton([in] IDOMElement*); +} diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl index 98f5da8..8938501 100644 --- a/WebKit/win/Interfaces/WebKit.idl +++ b/WebKit/win/Interfaces/WebKit.idl @@ -20,7 +20,7 @@ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ cpp_quote("/*") @@ -300,4 +300,3 @@ library WebKit [default] interface IWebUserContentURLPattern; } } - diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp index 587637f..d45e10c 100644 --- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp +++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp @@ -28,6 +28,7 @@ #include "COMPropertyBag.h" #include "COMVariantSetter.h" +#include "DOMCoreClasses.h" #include "WebElementPropertyBag.h" #include "WebFrame.h" #include "WebGeolocationPolicyListener.h" @@ -534,6 +535,20 @@ void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& result, unsig uiDelegate->mouseDidMoveOverElement(m_webView, element.get(), modifierFlags); } +void WebChromeClient::missingPluginButtonClicked(Element* element) const +{ + COMPtr<IWebUIDelegate> uiDelegate; + if (FAILED(m_webView->uiDelegate(&uiDelegate))) + return; + + COMPtr<IWebUIDelegatePrivate3> uiDelegatePrivate3(Query, uiDelegate); + if (!uiDelegatePrivate3) + return; + + COMPtr<IDOMElement> e(AdoptCOM, DOMElement::createInstance(element)); + uiDelegatePrivate3->didPressMissingPluginButton(e.get()); +} + void WebChromeClient::setToolTip(const String& toolTip, TextDirection) { m_webView->setToolTip(toolTip); diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.h b/WebKit/win/WebCoreSupport/WebChromeClient.h index 6954fde..c8a9451 100644 --- a/WebKit/win/WebCoreSupport/WebChromeClient.h +++ b/WebKit/win/WebCoreSupport/WebChromeClient.h @@ -105,6 +105,7 @@ public: virtual void scrollbarsModeDidChange() const { } virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags); + virtual void missingPluginButtonClicked(WebCore::Element*) const; virtual void setToolTip(const WebCore::String&, WebCore::TextDirection); diff --git a/WebKit/win/WebPreferenceKeysPrivate.h b/WebKit/win/WebPreferenceKeysPrivate.h index da63754..40c86c0 100644 --- a/WebKit/win/WebPreferenceKeysPrivate.h +++ b/WebKit/win/WebPreferenceKeysPrivate.h @@ -143,3 +143,5 @@ #define WebKitShowRepaintCounterPreferenceKey "WebKitShowRepaintCounter" #define WebKitCustomDragCursorsEnabledPreferenceKey "WebKitCustomDragCursorsEnabled" + +#define WebKitDNSPrefetchingEnabledPreferenceKey "WebKitDNSPrefetchingEnabled" diff --git a/WebKit/win/WebPreferences.cpp b/WebKit/win/WebPreferences.cpp index e49bd20..12b0a72 100644 --- a/WebKit/win/WebPreferences.cpp +++ b/WebKit/win/WebPreferences.cpp @@ -261,6 +261,8 @@ void WebPreferences::initializeDefaultSettings() CFDictionaryAddValue(defaults, CFSTR(WebKitShowDebugBordersPreferenceKey), kCFBooleanFalse); + CFDictionaryAddValue(defaults, CFSTR(WebKitDNSPrefetchingEnabledPreferenceKey), kCFBooleanTrue); + defaultSettings = defaults; } @@ -1471,6 +1473,18 @@ HRESULT WebPreferences::customDragCursorsEnabled(BOOL* enabled) return S_OK; } +HRESULT WebPreferences::setDNSPrefetchingEnabled(BOOL enabled) +{ + setBoolValue(CFSTR(WebKitDNSPrefetchingEnabledPreferenceKey), enabled); + return S_OK; +} + +HRESULT WebPreferences::isDNSPrefetchingEnabled(BOOL* enabled) +{ + *enabled = boolValueForKey(CFSTR(WebKitDNSPrefetchingEnabledPreferenceKey)); + return S_OK; +} + void WebPreferences::willAddToWebView() { ++m_numWebViews; diff --git a/WebKit/win/WebPreferences.h b/WebKit/win/WebPreferences.h index 1ea69c7..fc57241 100644 --- a/WebKit/win/WebPreferences.h +++ b/WebKit/win/WebPreferences.h @@ -420,7 +420,10 @@ public: virtual HRESULT STDMETHODCALLTYPE setShowRepaintCounter(BOOL); virtual HRESULT STDMETHODCALLTYPE showRepaintCounter(BOOL*); - // WebPreferences + virtual HRESULT STDMETHODCALLTYPE setDNSPrefetchingEnabled(BOOL); + virtual HRESULT STDMETHODCALLTYPE isDNSPrefetchingEnabled(BOOL*); + + // WebPreferences // This method accesses a different preference key than developerExtrasEnabled. // See <rdar://5343767> for the justification. diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp index a1aa5c2..441f0f2 100644 --- a/WebKit/win/WebView.cpp +++ b/WebKit/win/WebView.cpp @@ -1188,60 +1188,19 @@ Page* WebView::page() bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam) { - static const int contextMenuMargin = 1; - // Translate the screen coordinates into window coordinates POINT coords = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; if (coords.x == -1 || coords.y == -1) { - FrameView* view = m_page->mainFrame()->view(); - if (!view) - return false; + // The contextMenuController() holds onto the last context menu that was popped up on the + // page until a new one is created. We need to clear this menu before propagating the event + // through the DOM so that we can detect if we create a new menu for this event, since we + // won't create a new menu if the DOM swallows the event and the defaultEventHandler does + // not run. + m_page->contextMenuController()->clearContextMenu(); - int rightAligned = ::GetSystemMetrics(SM_MENUDROPALIGNMENT); - IntPoint location; - - // The context menu event was generated from the keyboard, so show the context menu by the current selection. - Position start = m_page->mainFrame()->selection()->selection().start(); - Position end = m_page->mainFrame()->selection()->selection().end(); - - if (!start.node() || !end.node()) - location = IntPoint(rightAligned ? view->contentsWidth() - contextMenuMargin : contextMenuMargin, contextMenuMargin); - else { - RenderObject* renderer = start.node()->renderer(); - if (!renderer) - return false; - - // Calculate the rect of the first line of the selection (cribbed from -[WebCoreFrameBridge firstRectForDOMRange:], - // now Frame::firstRectForRange(), which perhaps this should call). - int extraWidthToEndOfLine = 0; - - InlineBox* startInlineBox; - int startCaretOffset; - start.getInlineBoxAndOffset(DOWNSTREAM, startInlineBox, startCaretOffset); - IntRect startCaretRect = renderer->localCaretRect(startInlineBox, startCaretOffset, &extraWidthToEndOfLine); - if (startCaretRect != IntRect()) - startCaretRect = renderer->localToAbsoluteQuad(FloatRect(startCaretRect)).enclosingBoundingBox(); - - InlineBox* endInlineBox; - int endCaretOffset; - end.getInlineBoxAndOffset(UPSTREAM, endInlineBox, endCaretOffset); - IntRect endCaretRect = renderer->localCaretRect(endInlineBox, endCaretOffset); - if (endCaretRect != IntRect()) - endCaretRect = renderer->localToAbsoluteQuad(FloatRect(endCaretRect)).enclosingBoundingBox(); - - IntRect firstRect; - if (startCaretRect.y() == endCaretRect.y()) - firstRect = IntRect(min(startCaretRect.x(), endCaretRect.x()), startCaretRect.y(), abs(endCaretRect.x() - startCaretRect.x()), max(startCaretRect.height(), endCaretRect.height())); - else - firstRect = IntRect(startCaretRect.x(), startCaretRect.y(), startCaretRect.width() + extraWidthToEndOfLine, startCaretRect.height()); - - location = IntPoint(rightAligned ? firstRect.right() : firstRect.x(), firstRect.bottom()); - } + Frame* focusedFrame = m_page->focusController()->focusedOrMainFrame(); + return focusedFrame->eventHandler()->sendContextMenuEventForKey(); - location = view->contentsToWindow(location); - // FIXME: The IntSize(0, -1) is a hack to get the hit-testing to result in the selected element. - // Ideally we'd have the position of a context menu event be separate from its target node. - coords = location + IntSize(0, -1); } else { if (!::ScreenToClient(m_viewWindow, &coords)) return false; @@ -1249,11 +1208,6 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam) lParam = MAKELPARAM(coords.x, coords.y); - // The contextMenuController() holds onto the last context menu that was popped up on the - // page until a new one is created. We need to clear this menu before propagating the event - // through the DOM so that we can detect if we create a new menu for this event, since we - // won't create a new menu if the DOM swallows the event and the defaultEventHandler does - // not run. m_page->contextMenuController()->clearContextMenu(); IntPoint documentPoint(m_page->mainFrame()->view()->windowToContents(coords)); @@ -4792,6 +4746,11 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) settings->setWebGLEnabled(true); #endif // ENABLE(3D_CANVAS) + hr = prefsPrivate->isDNSPrefetchingEnabled(&enabled); + if (FAILED(hr)) + return hr; + settings->setDNSPrefetchingEnabled(enabled); + if (!m_closeWindowTimer) m_mainFrame->invalidate(); // FIXME |