Changeset 116720 in webkit
- Timestamp:
- May 10, 2012 7:34:11 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116719 r116720 1 2012-05-10 Anders Carlsson <andersca@apple.com> 2 3 PDF files won't scroll in Safari when using Adobe plug-in 4 https://bugs.webkit.org/show_bug.cgi?id=86167 5 <rdar://problem/11389719> 6 7 Reviewed by Sam Weinig. 8 9 * page/scrolling/ScrollingCoordinator.cpp: 10 (WebCore::computeNonFastScrollableRegion): 11 Loop over the frame view children looking for plug-in views that want wheel events 12 and add them to the non-fast scrollable region. Ideally, the plug-ins should be added 13 to the set of scrollable areas, but PluginView in WebKit2 is not a ScrollableArea yet. 14 15 * plugins/PluginViewBase.h: 16 (PluginViewBase): 17 (WebCore::PluginViewBase::wantsWheelEvents): 18 1 19 2012-05-10 Alexey Proskuryakov <ap@apple.com> 2 20 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r116570 r116720 115 115 continue; 116 116 117 const FrameView::ScrollableAreaSet* scrollableAreas = frameView->scrollableAreas(); 118 if (!scrollableAreas) 119 continue; 120 121 for (FrameView::ScrollableAreaSet::const_iterator it = scrollableAreas->begin(), end = scrollableAreas->end(); it != end; ++it) { 122 ScrollableArea* scrollableArea = *it; 123 nonFastScrollableRegion.unite(scrollableArea->scrollableAreaBoundingBox()); 117 if (const FrameView::ScrollableAreaSet* scrollableAreas = frameView->scrollableAreas()) { 118 for (FrameView::ScrollableAreaSet::const_iterator it = scrollableAreas->begin(), end = scrollableAreas->end(); it != end; ++it) { 119 ScrollableArea* scrollableArea = *it; 120 nonFastScrollableRegion.unite(scrollableArea->scrollableAreaBoundingBox()); 121 } 122 } 123 124 if (const HashSet<RefPtr<Widget> >* children = frameView->children()) { 125 for (HashSet<RefPtr<Widget> >::const_iterator it = children->begin(), end = children->end(); it != end; ++it) { 126 if (!(*it)->isPluginViewBase()) 127 continue; 128 129 PluginViewBase* pluginViewBase = static_cast<PluginViewBase*>((*it).get()); 130 if (pluginViewBase->wantsWheelEvents()) 131 nonFastScrollableRegion.unite(pluginViewBase->frameRect()); 132 } 124 133 } 125 134 } -
trunk/Source/WebCore/plugins/PluginViewBase.h
r112325 r116720 58 58 virtual Scrollbar* verticalScrollbar() { return 0; } 59 59 60 // FIXME: This is a hack that works around the fact that the WebKit2 PluginView isn't a ScrollableArea. 61 virtual bool wantsWheelEvents() { return false; } 62 60 63 protected: 61 64 PluginViewBase(PlatformWidget widget = 0) : Widget(widget) { } -
trunk/Source/WebKit2/ChangeLog
r116716 r116720 1 2012-05-10 Anders Carlsson <andersca@apple.com> 2 3 PDF files won't scroll in Safari when using Adobe plug-in 4 https://bugs.webkit.org/show_bug.cgi?id=86167 5 <rdar://problem/11389719> 6 7 Reviewed by Sam Weinig. 8 9 Add a way to whitelist plug-ins that we know will process wheel events correctly. Add the new 10 Adobe Reader plug-in to this whitelist. Only send wheel events to plug-ins that are in the whitelist. 11 12 * PluginProcess/PluginControllerProxy.cpp: 13 (WebKit::PluginControllerProxy::wantsWheelEvents): 14 (WebKit): 15 * PluginProcess/PluginControllerProxy.h: 16 (PluginControllerProxy): 17 * PluginProcess/WebProcessConnection.cpp: 18 (WebKit::WebProcessConnection::createPlugin): 19 * PluginProcess/WebProcessConnection.h: 20 (WebProcessConnection): 21 * PluginProcess/WebProcessConnection.messages.in: 22 * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: 23 (WebKit::NetscapePluginModule::determineQuirks): 24 * Shared/Plugins/PluginQuirks.h: 25 * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: 26 (WebKit::NetscapePlugin::wantsWheelEvents): 27 (WebKit): 28 * WebProcess/Plugins/Netscape/NetscapePlugin.h: 29 (NetscapePlugin): 30 * WebProcess/Plugins/PDF/BuiltInPDFView.h: 31 (BuiltInPDFView): 32 * WebProcess/Plugins/PDF/BuiltInPDFView.mm: 33 (WebKit::BuiltInPDFView::wantsWheelEvents): 34 (WebKit): 35 * WebProcess/Plugins/Plugin.h: 36 (Plugin): 37 * WebProcess/Plugins/PluginProxy.cpp: 38 (WebKit::PluginProxy::PluginProxy): 39 (WebKit::PluginProxy::initialize): 40 (WebKit::PluginProxy::wantsWheelEvents): 41 (WebKit): 42 * WebProcess/Plugins/PluginProxy.h: 43 (PluginProxy): 44 * WebProcess/Plugins/PluginView.cpp: 45 (WebKit::PluginView::initializePlugin): 46 (WebKit::PluginView::wantsWheelEvents): 47 (WebKit): 48 (WebKit::PluginView::handleEvent): 49 * WebProcess/Plugins/PluginView.h: 50 (PluginView): 51 1 52 2012-05-10 Anders Carlsson <andersca@apple.com> 2 53 -
trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
r115300 r116720 149 149 } 150 150 151 bool PluginControllerProxy::wantsWheelEvents() const 152 { 153 return m_plugin->wantsWheelEvents(); 154 } 155 151 156 void PluginControllerProxy::paint() 152 157 { -
trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h
r115300 r116720 63 63 void didReceiveSyncPluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&); 64 64 65 bool wantsWheelEvents() const; 66 65 67 #if PLATFORM(MAC) 66 68 uint32_t remoteLayerClientID() const; -
trunk/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
r105475 r116720 226 226 } 227 227 228 void WebProcessConnection::createPlugin(const PluginCreationParameters& creationParameters, bool& result, uint32_t& remoteLayerClientID)228 void WebProcessConnection::createPlugin(const PluginCreationParameters& creationParameters, bool& result, bool& wantsWheelEvents, uint32_t& remoteLayerClientID) 229 229 { 230 230 OwnPtr<PluginControllerProxy> pluginControllerProxy = PluginControllerProxy::create(this, creationParameters); … … 242 242 return; 243 243 244 wantsWheelEvents = pluginControllerProxyPtr->wantsWheelEvents(); 244 245 #if PLATFORM(MAC) 245 246 remoteLayerClientID = pluginControllerProxyPtr->remoteLayerClientID(); -
trunk/Source/WebKit2/PluginProcess/WebProcessConnection.h
r95901 r116720 69 69 // Message handlers. 70 70 void didReceiveSyncWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&); 71 void createPlugin(const PluginCreationParameters&, bool& result, uint32_t& remoteLayerClientID);71 void createPlugin(const PluginCreationParameters&, bool& result, bool& wantsWheelEvents, uint32_t& remoteLayerClientID); 72 72 void destroyPlugin(uint64_t pluginInstanceID); 73 73 -
trunk/Source/WebKit2/PluginProcess/WebProcessConnection.messages.in
r86489 r116720 25 25 messages -> WebProcessConnection { 26 26 # Creates a plug-in instance using the given creation parameters. 27 CreatePlugin(WebKit::PluginCreationParameters pluginCreationParameters) -> (bool result, uint32_t remoteLayerClientID)27 CreatePlugin(WebKit::PluginCreationParameters pluginCreationParameters) -> (bool result, bool wantsWheelEvents, uint32_t remoteLayerClientID) 28 28 29 29 # Destroys the plug-in instance with the given instance ID. -
trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
r111822 r116720 519 519 } 520 520 #endif 521 522 if (plugin.bundleIdentifier == "com.adobe.acrobat.pdfviewerNPAPI") { 523 // The Adobe Reader plug-in wants wheel events. 524 m_pluginQuirks.add(PluginQuirks::WantsWheelEvents); 525 } 521 526 } 522 527 -
trunk/Source/WebKit2/Shared/Plugins/PluginQuirks.h
r111822 r116720 94 94 #endif 95 95 96 // This isn't really a quirk as much as the opposite of a quirk. By default, we don't send wheel events 97 // to plug-ins unless we know that they handle them correctly. Adobe Reader on Mac handles wheel events correctly. 98 WantsWheelEvents, 99 96 100 NumPluginQuirks 97 101 }; -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
r115300 r116720 677 677 } 678 678 679 bool NetscapePlugin::wantsWheelEvents() 680 { 681 return m_pluginModule->pluginQuirks().contains(PluginQuirks::WantsWheelEvents); 682 } 683 679 684 void NetscapePlugin::geometryDidChange(const IntSize& pluginSize, const IntRect& clipRect, const AffineTransform& pluginToRootViewTransform) 680 685 { -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
r115300 r116720 174 174 #endif 175 175 virtual bool isTransparent(); 176 virtual bool wantsWheelEvents() OVERRIDE; 176 177 virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform); 177 178 virtual void visibilityDidChange(); -
trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h
r116469 r116720 78 78 #endif 79 79 virtual bool isTransparent(); 80 virtual bool wantsWheelEvents() OVERRIDE; 80 81 virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform); 81 82 virtual void visibilityDidChange(); -
trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm
r116469 r116720 472 472 } 473 473 474 bool BuiltInPDFView::wantsWheelEvents() 475 { 476 // We return false here even though we do want wheel events, because we add ourselves to the scrollable area set in updateScrollbars(). 477 return false; 478 } 479 474 480 void BuiltInPDFView::geometryDidChange(const IntSize& pluginSize, const IntRect& clipRect, const AffineTransform& pluginToRootViewTransform) 475 481 { -
trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h
r114476 r116720 122 122 virtual bool isTransparent() = 0; 123 123 124 // Returns whether we should send wheel events to this plug-in. 125 virtual bool wantsWheelEvents() = 0; 126 124 127 // Tells the plug-in that its geometry has changed. The clip rect is in plug-in coordinates, and the affine transform can be used 125 128 // to convert from root view coordinates to plug-in coordinates. -
trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
r115300 r116720 67 67 , m_isStarted(false) 68 68 , m_waitingForPaintInResponseToUpdate(false) 69 , m_wantsWheelEvents(false) 69 70 , m_remoteLayerClientID(0) 70 71 { … … 105 106 106 107 bool result = false; 108 bool wantsWheelEvents = false; 107 109 uint32_t remoteLayerClientID = 0; 108 110 109 if (!m_connection->connection()->sendSync(Messages::WebProcessConnection::CreatePlugin(creationParameters), Messages::WebProcessConnection::CreatePlugin::Reply(result, remoteLayerClientID), 0) || !result) {111 if (!m_connection->connection()->sendSync(Messages::WebProcessConnection::CreatePlugin(creationParameters), Messages::WebProcessConnection::CreatePlugin::Reply(result, wantsWheelEvents, remoteLayerClientID), 0) || !result) { 110 112 m_connection->removePluginProxy(this); 111 113 return false; 112 114 } 113 115 116 m_wantsWheelEvents = wantsWheelEvents; 114 117 m_remoteLayerClientID = remoteLayerClientID; 115 118 m_isStarted = true; … … 170 173 ASSERT_NOT_REACHED(); 171 174 return false; 175 } 176 177 bool PluginProxy::wantsWheelEvents() 178 { 179 return m_wantsWheelEvents; 172 180 } 173 181 -
trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h
r115300 r116720 73 73 #endif 74 74 virtual bool isTransparent(); 75 virtual bool wantsWheelEvents() OVERRIDE; 75 76 virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform); 76 77 virtual void visibilityDidChange(); … … 169 170 bool m_waitingForPaintInResponseToUpdate; 170 171 172 // Whether we should send wheel events to this plug-in or not. 173 bool m_wantsWheelEvents; 174 171 175 // The client ID for the CA layer in the plug-in process. Will be 0 if the plug-in is not a CA plug-in. 172 176 uint32_t m_remoteLayerClientID; -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r116687 r116720 504 504 setWindowIsFocused(m_webPage->windowIsFocused()); 505 505 #endif 506 507 if (wantsWheelEvents()) { 508 if (Frame* frame = m_pluginElement->document()->frame()) { 509 if (FrameView* frameView = frame->view()) 510 frameView->setNeedsLayout(); 511 } 512 } 506 513 } 507 514 … … 576 583 577 584 return m_plugin->verticalScrollbar(); 585 } 586 587 bool PluginView::wantsWheelEvents() 588 { 589 // The plug-in can be null here if it failed to initialize. 590 if (!m_isInitialized || !m_plugin) 591 return 0; 592 593 return m_plugin->wantsWheelEvents(); 578 594 } 579 595 … … 652 668 653 669 didHandleEvent = m_plugin->handleMouseEvent(static_cast<const WebMouseEvent&>(*currentEvent)); 654 } else if (event->type() == eventNames().mousewheelEvent && currentEvent->type() == WebEvent::Wheel ) {670 } else if (event->type() == eventNames().mousewheelEvent && currentEvent->type() == WebEvent::Wheel && m_plugin->wantsWheelEvents()) { 655 671 // We have a wheel event. 656 672 didHandleEvent = m_plugin->handleWheelEvent(static_cast<const WebWheelEvent&>(*currentEvent)); -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h
r115300 r116720 112 112 virtual WebCore::Scrollbar* horizontalScrollbar(); 113 113 virtual WebCore::Scrollbar* verticalScrollbar(); 114 virtual bool wantsWheelEvents(); 114 115 115 116 // WebCore::Widget
Note: See TracChangeset
for help on using the changeset viewer.