diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-15 18:14:36 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-15 18:14:36 +0000 |
commit | 17435213d85c34b345917eb142f4b9a9780ecc55 (patch) | |
tree | 318d479c15de2ed081002998e692e4545a65c2b9 /webkit | |
parent | 5be5da900a20e10a4b2c2c72471cc34ee50d1b7c (diff) | |
download | chromium_src-17435213d85c34b345917eb142f4b9a9780ecc55.zip chromium_src-17435213d85c34b345917eb142f4b9a9780ecc55.tar.gz chromium_src-17435213d85c34b345917eb142f4b9a9780ecc55.tar.bz2 |
Fix LayoutTests/plugins/destroy-during-npp-new.html
We crash if we try to report geometry for a plugin that has been
removed from the DOM.
This CL makes changes to main.cpp to support the layout test,
which corresponds to http://trac.webkit.org/changeset/48361.
R=jam
BUG=21841
TEST=covered by layout test
Review URL: http://codereview.chromium.org/196126
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/api/src/WebPluginContainerImpl.cpp | 3 | ||||
-rwxr-xr-x | webkit/tools/layout_tests/test_expectations.txt | 1 | ||||
-rw-r--r-- | webkit/tools/npapi_layout_test_plugin/main.cpp | 5 |
3 files changed, 6 insertions, 3 deletions
diff --git a/webkit/api/src/WebPluginContainerImpl.cpp b/webkit/api/src/WebPluginContainerImpl.cpp index 0f839a9..96cbd90 100644 --- a/webkit/api/src/WebPluginContainerImpl.cpp +++ b/webkit/api/src/WebPluginContainerImpl.cpp @@ -211,7 +211,8 @@ void WebPluginContainerImpl::invalidateRect(const WebRect& rect) void WebPluginContainerImpl::reportGeometry() { - if (!parent()) + // We cannot compute geometry without an associated RenderObject. + if (!parent() || !m_element->renderer()) return; IntRect windowRect, clipRect; diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt index 0b1fbad..a266923 100755 --- a/webkit/tools/layout_tests/test_expectations.txt +++ b/webkit/tools/layout_tests/test_expectations.txt @@ -2317,7 +2317,6 @@ BUG21767 : LayoutTests/http/tests/security/cross-frame-access-enumeration.html = // WK roll to 48371 BUG21840 : LayoutTests/http/tests/loading/basic-auth-resend-wrong-credentials.html = FAIL BUG21840 : LayoutTests/http/tests/loading/basic-credentials-sent-automatically.html = FAIL -BUG21841 : LayoutTests/plugins/destroy-during-npp-new.html = FAIL // missing upstream baseline from 48368 BUG21842 SKIP WIN LINUX : LayoutTests/platform/win/accessibility/scroll-to-anchor.html = FAIL diff --git a/webkit/tools/npapi_layout_test_plugin/main.cpp b/webkit/tools/npapi_layout_test_plugin/main.cpp index fbd9b82..b546efe 100644 --- a/webkit/tools/npapi_layout_test_plugin/main.cpp +++ b/webkit/tools/npapi_layout_test_plugin/main.cpp @@ -143,6 +143,8 @@ void NPAPI NP_Shutdown(void) { } +static void executeScript(const PluginObject* obj, const char* script); + NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char *argn[], char *argv[], NPSavedData *saved) { if (browser->version >= 14) { @@ -164,7 +166,8 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch fflush(stdout); } } - } + } else if (strcasecmp(argn[i], "cleardocumentduringnew") == 0) + executeScript(obj, "document.body.innerHTML = ''"); } instance->pdata = obj; |