https://bugs.webkit.org/show_bug.cgi?id=109879
Patch by John Bauman <jbauman@chromium.org> on 2013-02-27
Reviewed by Simon Fraser.
Source/WebCore:
Changing the cliprect on a layer containing an iframe may change the
cliprect of plugins inside the iframe, so recursively tell all plugins
in iframes that their cliprect has changed after doing layout on the
outer frame.
Test: plugins/plugin-clip-subframe.html
* platform/ScrollView.cpp:
(WebCore::ScrollView::clipRectChanged):
* platform/ScrollView.h:
* platform/Widget.h:
(WebCore::Widget::clipRectChanged):
* plugins/PluginView.cpp:
(WebCore::PluginView::clipRectChanged):
* plugins/PluginView.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::setWidgetGeometry):
Source/WebKit/chromium:
Use clipRectChanged to update the geometry.
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::clipRectChanged):
* src/WebPluginContainerImpl.h:
Source/WebKit/mac:
Ensure NetscapePluginWidget informs the plugin view of the cliprect change directly.
* Plugins/WebBaseNetscapePluginView.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(NetscapePluginWidget::clipRectChanged):
Source/WebKit2:
Update geometry when cliprect changes.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::clipRectChanged):
* WebProcess/Plugins/PluginView.h:
Tools:
LogNPPSetWindow will be used with other ports as well.
* DumpRenderTree/DumpRenderTree.gypi:
* DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt:
LayoutTests:
Use log-npp-set-window to ensure plugin clip changes correctly.
* platform/mac-wk2/plugins/plugin-clip-subframe-expected.txt: Added.
* platform/mac/plugins/plugin-clip-subframe-expected.txt: Added.
* plugins/plugin-clip-subframe-expected.txt: Added.
* plugins/plugin-clip-subframe.html: Added.
* plugins/resources/plugin-clip-subframe-iframe.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144236
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-02-27 John Bauman <jbauman@chromium.org>
+
+ Plugin in iframe may not display
+ https://bugs.webkit.org/show_bug.cgi?id=109879
+
+ Reviewed by Simon Fraser.
+
+ Use log-npp-set-window to ensure plugin clip changes correctly.
+
+ * platform/mac-wk2/plugins/plugin-clip-subframe-expected.txt: Added.
+ * platform/mac/plugins/plugin-clip-subframe-expected.txt: Added.
+ * plugins/plugin-clip-subframe-expected.txt: Added.
+ * plugins/plugin-clip-subframe.html: Added.
+ * plugins/resources/plugin-clip-subframe-iframe.html: Added.
+
2013-02-27 Chris Rogers <crogers@google.com>
Implement channel up-mixing and down-mixing rules
--- /dev/null
+CONSOLE MESSAGE: line 3: NPP_SetWindow: NULL window, Rect {0, 0, 300, 150}, Clip Rect {0, 0, 0, 0}, Type 2
+CONSOLE MESSAGE: line 3: NPP_SetWindow: NULL window, Rect {0, 0, 300, 150}, Clip Rect {0, 0, 0, 0}, Type 2
+CONSOLE MESSAGE: line 3: NPP_SetWindow: NULL window, Rect {0, 0, 300, 150}, Clip Rect {0, 0, 300, 150}, Type 2
+
--- /dev/null
+CONSOLE MESSAGE: line 3: NPP_SetWindow: NULL window, Rect {18, 218, 300, 150}, Clip Rect {0, 600, 0, 600}, Type 0
+CONSOLE MESSAGE: line 3: NPP_SetWindow: NULL window, Rect {18, 218, 300, 150}, Clip Rect {18, 218, 108, 368}, Type 0
+
--- /dev/null
+CONSOLE MESSAGE: line 3: NPP_SetWindow: non-NULL window, Rect {18, 218, 300, 150}, Clip Rect {65518, 65318, 65518, 65318}, Type 1
+CONSOLE MESSAGE: line 3: NPP_SetWindow: non-NULL window, Rect {18, 218, 300, 150}, Clip Rect {0, 0, 90, 150}, Type 1
+
--- /dev/null
+<!doctype html>
+<html>
+<script>
+function test() {
+ // Increase the size of the container so the iframe becomes visible.
+ document.getElementById("container").style.height = "400px";
+ setTimeout(done, 10);
+}
+
+function done() {
+ if (testRunner) {
+ testRunner.dumpAsText();
+ testRunner.notifyDone();
+ }
+}
+
+function runTest() {
+ if (testRunner)
+ testRunner.waitUntilDone();
+ setTimeout(test, 10);
+}
+</script>
+<body onload="runTest()">
+
+<div id = "container" style="overflow: hidden; width:100px; height:100px">
+<iframe id='subframe' src='resources/plugin-clip-subframe-iframe.html' width=500 height=500 style="margin-top:200px"></iframe>
+</div>
+</body>
+</html>
--- /dev/null
+<script>
+function windowWasSet(msg) {
+ console.log(msg);
+}
+</script>
+
+<embed id="testCPlugin" type="application/x-webkit-test-netscape" test="log-npp-set-window"></embed>
+2013-02-27 John Bauman <jbauman@chromium.org>
+
+ Plugin in iframe may not display
+ https://bugs.webkit.org/show_bug.cgi?id=109879
+
+ Reviewed by Simon Fraser.
+
+ Changing the cliprect on a layer containing an iframe may change the
+ cliprect of plugins inside the iframe, so recursively tell all plugins
+ in iframes that their cliprect has changed after doing layout on the
+ outer frame.
+
+ Test: plugins/plugin-clip-subframe.html
+
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::clipRectChanged):
+ * platform/ScrollView.h:
+ * platform/Widget.h:
+ (WebCore::Widget::clipRectChanged):
+ * plugins/PluginView.cpp:
+ (WebCore::PluginView::clipRectChanged):
+ * plugins/PluginView.h:
+ * rendering/RenderWidget.cpp:
+ (WebCore::RenderWidget::setWidgetGeometry):
+
2013-02-27 Chris Rogers <crogers@google.com>
Implement channel up-mixing and down-mixing rules
(*current)->frameRectsChanged();
}
+void ScrollView::clipRectChanged()
+{
+ HashSet<RefPtr<Widget> >::const_iterator end = m_children.end();
+ for (HashSet<RefPtr<Widget> >::const_iterator current = m_children.begin(); current != end; ++current)
+ (*current)->clipRectChanged();
+}
+
#if USE(ACCELERATED_COMPOSITING)
static void positionScrollbarLayer(GraphicsLayer* graphicsLayer, Scrollbar* scrollbar)
{
// Widget override to update our scrollbars and notify our contents of the resize.
virtual void setFrameRect(const IntRect&);
+ // Widget override to notify our contents of a cliprect change.
+ virtual void clipRectChanged() OVERRIDE;
+
// For platforms that need to hit test scrollbars from within the engine's event handlers (like Win32).
Scrollbar* scrollbarAtPoint(const IntPoint& windowPoint);
// Notifies this widget that other widgets on the page have been repositioned.
virtual void widgetPositionsUpdated() {}
+ // Notifies this widget that its clip rect changed.
+ virtual void clipRectChanged() { }
+
// Whether transforms affect the frame rect. FIXME: We get rid of this and have
// the frame rects be the same no matter what transforms are applied.
virtual bool transformsAffectFrameRect() { return true; }
updatePluginWidget();
}
+void PluginView::clipRectChanged()
+{
+ updatePluginWidget();
+}
+
void PluginView::handleEvent(Event* event)
{
if (!m_plugin || m_isWindowed)
virtual void show();
virtual void hide();
virtual void paint(GraphicsContext*, const IntRect&);
+ virtual void clipRectChanged() OVERRIDE;
// This method is used by plugins on all platforms to obtain a clip rect that includes clips set by WebCore,
// e.g., in overflow:auto sections. The clip rects coordinates are in the containing window's coordinate space.
RenderWidgetProtector protector(this);
RefPtr<Node> protectedNode(node());
m_widget->setFrameRect(newFrame);
+
+ if (clipChanged && !boundsChanged)
+ m_widget->clipRectChanged();
#if USE(ACCELERATED_COMPOSITING)
if (hasLayer() && layer()->isComposited())
+2013-02-27 John Bauman <jbauman@chromium.org>
+
+ Plugin in iframe may not display
+ https://bugs.webkit.org/show_bug.cgi?id=109879
+
+ Reviewed by Simon Fraser.
+
+ Use clipRectChanged to update the geometry.
+
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::clipRectChanged):
+ * src/WebPluginContainerImpl.h:
+
2013-02-27 Stephen Chenney <schenney@chromium.org>
RenderTableCellDeathTest unit test fails on mac
reportGeometry();
}
+void WebPluginContainerImpl::clipRectChanged()
+{
+ reportGeometry();
+}
+
void WebPluginContainerImpl::setParentVisible(bool parentVisible)
{
// We override this function to make sure that geometry updates are sent
virtual void setParentVisible(bool);
virtual void setParent(WebCore::ScrollView*);
virtual void widgetPositionsUpdated();
+ virtual void clipRectChanged() OVERRIDE;
virtual bool isPluginContainer() const { return true; }
// WebPluginContainer methods
+2013-02-27 John Bauman <jbauman@chromium.org>
+
+ Plugin in iframe may not display
+ https://bugs.webkit.org/show_bug.cgi?id=109879
+
+ Reviewed by Simon Fraser.
+
+ Ensure NetscapePluginWidget informs the plugin view of the cliprect change directly.
+
+ * Plugins/WebBaseNetscapePluginView.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (NetscapePluginWidget::clipRectChanged):
+
2013-02-26 Alexey Proskuryakov <ap@apple.com>
Don't add a body to platform request until necessary
- (void)handleMouseExited:(NSEvent *)event;
- (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values;
- (void)focusChanged;
+- (void)updateAndSetWindow;
- (WebFrame *)webFrame;
- (WebDataSource *)dataSource;
event->setDefaultHandled(); // We don't know if the plug-in has handled mousedown event by displaying a context menu, so we never want WebKit to show a default one.
}
+ virtual void clipRectChanged()
+ {
+ // Changing the clip rect doesn't affect the view hierarchy, so the plugin must be told about the change directly.
+ [(WebBaseNetscapePluginView *)platformWidget() updateAndSetWindow];
+ }
+
private:
virtual void notifyWidget(WidgetNotification notification)
{
+2013-02-27 John Bauman <jbauman@chromium.org>
+
+ Plugin in iframe may not display
+ https://bugs.webkit.org/show_bug.cgi?id=109879
+
+ Reviewed by Simon Fraser.
+
+ Update geometry when cliprect changes.
+
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::clipRectChanged):
+ * WebProcess/Plugins/PluginView.h:
+
2013-02-27 Jer Noble <jer.noble@apple.com>
REGRESSION (48533): Full-frame plugins stopped working (download instead of loading the plugin)
viewGeometryDidChange();
}
+void PluginView::clipRectChanged()
+{
+ viewGeometryDidChange();
+}
+
void PluginView::setParent(ScrollView* scrollView)
{
Widget::setParent(scrollView);
virtual void show();
virtual void hide();
virtual bool transformsAffectFrameRect();
+ virtual void clipRectChanged() OVERRIDE;
// WebCore::MediaCanStartListener
virtual void mediaCanStart();
+2013-02-27 John Bauman <jbauman@chromium.org>
+
+ Plugin in iframe may not display
+ https://bugs.webkit.org/show_bug.cgi?id=109879
+
+ Reviewed by Simon Fraser.
+
+ LogNPPSetWindow will be used with other ports as well.
+
+ * DumpRenderTree/DumpRenderTree.gypi:
+ * DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt:
+
2013-02-27 Jochen Eisinger <jochen@chromium.org>
plugins/netscape-plugin-setwindow-size*.html and plugins/pass-different-npp-struct.html should be async
'TestNetscapePlugIn/Tests/GetURLWithJavaScriptURL.cpp',
'TestNetscapePlugIn/Tests/GetURLWithJavaScriptURLDestroyingPlugin.cpp',
'TestNetscapePlugIn/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp',
+ 'TestNetscapePlugIn/Tests/LogNPPSetWindow.cpp',
'TestNetscapePlugIn/Tests/NPPNewFails.cpp',
'TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp',
'TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp',
${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/GetURLWithJavaScriptURL.cpp
${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/GetURLWithJavaScriptURLDestroyingPlugin.cpp
${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp
+ ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/LogNPPSetWindow.cpp
${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPDeallocateCalledBeforeNPShutdown.cpp
${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPPNewFails.cpp
${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NPPSetWindowCalledDuringDestruction.cpp