Commit Graph
14 Commits
Author SHA1 Message Date
NotAlexNoyleandClaude Fable 5.1 b2eee4371e plugins: an instance with no window to be given is windowless, not a null dereference
nsPluginInstanceOwner::CreateWidget() creates a child-window widget for a
windowed plugin and then calls Create() on it without checking that the widget
exists. A build with no child-window widget (the offscreen embedding registers
none for kWidgetCID) got null back and crashed with SIGSEGV on every page whose
Flash movie was embedded the ordinary way: a plugin is windowed unless it asks
otherwise, and Flash asks only for wmode=opaque or transparent.

With no widget to create, mark the instance windowless and carry on down the
windowless path. That is what webOS's own browser did - it had no plugin
windows and handed every plugin a drawable - and the webOS Flash build draws
through the Palm window structure in both modes.

Found on the device: two "Flash test" pages reached from a search results page
killed the daemon in a loop (the card reconnects and reopens the address).
After the change both render their movies and the daemon keeps its PID.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LcrVQFRMC2ANGDfVaRG9Ed
2026-11-03 08:53:30 -05:00
NotAlexNoyle a7612a322e npapi webos plugin input
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.
2026-11-03 08:53:29 -05:00
NotAlexNoyle fff77f0e79 npapi windowless invalidate offscreen
(no description in the patch)

Imported from build/desktop/patches/0021-npapi-windowless-invalidate-offscreen.patch.
2026-11-03 08:53:28 -05:00
Moonchild d6575ba929 Issue #2721 - Remove nsILinkHandler.
This interface inly has a single implementation behind it, which is also
only used in 2 places after the previous commit. That's a lot of
additional complexity and compiler indirection for no good reason.
This change removes the interface and uses direct nsDocShell::Cast calls
instead of going through the interface in the few places left now that
we no longer build on a presentation context for links.
2025-06-10 01:51:14 +02:00
athenian200 b787af5702 Issue #1638 - Part 1: Put NPAPI code behind MOZ_ENABLE_NPAPI.
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
2024-01-10 04:03:35 -06:00
Moonchild 1e50ffb192 Issue #1656 - Remove more vim control lines.
Vim control lines were re-introduced or not entirely cleaned up.
This nukes them again.
Removing from dom. More to come.
2023-05-04 03:33:25 +02:00
Moonchild 88f392397b Issue #2019 - Follow-up: Make nsPluginInstanceOwner also listen to keypress events in the system event group.
nsPluginInstanceOwner only listens to keypress events in the default event group.
However, in our changed operating mode, keypress events are not fired in the
default event group if the key does not result in something printable.
This means that nsPluginInstanceOwner should also listen to keypress events
in the system event group and should handle each keypress that way, but
only once. I.e., if a printable keypress event is received in the system event
group, it should be ignored, since it would've already been handled in the
default event group in that case.
2022-11-24 21:41:28 +00:00
Brian Smith c82b759d56 Issue #1829 - Revert "Issue #1751 -- Remove XP_MACOSX conditionals from /dom"
This reverts commit 0dd3424f77.
2022-04-26 11:24:42 -05:00
Moonchild 0dd3424f77 Issue #1751 -- Remove XP_MACOSX conditionals from /dom 2021-04-30 21:22:08 +00:00
Moonchild f7670e6f53 Issue #80 - De-unify dom/plugins/base 2020-04-22 20:04:53 +00:00
Matt A. Tobin 04fb9eaa6a Issue #1053 - Remove android support from NPAPI 2020-02-20 12:44:29 -05:00
janekptacijarabaci d45c25971c Bug 1182569 - Skip security check for plugins using newstream attribute 2018-04-30 22:09:55 +02:00
janekptacijarabaci 80f9b75efa Implement auxclick
Bug(s):
https://bugzilla.mozilla.org/show_bug.cgi?id=1304044
(native in moebius)
2018-02-04 23:15:50 +01:00
Matt A. Tobin 5f8de423f1 Add m-esr52 at 52.6.0 2018-02-02 04:16:08 -05:00