[rfc][icedtea-web] Remove need for HTML tag scanner in PluginAppletViewer
Adam Domurad
adomurad at redhat.com
Thu Oct 25 13:10:06 PDT 2012
Hi all. This is something I've wanted to do for a while, simply because
of the hackish nature of the applet/object/embed tag parsing code in
ITW. Thoughts welcome, I'll still be doing some more testing on this
(looks good so far) but would appreciate feedback. The patch also makes
it possible to do unit tests from classes included in plugin.jar (used
to unit test the new sun.java.PluginAppletAttributes).
The applet tag information flows like this pre-patch:
- NPAPI parses the tag information
- ITW's C++ side takes in the already-parsed tag information, creates an
embed tag (embed tag only) for ITW to use.
- ITW's java side receives the tag, and scans it using (less than
desirable) parsing routines.
Post-patch:
- NPAPI parses the tag information
- ITW's C++ side generates a simple listing of the name value pairs passed
- ITW's java side parses these name value pairs
Points of contention:
- PluginAppletViewer#parse had a 'ydisp' variable that has been changed
to a static variable, since the parse method will now only ever handle
one applet tag (the old version expected to have potentially multiple).
However I'm not 100% about this because the old version as well only
ever received one applet tag, rendering this effectively to always be
1... I'm not sure if the behaviour should be 'fixed' this way.
- The code was made to behave as-it-were as much as possible, meaning it
can print a warning about a "missing code attribute in the embed tag" no
matter what tag was used. This is as it was because ITW would always get
passed an embed tag. Feel free to force me to change it:)
ChangeLog:
2012-10-25 Adam Domurad <adomurad at redhat.com>
Remove the applet/embed/object tag parser from ITW. Send the applet
parameters directly from the C++.
* Makefile.am: Allow unit-testing for classes in plugin.jar.
* plugin/icedteanp/IcedTeaNPPlugin.cc: Send quoted parameter
name/values instead of applet tag. Remove some dead code.
* plugin/icedteanp/IcedTeaNPPlugin.h: Rename applet_tag ->
parameters_string.
* plugin/icedteanp/java/sun/applet/PluginAppletViewer.java:
Extract parsing code into its own class.
* plugin/icedteanp/java/sun/applet/PluginAppletAttributes.java:
New, encapsulates the (simplified) attribute parsing logic.
* tests/netx/unit/sun/applet/PluginAppletAttributesTest.java:
Unit tests for parsing logic.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nuke-parser.patch
Type: text/x-patch
Size: 47249 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121025/319f3201/nuke-parser.patch
More information about the distro-pkg-dev
mailing list