The gain-focus system event (PluginInstanceChild) and the spotlight export (nsPluginHost) built
Palm's NPEvent fields unconditionally. That union exists only for the headless toolkit the device
builds; the desktop GTK build has X11's NPEvent and failed to compile. Both are now guarded the
way npapi.h is (XP_UNIX && MOZ_WIDGET_HEADLESS); the desktop spotlight export returns 0.
(Jihad T-387, cavekit-engine-update R6: the desktop engine on RB_20261006 for the desktop tests.)
Jihad Browser — webOS NPAPI plugin INPUT, the frozen plugin YAP commands, and the frame path
that makes ANIMATED plugin content run (addons R7).
Applies on top of 0005, 0008 and 0016-0023. Supersedes the earlier 0024, which carried only the
input half.
── INPUT ───────────────────────────────────────────────────────────────────────────────────
1. npapi.h — NPEvent becomes Palm's real 48-byte event union on a headless XP_UNIX build
instead of `typedef void*`. That typedef was not a harmless placeholder: NPRemoteEvent is a
raw memcpy of sizeof(NPEvent), so the parent shipped four bytes of its own address space to
the child. No event could ever have carried a payload. With a real POD the stock
NPP_HandleEvent path carries a Palm event unmodified, with no paramtraits change.
2. nsPluginInstanceOwner.cpp — ProcessEvent gains the arm this toolkit never had. Its whole
body was inside XP_MACOSX / XP_WIN / MOZ_X11, so on cairo-headless it reduced to
`return eIgnore` and a windowless plugin got nothing for its entire lifetime. Mouse maps to
npPalmPen{Down,Up,Move,Click,DoubleClick}, keys to npPalmKey{Down,Up,Press}, focus/blur to
the npPalmSystemEvent pair, reusing the MOZ_X11 arm's plugin-local coordinate recipe and
adding no zoom or scroll arithmetic of its own — which is what makes plugin input land where
page content does.
3. PluginInstanceChild.{cpp,h} — drops the truncated private JihadNpPalm* mirrors for that
NPEvent, asserts every offset against the libWebKitLuna address it was read from, and adds a
capped input-delivery breadcrumb.
4. nsPluginHost.{cpp,h} — jihad_plugin_palm_spotlight, a MOZ_EXPORT'd C entry point (the
jihad_offscreen_* precedent) so the daemon can deliver npPalmSpotlightStart/EndEvent for the
frozen asyncCmdPluginSpotlight* commands. nsNPAPIPluginInstance::HandleEvent is neither
exported nor virtual, so there is no other route.
── ANIMATION ───────────────────────────────────────────────────────────────────────────────
5. nsPluginInstanceOwner.cpp — the windowless invalidate now names the PLUGIN's box instead of
the whole widget. 0021 invalidated nearest->GetBounds() on the reasoning that the daemon
repainted everything anyway; once the daemon learned to repaint only damaged rows, that
reasoning inverted and a full-viewport damage box forced the expensive path on every frame.
6. PuppetWidget.{cpp,h} — accumulate the bounding box of everything invalidated since the last
drain, exposed as jihad_offscreen_take_dirty_rect beside the existing flag, so the daemon can
repaint 320x240 (~2 ms) instead of the whole viewport (~38 ms).
7. PluginInstanceChild.cpp — the Palm draw event always covers the WHOLE plugin surface. The
PGContext is built for the full surface, so pairing it with a dstBuffer offset into the
middle of that surface made the plugin's blit run off the end — SIGBUS in the plugin child
the moment the host started sending partial invalidations. Palm's own host never sent a
partial rect either.
8. PluginInstanceParent.cpp — a bounded RecvShow frame-rate line, so the rate frames actually
cross the process boundary can be compared against the rate the plugin was asked to draw.
Device-measured with a purpose-built 30fps SWF (render/goanna/test/make-anim-swf.py): the
plugin draws at 27-31 fps, every frame crosses IPC, and the card composites at 28.3 fps with an
average frame gap of 31-35 ms. Before this work the same content drew at 30 fps inside the
plugin and reached the screen 5 times in 25 seconds.
Imported from build/desktop/patches/0024-npapi-webos-plugin-input.patch.
Adds --disable-npapi as an additional build option. The default is still to build in NPAPI compatibility, but with this flag, it's finally possible to build without pulling in GTK2 on systems that don't have the package.
This essentially ifdefs everything associated with NPAPI, following various Mozilla removal bugs.
Ref: BZ 1682030, BZ 1251202, BZ 1217665, BZ 1687239