Changeset 98664 in webkit
- Timestamp:
- Oct 27, 2011, 5:18:55 PM (15 years ago)
- Location:
- trunk/Source
- Files:
-
- 11 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/WebCore.exp.in (modified) (2 diffs)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp (modified) (1 diff)
-
WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h (modified) (1 diff)
-
WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp (modified) (9 diffs)
-
WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h (modified) (2 diffs)
-
WebKit2/WebProcess/Plugins/Plugin.h (modified) (2 diffs)
-
WebKit2/WebProcess/Plugins/PluginProxy.cpp (modified) (1 diff)
-
WebKit2/WebProcess/Plugins/PluginProxy.h (modified) (1 diff)
-
WebKit2/WebProcess/Plugins/PluginView.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r98661 r98664 1 2011-10-27 Anders Carlsson <andersca@apple.com> 2 3 Add a Plugin::geometryDidChange that will work with transforms 4 https://bugs.webkit.org/show_bug.cgi?id=71072 5 6 Reviewed by Simon Fraser. 7 8 Export symbols needed by WebKit2. 9 10 * WebCore.exp.in: 11 1 12 2011-10-27 Adam Barth <abarth@webkit.org> 2 13 -
trunk/Source/WebCore/WebCore.exp.in
r98650 r98664 402 402 __ZN7WebCore14StorageTracker32syncFileSystemAndTrackerDatabaseEv 403 403 __ZN7WebCore14endOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE 404 __ZN7WebCore15AffineTransformC1Edddddd 404 405 __ZN7WebCore15ArchiveResource6createEN3WTF10PassRefPtrINS_12SharedBufferEEERKNS_4KURLERKNS1_6StringESA_SA_RKNS_16ResourceResponseE 405 406 __ZN7WebCore15DOMWrapperWorld13clearWrappersEv … … 1122 1123 __ZNK7WebCore10ScrollView18visibleContentRectEb 1123 1124 __ZNK7WebCore10ScrollView18contentsToRootViewERKNS_7IntRectE 1125 __ZNK7WebCore10ScrollView18contentsToRootViewERKNS_8IntPointE 1124 1126 __ZN7WebCore11CachedImage5imageEv 1125 1127 __ZNK7WebCore11FrameLoader10isCompleteEv -
trunk/Source/WebKit2/ChangeLog
r98652 r98664 1 2011-10-27 Anders Carlsson <andersca@apple.com> 2 3 Add a Plugin::geometryDidChange that will work with transforms 4 https://bugs.webkit.org/show_bug.cgi?id=71072 5 6 Reviewed by Simon Fraser. 7 8 Add a new Plugin::geometryDidChange pure virtual member function, that takes 9 the size of the plug-in, the clip rect (in plug-in coordinates), and a matrix that makes 10 it possible to convert between root view coordinates and plug-in coordinates. 11 12 PluginView only calls this new geometryDidChange member function if 13 Plugin::wantsWindowRelativeCoordinates returns false, which is only true for BuiltInPDFView right now. 14 15 * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: 16 (WebKit::NetscapePlugin::geometryDidChange): 17 * WebProcess/Plugins/Netscape/NetscapePlugin.h: 18 Add stub. 19 20 * WebProcess/Plugins/PDF/BuiltInPDFView.cpp: 21 (WebKit::BuiltInPDFView::updateScrollbars): 22 (WebKit::BuiltInPDFView::pdfDocumentDidLoad): 23 (WebKit::BuiltInPDFView::paintContent): 24 (WebKit::BuiltInPDFView::deprecatedGeometryDidChange): 25 (WebKit::BuiltInPDFView::geometryDidChange): 26 (WebKit::BuiltInPDFView::setScrollOffset): 27 (WebKit::BuiltInPDFView::maximumScrollPosition): 28 (WebKit::BuiltInPDFView::visibleHeight): 29 (WebKit::BuiltInPDFView::visibleWidth): 30 * WebProcess/Plugins/PDF/BuiltInPDFView.h: 31 There's no need to keep track of the plug-in rect anymore. 32 33 * WebProcess/Plugins/Plugin.h: 34 Add and document geometryDidChange. 35 36 * WebProcess/Plugins/PluginProxy.cpp: 37 (WebKit::PluginProxy::geometryDidChange): 38 * WebProcess/Plugins/PluginProxy.h: 39 Add stub. 40 41 * WebProcess/Plugins/PluginView.cpp: 42 (WebKit::PluginView::viewGeometryDidChange): 43 Call geometryDidChange. 44 1 45 2011-10-27 Joseph Pecoraro <pecoraro@apple.com> 2 46 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
r98646 r98664 677 677 } 678 678 679 void NetscapePlugin::geometryDidChange(const IntSize& pluginSize, const IntRect& clipRect, const AffineTransform& pluginToRootViewTransform) 680 { 681 // FIXME: This isn't called yet. 682 ASSERT_NOT_REACHED(); 683 } 684 679 685 void NetscapePlugin::visibilityDidChange() 680 686 { -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
r98646 r98664 170 170 virtual bool isTransparent(); 171 171 virtual void deprecatedGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect); 172 virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform); 172 173 virtual void visibilityDidChange(); 173 174 virtual void frameDidFinishLoading(uint64_t requestID); -
trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp
r98646 r98664 98 98 { 99 99 if (m_horizontalScrollbar) { 100 if (m_ frameRect.width() >= m_pdfDocumentSize.width())100 if (m_pluginSize.width() >= m_pdfDocumentSize.width()) 101 101 destroyScrollbar(HorizontalScrollbar); 102 } else if (m_ frameRect.width() < m_pdfDocumentSize.width())102 } else if (m_pluginSize.width() < m_pdfDocumentSize.width()) 103 103 m_horizontalScrollbar = createScrollbar(HorizontalScrollbar); 104 104 105 105 if (m_verticalScrollbar) { 106 if (m_ frameRect.height() >= m_pdfDocumentSize.height())106 if (m_pluginSize.height() >= m_pdfDocumentSize.height()) 107 107 destroyScrollbar(VerticalScrollbar); 108 } else if (m_ frameRect.height() < m_pdfDocumentSize.height())108 } else if (m_pluginSize.height() < m_pdfDocumentSize.height()) 109 109 m_verticalScrollbar = createScrollbar(VerticalScrollbar); 110 110 … … 116 116 if (m_horizontalScrollbar) { 117 117 m_horizontalScrollbar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep); 118 m_horizontalScrollbar->setProportion(m_ frameRect.width() - verticalScrollbarWidth, m_pdfDocumentSize.width());119 IntRect scrollbarRect(pluginView()->x(), pluginView()->y() + m_ frameRect.height() - m_horizontalScrollbar->height(), m_frameRect.width(), m_horizontalScrollbar->height());118 m_horizontalScrollbar->setProportion(m_pluginSize.width() - verticalScrollbarWidth, m_pdfDocumentSize.width()); 119 IntRect scrollbarRect(pluginView()->x(), pluginView()->y() + m_pluginSize.height() - m_horizontalScrollbar->height(), m_pluginSize.width(), m_horizontalScrollbar->height()); 120 120 if (m_verticalScrollbar) 121 121 scrollbarRect.contract(m_verticalScrollbar->width(), 0); … … 124 124 if (m_verticalScrollbar) { 125 125 m_verticalScrollbar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep); 126 m_verticalScrollbar->setProportion(m_ frameRect.height() - horizontalScrollbarHeight, m_pdfDocumentSize.height());127 IntRect scrollbarRect(IntRect(pluginView()->x() + m_ frameRect.width() - m_verticalScrollbar->width(), pluginView()->y(), m_verticalScrollbar->width(), m_frameRect.height()));126 m_verticalScrollbar->setProportion(m_pluginSize.height() - horizontalScrollbarHeight, m_pdfDocumentSize.height()); 127 IntRect scrollbarRect(IntRect(pluginView()->x() + m_pluginSize.width() - m_verticalScrollbar->width(), pluginView()->y(), m_verticalScrollbar->width(), m_pluginSize.height())); 128 128 if (m_horizontalScrollbar) 129 129 scrollbarRect.contract(0, m_horizontalScrollbar->height()); … … 212 212 updateScrollbars(); 213 213 214 controller()->invalidate(IntRect(0, 0, m_ frameRect.width(), m_frameRect.height()));214 controller()->invalidate(IntRect(0, 0, m_pluginSize.width(), m_pluginSize.height())); 215 215 } 216 216 … … 293 293 for (size_t i = 0; i < m_pageBoxes.size(); ++i) { 294 294 IntRect pageBox = m_pageBoxes[i]; 295 float extraOffsetForCenteringX = max(roundf((m_ frameRect.width() - pageBox.width()) / 2.0f), 0.0f);296 float extraOffsetForCenteringY = (m_pageBoxes.size() == 1) ? max(roundf((m_ frameRect.height() - pageBox.height() + shadowOffsetY) / 2.0f), 0.0f) : 0;295 float extraOffsetForCenteringX = max(roundf((m_pluginSize.width() - pageBox.width()) / 2.0f), 0.0f); 296 float extraOffsetForCenteringY = (m_pageBoxes.size() == 1) ? max(roundf((m_pluginSize.height() - pageBox.height() + shadowOffsetY) / 2.0f), 0.0f) : 0; 297 297 298 298 if (pageTop > contentRect.maxY()) … … 370 370 void BuiltInPDFView::deprecatedGeometryDidChange(const IntRect& frameRect, const IntRect& clipRect) 371 371 { 372 if (m_frameRect == frameRect) { 372 ASSERT_NOT_REACHED(); 373 } 374 375 void BuiltInPDFView::geometryDidChange(const IntSize& pluginSize, const IntRect& clipRect, const AffineTransform& pluginToRootViewTransform) 376 { 377 if (m_pluginSize == pluginSize) { 373 378 // Nothing to do. 374 379 return; 375 380 } 376 381 377 m_ frameRect = frameRect;382 m_pluginSize = pluginSize; 378 383 updateScrollbars(); 379 384 } … … 595 600 m_scrollOffset = IntSize(offset.x(), offset.y()); 596 601 // FIXME: It would be better for performance to blit parts that remain visible. 597 controller()->invalidate(IntRect(0, 0, m_ frameRect.width(), m_frameRect.height()));602 controller()->invalidate(IntRect(0, 0, m_pluginSize.width(), m_pluginSize.height())); 598 603 } 599 604 … … 652 657 int verticalScrollbarWidth = (m_verticalScrollbar && !m_verticalScrollbar->isOverlayScrollbar()) ? m_verticalScrollbar->width() : 0; 653 658 654 IntPoint maximumOffset(m_pdfDocumentSize.width() - m_ frameRect.width() + verticalScrollbarWidth, m_pdfDocumentSize.height() - m_frameRect.height() + horizontalScrollbarHeight);659 IntPoint maximumOffset(m_pdfDocumentSize.width() - m_pluginSize.width() + verticalScrollbarWidth, m_pdfDocumentSize.height() - m_pluginSize.height() + horizontalScrollbarHeight); 655 660 maximumOffset.clampNegativeToZero(); 656 661 return maximumOffset; … … 659 664 LayoutUnit BuiltInPDFView::visibleHeight() const 660 665 { 661 return m_ frameRect.height();666 return m_pluginSize.height(); 662 667 } 663 668 664 669 LayoutUnit BuiltInPDFView::visibleWidth() const 665 670 { 666 return m_ frameRect.width();671 return m_pluginSize.width(); 667 672 } 668 673 -
trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h
r98646 r98664 79 79 virtual bool isTransparent(); 80 80 virtual void deprecatedGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect); 81 virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform); 81 82 virtual void visibilityDidChange(); 82 83 virtual void frameDidFinishLoading(uint64_t requestID); … … 144 145 virtual WebCore::IntPoint convertFromContainingViewToScrollbar(const WebCore::Scrollbar*, const WebCore::IntPoint& parentPoint) const; 145 146 146 // In window coordinates. 147 WebCore::IntRect m_frameRect; 147 WebCore::IntSize m_pluginSize; 148 148 149 149 WebCore::KURL m_sourceURL; -
trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h
r98646 r98664 41 41 42 42 namespace WebCore { 43 class AffineTransform; 43 44 class GraphicsContext; 44 45 class IntRect; … … 119 120 virtual void deprecatedGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect) = 0; 120 121 122 // Tells the plug-in that its geometry has changed. The clip rect is in plug-in coordinates, and the affine transform can be used 123 // to convert from root view coordinates to plug-in coordinates. 124 virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform) = 0; 125 121 126 // Tells the plug-in that it has been explicitly hidden or shown. (Note that this is not called when the plug-in becomes obscured from view on screen.) 122 127 virtual void visibilityDidChange() = 0; -
trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
r98646 r98664 242 242 } 243 243 244 void PluginProxy::geometryDidChange(const IntSize& pluginSize, const IntRect& clipRect, const AffineTransform& pluginToRootViewTransform) 245 { 246 // FIXME: This isn't called yet. 247 ASSERT_NOT_REACHED(); 248 } 249 244 250 void PluginProxy::visibilityDidChange() 245 251 { -
trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h
r98646 r98664 73 73 virtual bool isTransparent(); 74 74 virtual void deprecatedGeometryDidChange(const WebCore::IntRect& frameRect, const WebCore::IntRect& clipRect); 75 virtual void geometryDidChange(const WebCore::IntSize& pluginSize, const WebCore::IntRect& clipRect, const WebCore::AffineTransform& pluginToRootViewTransform); 75 76 virtual void visibilityDidChange(); 76 77 virtual void frameDidFinishLoading(uint64_t requestID); -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r98646 r98664 717 717 return; 718 718 719 IntRect rect;720 721 719 if (m_plugin->wantsWindowRelativeCoordinates()) { 722 720 // Get the frame rect in window coordinates. 723 rect = parent()->contentsToWindow(frameRect()); 724 } else { 725 // FIXME: The plug-in shouldn't know its location relative to its parent frame. 726 rect = frameRect(); 727 } 728 729 m_plugin->deprecatedGeometryDidChange(rect, clipRectInWindowCoordinates()); 721 IntRect rect = parent()->contentsToWindow(frameRect()); 722 m_plugin->deprecatedGeometryDidChange(rect, clipRectInWindowCoordinates()); 723 return; 724 } 725 726 // FIXME: Just passing a translation matrix isn't good enough. 727 IntPoint locationInWindowCoordinates = parent()->contentsToRootView(frameRect().location()); 728 AffineTransform transform = AffineTransform::translation(locationInWindowCoordinates.x(), locationInWindowCoordinates.y()); 729 730 // FIXME: The clip rect isn't correct. 731 IntRect clipRect = boundsRect(); 732 m_plugin->geometryDidChange(size(), clipRect, transform); 733 730 734 } 731 735
Note:
See TracChangeset
for help on using the changeset viewer.