Changeset 84979 in webkit
- Timestamp:
- Apr 26, 2011 4:35:25 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r84978 r84979 1 2011-04-26 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Dirk Schulze. 4 5 [GTK] Flash in divs with overflow: auto is not positioned and clipped properly 6 https://bugs.webkit.org/show_bug.cgi?id=57644 7 8 Manual test: plugins/windowed-in-iframe-2.html 9 10 * manual-tests/plugins/windowed-in-iframe-2.html: Added. 11 * platform/gtk/WidgetGtk.cpp: 12 (WebCore::Widget::setFrameRect): Like the Qt port, we notify the widget via frameRectsChanged. 13 * plugins/PluginView.h: Added helper method to set the allocation and clip. 14 * plugins/gtk/PluginViewGtk.cpp: 15 (WebCore::PluginView::setNPWindowIfNeeded):Call the helper method instead of setting 16 the allocation immediately. Bring this method into sync with the implementation in 17 the Qt port. 18 (WebCore::PluginView::updateWidgetAllocationAndClip): Added. 19 (WebCore::PluginView::plugAddedCallback): Call the new helper method. 20 1 21 2011-04-26 Martin Robinson <mrobinson@igalia.com> 2 22 -
trunk/Source/WebCore/platform/gtk/WidgetGtk.cpp
r80548 r84979 110 110 { 111 111 m_frame = rect; 112 frameRectsChanged(); 112 113 } 113 114 -
trunk/Source/WebCore/plugins/PluginView.h
r84071 r84979 439 439 static gboolean plugRemovedCallback(GtkSocket*, PluginView*); 440 440 static void plugAddedCallback(GtkSocket*, PluginView*); 441 void updateWidgetAllocationAndClip(); 441 442 bool m_plugAdded; 442 443 IntRect m_delayedAllocation; -
trunk/Source/WebCore/plugins/gtk/PluginViewGtk.cpp
r84371 r84979 494 494 return; 495 495 496 if (m_isWindowed) { 497 m_npWindow.x = m_windowRect.x(); 498 m_npWindow.y = m_windowRect.y(); 496 // If width or height are null, set the clipRect to null, indicating that 497 // the plugin is not visible/scrolled out. 498 if (!m_clipRect.isEmpty()) { 499 m_npWindow.clipRect.left = 0; 500 m_npWindow.clipRect.right = 0; 501 m_npWindow.clipRect.top = 0; 502 m_npWindow.clipRect.bottom = 0; 503 } else { 504 // Clipping rectangle of the plug-in; the origin is the top left corner of the drawable or window. 505 m_npWindow.clipRect.left = m_npWindow.x + m_clipRect.x(); 506 m_npWindow.clipRect.top = m_npWindow.y + m_clipRect.y(); 507 m_npWindow.clipRect.right = m_npWindow.x + m_clipRect.x() + m_clipRect.width(); 508 m_npWindow.clipRect.bottom = m_npWindow.y + m_clipRect.y() + m_clipRect.height(); 509 } 510 511 // FLASH WORKAROUND: Only set initially. Multiple calls to 512 // setNPWindow() cause the plugin to crash in windowed mode. 513 if (!m_plugin->quirks().contains(PluginQuirkDontCallSetWindowMoreThanOnce) || !m_isWindowed 514 || m_npWindow.width == static_cast<uint32_t>(-1) || m_npWindow.height == static_cast<uint32_t>(-1)) { 499 515 m_npWindow.width = m_windowRect.width(); 500 516 m_npWindow.height = m_windowRect.height(); 501 502 m_npWindow.clipRect.left = max(0, m_clipRect.x());503 m_npWindow.clipRect.top = max(0, m_clipRect.y());504 m_npWindow.clipRect.right = m_clipRect.x() + m_clipRect.width();505 m_npWindow.clipRect.bottom = m_clipRect.y() + m_clipRect.height();506 } else {507 m_npWindow.x = 0;508 m_npWindow.y = 0;509 m_npWindow.width = m_windowRect.width();510 m_npWindow.height = m_windowRect.height();511 512 m_npWindow.clipRect.left = 0;513 m_npWindow.clipRect.top = 0;514 m_npWindow.clipRect.right = 0;515 m_npWindow.clipRect.bottom = 0;516 517 } 517 518 … … 535 536 #endif 536 537 537 GtkAllocation allocation = { m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height() }; 538 538 m_delayedAllocation = m_windowRect; 539 updateWidgetAllocationAndClip(); 540 } 541 542 void PluginView::updateWidgetAllocationAndClip() 543 { 539 544 // If the window has not been embedded yet (the plug added), we delay setting its allocation until 540 545 // that point. This fixes issues with some Java plugin instances not rendering immediately. 541 if (!m_plugAdded) { 542 m_delayedAllocation = allocation; 543 return; 544 } 545 gtk_widget_size_allocate(platformPluginWidget(), &allocation); 546 if (!m_plugAdded || m_delayedAllocation.isEmpty()) 547 return; 548 549 GtkWidget* widget = platformPluginWidget(); 550 if (gtk_widget_get_realized(widget)) { 551 GdkRectangle clipRect = m_clipRect; 552 #ifdef GTK_API_VERSION_2 553 GdkRegion* clipRegion = gdk_region_rectangle(&clipRect); 554 gdk_window_shape_combine_region(gtk_widget_get_window(widget), clipRegion, 0, 0); 555 gdk_region_destroy(clipRegion); 556 #else 557 cairo_region_t* clipRegion = cairo_region_create_rectangle(&clipRect); 558 gdk_window_shape_combine_region(gtk_widget_get_window(widget), clipRegion, 0, 0); 559 cairo_region_destroy(clipRegion); 560 #endif 561 } 562 563 GtkAllocation allocation(m_delayedAllocation); 564 gtk_widget_size_allocate(widget, &allocation); 565 m_delayedAllocation = IntRect(); 546 566 } 547 567 … … 774 794 ASSERT(socket); 775 795 ASSERT(view); 776 777 796 view->m_plugAdded = true; 778 if (!view->m_delayedAllocation.isEmpty()) { 779 GtkAllocation allocation(view->m_delayedAllocation); 780 gtk_widget_size_allocate(GTK_WIDGET(socket), &allocation); 781 view->m_delayedAllocation.setSize(IntSize()); 782 } 797 view->updateWidgetAllocationAndClip(); 783 798 } 784 799
Note: See TracChangeset
for help on using the changeset viewer.