Changeset 112325 in webkit
- Timestamp:
- Mar 27, 2012 3:24:36 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r112323 r112325 1 2012-03-27 James Robinson <jamesr@chromium.org> 2 3 Scrollable plugins not registered properly in ScrollingCoordinator 4 https://bugs.webkit.org/show_bug.cgi?id=82163 5 6 Reviewed by Anders Carlsson. 7 8 Whenever a ScrollableArea is added or removed from a FrameView's ScrollableAreaSet, we have to recalculate the 9 nonFastScrollableRegion. This can happen for certain types of plugins that are scrollable. 10 11 This also reverts 112142 which was a not quite right way to handle these plugins. 12 13 * page/FrameView.cpp: 14 (WebCore::FrameView::addScrollableArea): 15 (WebCore::FrameView::removeScrollableArea): 16 * page/scrolling/ScrollingCoordinator.cpp: 17 (WebCore::computeNonFastScrollableRegion): 18 (WebCore::ScrollingCoordinator::frameViewScrollableAreasDidChange): 19 (WebCore): 20 * page/scrolling/ScrollingCoordinator.h: 21 (ScrollingCoordinator): 22 * plugins/PluginViewBase.h: 23 1 24 2012-03-27 Adam Klein <adamk@chromium.org> 2 25 -
trunk/Source/WebCore/page/FrameView.cpp
r112283 r112325 3386 3386 m_scrollableAreas = adoptPtr(new ScrollableAreaSet); 3387 3387 m_scrollableAreas->add(scrollableArea); 3388 3389 if (Page* page = m_frame->page()) { 3390 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) 3391 scrollingCoordinator->frameViewScrollableAreasDidChange(this); 3392 } 3388 3393 } 3389 3394 … … 3393 3398 return; 3394 3399 m_scrollableAreas->remove(scrollableArea); 3400 3401 if (Page* page = m_frame->page()) { 3402 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) 3403 scrollingCoordinator->frameViewScrollableAreasDidChange(this); 3404 } 3395 3405 } 3396 3406 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r112148 r112325 113 113 if ((*it)->isFrameView()) 114 114 childFrameViews.add(static_cast<FrameView*>(it->get())); 115 else if ((*it)->isPluginViewBase()) {116 if (static_cast<PluginViewBase*>(it->get())->wantWheelEvents())117 nonFastScrollableRegion.unite((*it)->frameRect());118 }119 115 } 120 116 … … 160 156 } 161 157 158 void ScrollingCoordinator::frameViewScrollableAreasDidChange(FrameView*) 159 { 160 ASSERT(isMainThread()); 161 ASSERT(m_page); 162 163 Region nonFastScrollableRegion = computeNonFastScrollableRegion(m_page->mainFrame()->view()); 164 setNonFastScrollableRegion(nonFastScrollableRegion); 165 } 166 162 167 void ScrollingCoordinator::frameViewWheelEventHandlerCountChanged(FrameView*) 163 168 { -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r109801 r112325 72 72 // Should be called whenever the given frame view has been laid out. 73 73 void frameViewLayoutUpdated(FrameView*); 74 75 // Should be called whenever the set of ScrollableAreas inside a FrameView changes. 76 void frameViewScrollableAreasDidChange(FrameView*); 74 77 75 78 // Should be called whenever a wheel event handler is added or removed in the -
trunk/Source/WebCore/plugins/PluginViewBase.h
r112142 r112325 54 54 virtual bool scroll(ScrollDirection, ScrollGranularity) { return false; } 55 55 56 virtual bool wantWheelEvents() { return false; }57 58 56 // A plug-in can ask WebKit to handle scrollbars for it. 59 57 virtual Scrollbar* horizontalScrollbar() { return 0; } -
trunk/Source/WebKit/chromium/ChangeLog
r112317 r112325 1 2012-03-27 James Robinson <jamesr@chromium.org> 2 3 Scrollable plugins not registered properly in ScrollingCoordinator 4 https://bugs.webkit.org/show_bug.cgi?id=82163 5 6 Reviewed by Anders Carlsson. 7 8 Since ScrollbarGroups are ScrollableAreas, they need to be able to report their bounds for the 9 ScrollingCoordinator's calculateNonFastScrollableRegion. This also changes ScrollbarGroups to only be registered 10 as ScrollableAreas on the FrameView's set when they actually have Scrollbars. 11 12 * src/ScrollbarGroup.cpp: 13 (WebKit::ScrollbarGroup::ScrollbarGroup): 14 (WebKit::ScrollbarGroup::~ScrollbarGroup): 15 (WebKit::ScrollbarGroup::scrollbarCreated): 16 (WebKit::ScrollbarGroup::scrollbarDestroyed): 17 (WebKit::ScrollbarGroup::setFrameRect): 18 (WebKit): 19 (WebKit::ScrollbarGroup::scrollableAreaBoundingBox): 20 * src/ScrollbarGroup.h: 21 (ScrollbarGroup): 22 * src/WebPluginContainerImpl.cpp: 23 (WebKit::WebPluginContainerImpl::reportGeometry): 24 (WebKit): 25 (WebKit::WebPluginContainerImpl::scrollbarGroup): 26 * src/WebPluginContainerImpl.h: 27 (WebPluginContainerImpl): 28 1 29 2012-03-27 Dana Jansens <danakj@chromium.org> 2 30 -
trunk/Source/WebKit/chromium/src/ScrollbarGroup.cpp
r106977 r112325 37 37 namespace WebKit { 38 38 39 ScrollbarGroup::ScrollbarGroup(FrameView* frameView )39 ScrollbarGroup::ScrollbarGroup(FrameView* frameView, const IntRect& frameRect) 40 40 : m_frameView(frameView) 41 , m_frameRect(frameRect) 41 42 , m_horizontalScrollbar(0) 42 43 , m_verticalScrollbar(0) 43 44 { 44 m_frameView->addScrollableArea(this);45 45 } 46 46 … … 49 49 ASSERT(!m_horizontalScrollbar); 50 50 ASSERT(!m_verticalScrollbar); 51 m_frameView->removeScrollableArea(this);52 51 } 53 52 54 53 void ScrollbarGroup::scrollbarCreated(WebScrollbarImpl* scrollbar) 55 54 { 55 bool hadScrollbars = m_horizontalScrollbar || m_verticalScrollbar; 56 56 if (scrollbar->scrollbar()->orientation() == HorizontalScrollbar) { 57 57 ASSERT(!m_horizontalScrollbar); … … 63 63 didAddVerticalScrollbar(scrollbar->scrollbar()); 64 64 } 65 66 if (!hadScrollbars) 67 m_frameView->addScrollableArea(this); 65 68 } 66 69 … … 75 78 m_verticalScrollbar = 0; 76 79 } 80 81 if (!m_horizontalScrollbar && !m_verticalScrollbar) 82 m_frameView->removeScrollableArea(this); 77 83 } 78 84 … … 128 134 // FIXME: Return a parent scrollable area that can be scrolled. 129 135 return 0; 136 } 137 138 void ScrollbarGroup::setFrameRect(const IntRect& frameRect) 139 { 140 m_frameRect = frameRect; 141 } 142 143 IntRect ScrollbarGroup::scrollableAreaBoundingBox() const 144 { 145 return m_frameRect; 130 146 } 131 147 -
trunk/Source/WebKit/chromium/src/ScrollbarGroup.h
r106977 r112325 41 41 class ScrollbarGroup : public WebCore::ScrollableArea { 42 42 public: 43 explicit ScrollbarGroup(WebCore::FrameView*);43 ScrollbarGroup(WebCore::FrameView*, const WebCore::IntRect& frameRect); 44 44 ~ScrollbarGroup(); 45 45 … … 47 47 void scrollbarDestroyed(WebScrollbarImpl*); 48 48 void setLastMousePosition(const WebCore::IntPoint&); 49 void setFrameRect(const WebCore::IntRect&); 49 50 50 51 // WebCore::ScrollableArea methods … … 73 74 virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate); 74 75 virtual bool isOnActivePage() const; 76 virtual WebCore::IntRect scrollableAreaBoundingBox() const; 75 77 76 78 private: 77 79 WebCore::FrameView* m_frameView; 78 80 WebCore::IntPoint m_lastMousePosition; 81 WebCore::IntRect m_frameRect; 79 82 WebScrollbarImpl* m_horizontalScrollbar; 80 83 WebScrollbarImpl* m_verticalScrollbar; -
trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
r112142 r112325 329 329 m_webPlugin->updateGeometry(windowRect, clipRect, cutOutRects, isVisible()); 330 330 331 if (m_scrollbarGroup) 331 if (m_scrollbarGroup) { 332 332 m_scrollbarGroup->scrollAnimator()->contentsResized(); 333 m_scrollbarGroup->setFrameRect(frameRect()); 334 } 333 335 } 334 336 … … 519 521 #endif 520 522 521 bool WebPluginContainerImpl::wantWheelEvents()522 {523 return m_scrollbarGroup;524 }525 526 523 ScrollbarGroup* WebPluginContainerImpl::scrollbarGroup() 527 524 { 528 525 if (!m_scrollbarGroup) 529 m_scrollbarGroup = adoptPtr(new ScrollbarGroup(m_element->document()->frame()->view() ));526 m_scrollbarGroup = adoptPtr(new ScrollbarGroup(m_element->document()->frame()->view(), frameRect())); 530 527 return m_scrollbarGroup.get(); 531 528 } -
trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.h
r112142 r112325 74 74 // PluginViewBase methods 75 75 virtual bool getFormValue(String&); 76 virtual bool wantWheelEvents();77 76 78 77 // Widget methods
Note: See TracChangeset
for help on using the changeset viewer.