Title: [132565] trunk
Revision
132565
Author
[email protected]
Date
2012-10-25 20:23:52 -0700 (Thu, 25 Oct 2012)

Log Message

Fix a layout test crash if a TestWebkitPlugin is put inside an iframe
https://bugs.webkit.org/show_bug.cgi?id=100406

Patch by Min Qin <[email protected]> on 2012-10-25
Reviewed by Adam Barth.

Tools:

Resize the context with an empty rect will cause a gl_error in gles2_cmd_decoder.cc.
Don't paint the plugin if m_rect is empty.

* DumpRenderTree/chromium/TestWebPlugin.cpp:
(TestWebPlugin::updateGeometry):

LayoutTests:

Test for adding a webplugin into an iframe and make sure it doesn't crash.

* platform/chromium/plugins/plugin-inside-iframe-expected.txt: Added.
* platform/chromium/plugins/plugin-inside-iframe.html: Added.
* platform/chromium/plugins/resources/plugin-page.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (132564 => 132565)


--- trunk/LayoutTests/ChangeLog	2012-10-26 03:11:50 UTC (rev 132564)
+++ trunk/LayoutTests/ChangeLog	2012-10-26 03:23:52 UTC (rev 132565)
@@ -1,3 +1,16 @@
+2012-10-25  Min Qin  <[email protected]>
+
+        Fix a layout test crash if a TestWebkitPlugin is put inside an iframe
+        https://bugs.webkit.org/show_bug.cgi?id=100406
+
+        Reviewed by Adam Barth.
+
+        Test for adding a webplugin into an iframe and make sure it doesn't crash.
+
+        * platform/chromium/plugins/plugin-inside-iframe-expected.txt: Added.
+        * platform/chromium/plugins/plugin-inside-iframe.html: Added.
+        * platform/chromium/plugins/resources/plugin-page.html: Added.
+
 2012-10-25  Tom Sepez  <[email protected]>
 
         Test full-block-iframe-no-inherit.php generates an invalid X-XSS-PROTECTION header.

Added: trunk/LayoutTests/platform/chromium/plugins/plugin-inside-iframe-expected.txt (0 => 132565)


--- trunk/LayoutTests/platform/chromium/plugins/plugin-inside-iframe-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/plugins/plugin-inside-iframe-expected.txt	2012-10-26 03:23:52 UTC (rev 132565)
@@ -0,0 +1,2 @@
+
+This tests that we do not crash by putting a plugin inside an iframe.

Added: trunk/LayoutTests/platform/chromium/plugins/plugin-inside-iframe.html (0 => 132565)


--- trunk/LayoutTests/platform/chromium/plugins/plugin-inside-iframe.html	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/plugins/plugin-inside-iframe.html	2012-10-26 03:23:52 UTC (rev 132565)
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+</head>
+<body>
+<iframe frameborder="0" width="200" height="200" src=""
+<script>
+    if (!window.testRunner) {
+        document.write("This test does not work in manual mode.");
+    } else {
+        testRunner.dumpAsText();
+    }
+</script>
+<div>This tests that we do not crash by putting a plugin inside an iframe.</div>
+</body>
+</html>

Added: trunk/LayoutTests/platform/chromium/plugins/resources/plugin-page.html (0 => 132565)


--- trunk/LayoutTests/platform/chromium/plugins/resources/plugin-page.html	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/plugins/resources/plugin-page.html	2012-10-26 03:23:52 UTC (rev 132565)
@@ -0,0 +1,17 @@
+<!doctype html>
+<html>
+<head>
+<style>
+#plugin {
+position: absolute;
+left: 50px;
+top: 50px;
+width: 100px;
+height: 100px;
+}
+</style>
+</head>
+<body>
+<embed id="plugin" type="application/x-webkit-test-webplugin"></embed>
+</body>
+</html>

Modified: trunk/Tools/ChangeLog (132564 => 132565)


--- trunk/Tools/ChangeLog	2012-10-26 03:11:50 UTC (rev 132564)
+++ trunk/Tools/ChangeLog	2012-10-26 03:23:52 UTC (rev 132565)
@@ -1,3 +1,16 @@
+2012-10-25  Min Qin  <[email protected]>
+
+        Fix a layout test crash if a TestWebkitPlugin is put inside an iframe
+        https://bugs.webkit.org/show_bug.cgi?id=100406
+
+        Reviewed by Adam Barth.
+
+        Resize the context with an empty rect will cause a gl_error in gles2_cmd_decoder.cc.
+        Don't paint the plugin if m_rect is empty.
+
+        * DumpRenderTree/chromium/TestWebPlugin.cpp:
+        (TestWebPlugin::updateGeometry):
+
 2012-10-25  Jinwoo Song  <[email protected]>
 
         [EFL][WK2] Display tooltip in MiniBrowser

Modified: trunk/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp (132564 => 132565)


--- trunk/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp	2012-10-26 03:11:50 UTC (rev 132564)
+++ trunk/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp	2012-10-26 03:23:52 UTC (rev 132565)
@@ -206,6 +206,8 @@
     if (clipRect == m_rect)
         return;
     m_rect = clipRect;
+    if (m_rect.isEmpty())
+        return;
 
     m_context->reshape(m_rect.width, m_rect.height);
     m_context->viewport(0, 0, m_rect.width, m_rect.height);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to