Bug 21572 - NPAPI implementation bugs in WebKit top-of-tree
Summary: NPAPI implementation bugs in WebKit top-of-tree
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Major
Assignee: Nobody
Depends on:
Reported: 2008-10-13 11:18 PDT by Kenneth Russell
Modified: 2008-10-15 18:14 PDT (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Russell 2008-10-13 11:18:54 PDT
There are a couple of bugs in the NPAPI implementation on the WebKit top of tree preventing plug-ins from working as expected:

1. The "size" field of the NPPluginFuncs is not initialized before being passed to NP_GetEntryPoints. Patch ((tested, verified):

Index: WebNetscapePluginPackage.m
--- WebNetscapePluginPackage.m    (revision 37534)
+++ WebNetscapePluginPackage.m    (working copy)
@@ -569,6 +569,7 @@
         LOG(Plugins, "%f NP_Initialize took %f seconds", currentTime, duration);

+        pluginFuncs.size = sizeof(NPPluginFuncs);
         npErr = NP_GetEntryPoints(&pluginFuncs);
         if (npErr != NPERR_NO_ERROR)
             goto abort; 

2. NPN_SetValue(npp, NPPVpluginDrawingModel, (void*)NPDrawingModelCoreGraphics); fails. Patch (tested, verified):

Index: WebBaseNetscapePluginView.mm
--- WebBaseNetscapePluginView.mm    (revision 37534)
+++ WebBaseNetscapePluginView.mm    (working copy)
@@ -2561,9 +2561,13 @@
             NPDrawingModel newDrawingModel = (NPDrawingModel)(uintptr_t)value;
             switch (newDrawingModel) {
                 // Supported drawing models:
+                case NPDrawingModelCoreGraphics:
                 case NPDrawingModelQuickDraw:
+                    drawingModel = newDrawingModel;
+                    return NPERR_NO_ERROR;
                 // Unsupported (or unknown) drawing models:
                     LOG(Plugins, "Plugin %@ uses unsupported drawing model: %d", pluginPackage, drawingModel);
Comment 1 Anders Carlsson 2008-10-15 18:14:50 PDT
Part of this patch was landed by Mark Rowe as a different fix.

Committed revision 37624.