Title: [90707] trunk
Revision
90707
Author
[email protected]
Date
2011-07-10 19:28:59 -0700 (Sun, 10 Jul 2011)

Log Message

Let plugins participate in form submission
https://bugs.webkit.org/show_bug.cgi?id=13061

Source/WebCore:

Implements HTMLObjectElement::appendFormData() so that object
elements respond as form associated elements.

Patch by Kenichi Ishibashi <[email protected]> on 2011-07-10
Reviewed by Anders Carlsson.

Test: plugins/form-value.html

* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::appendFormData): Implemented.
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::getFormValue): Added.

Source/WebKit/mac:

Adds methods to get form value from NPAPI plugins.

Patch by Kenichi Ishibashi <[email protected]> on 2011-07-10
Reviewed by Anders Carlsson.

* Plugins/Hosted/WebHostedNetscapePluginView.h:
* Plugins/Hosted/WebHostedNetscapePluginView.mm:
(-[WebHostedNetscapePluginView getFormValue:]): Added.
* Plugins/WebBaseNetscapePluginView.h:
* Plugins/WebBaseNetscapePluginView.mm:
(-[WebBaseNetscapePluginView getFormValue:]): Added.
* Plugins/WebNetscapePluginPackage.h:
* Plugins/WebNetscapePluginPackage.mm:
(-[WebNetscapePluginPackage browserFuncs]): Added.
* Plugins/WebNetscapePluginView.h:
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView getFormValue:]): Added.
* WebCoreSupport/WebFrameLoaderClient.mm:
(NetscapePluginWidget::getFormValue): Added.

Tools:

Adds NPPVformValue support to the testing plugin.

Patch by Kenichi Ishibashi <[email protected]> on 2011-07-10
Reviewed by Anders Carlsson.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added FormValue.cpp
* DumpRenderTree/TestNetScapePlugIn/Tests/FormValue.cpp: Added.
(FormValue::FormValue): Ditto.
(FormValue::NPP_GetValue): Ditto.

LayoutTests:

Adds a test that checks getting form value from plugins.
This test will pass only mac Leopard for now.

Patch by Kenichi Ishibashi <[email protected]> on 2011-07-10
Reviewed by Anders Carlsson.

* platform/chromium/test_expectations.txt: Added an entry for plugins/form-value.html.
* platform/gtk/Skipped: Ditto.
* platform/mac-snowleopard/Skipped: Ditto.
* platform/qt/Skipped: Ditto.
* platform/win/Skipped: Ditto.
* platform/wk2/Skipped: Ditto.
* plugins/form-value-expected.txt: Added.
* plugins/form-value.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (90706 => 90707)


--- trunk/LayoutTests/ChangeLog	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/LayoutTests/ChangeLog	2011-07-11 02:28:59 UTC (rev 90707)
@@ -1,3 +1,22 @@
+2011-07-10  Kenichi Ishibashi  <[email protected]>
+
+        Let plugins participate in form submission
+        https://bugs.webkit.org/show_bug.cgi?id=13061
+
+        Adds a test that checks getting form value from plugins.
+        This test will pass only mac Leopard for now.
+
+        Reviewed by Anders Carlsson.
+
+        * platform/chromium/test_expectations.txt: Added an entry for plugins/form-value.html.
+        * platform/gtk/Skipped: Ditto.
+        * platform/mac-snowleopard/Skipped: Ditto.
+        * platform/qt/Skipped: Ditto.
+        * platform/win/Skipped: Ditto.
+        * platform/wk2/Skipped: Ditto.
+        * plugins/form-value-expected.txt: Added.
+        * plugins/form-value.html: Added.
+
 2011-07-10  James Robinson  <[email protected]>
 
         [chromium] More expectation fixes.

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (90706 => 90707)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-07-11 02:28:59 UTC (rev 90707)
@@ -5119,3 +5119,6 @@
 BUGWK61388 WIN MAC GPU : platform/chromium/compositing/tiny-layer-rotated.html = IMAGE
 BUGWK61388 MAC GPU : compositing/masks/multiple-masks.html = IMAGE
 BUGWK61388 MAC GPU : platform/chromium/compositing/perpendicular-layer-sorting.html = IMAGE
+
+// Getting form value is not implemented yet.
+BUGWK13061 : plugins/form-value.html = TEXT

Modified: trunk/LayoutTests/platform/gtk/Skipped (90706 => 90707)


--- trunk/LayoutTests/platform/gtk/Skipped	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/LayoutTests/platform/gtk/Skipped	2011-07-11 02:28:59 UTC (rev 90707)
@@ -658,6 +658,9 @@
 # This test is for clients that choose to make the missing plugin indicator a button
 plugins/clicking-missing-plugin-fires-delegate.html
 
+# Need to implement getFormValue().
+plugins/form-value.html
+
 # Tests in security/ directory
 #   Tests failing
 security/set-form-autocomplete-attribute.html

Modified: trunk/LayoutTests/platform/mac-snowleopard/Skipped (90706 => 90707)


--- trunk/LayoutTests/platform/mac-snowleopard/Skipped	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/LayoutTests/platform/mac-snowleopard/Skipped	2011-07-11 02:28:59 UTC (rev 90707)
@@ -28,6 +28,9 @@
 # https://bugs.webkit.org/show_bug.cgi?id=43438 - New test added during WebKit2 work; unknown why it fails.
 plugins/npruntime/remove-property.html
 
+# Need to implement getFormValue().
+plugins/form-value.html
+
 # Radar bugs needed for these
 fast/canvas/set-colors.html
 

Modified: trunk/LayoutTests/platform/qt/Skipped (90706 => 90707)


--- trunk/LayoutTests/platform/qt/Skipped	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/LayoutTests/platform/qt/Skipped	2011-07-11 02:28:59 UTC (rev 90707)
@@ -164,6 +164,9 @@
 # ------ Doesn't support WOFF yet.
 fast/css/font-face-woff.html
 
+# Need to implement getFormValue().
+plugins/form-value.html
+
 # accessibility support
 accessibility
 

Modified: trunk/LayoutTests/platform/win/Skipped (90706 => 90707)


--- trunk/LayoutTests/platform/win/Skipped	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/LayoutTests/platform/win/Skipped	2011-07-11 02:28:59 UTC (rev 90707)
@@ -1343,3 +1343,6 @@
 
 # Causes a SyntaxError (http://webkit.org/b/62595).
 fast/workers/worker-crash-with-invalid-location.html
+
+# Need to implement getFormValue().
+plugins/form-value.html

Modified: trunk/LayoutTests/platform/wk2/Skipped (90706 => 90707)


--- trunk/LayoutTests/platform/wk2/Skipped	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/LayoutTests/platform/wk2/Skipped	2011-07-11 02:28:59 UTC (rev 90707)
@@ -1845,6 +1845,9 @@
 # missing window.internals.createShadowContentElement
 fast/dom/shadow/create-content-element.html
 
+# Need to implement getFormValue().
+plugins/form-value.html
+
 ### END OF (2) Classified failures without bug reports (yet)
 ########################################
 

Added: trunk/LayoutTests/plugins/form-value-expected.txt (0 => 90707)


--- trunk/LayoutTests/plugins/form-value-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/plugins/form-value-expected.txt	2011-07-11 02:28:59 UTC (rev 90707)
@@ -0,0 +1,5 @@
+This tests that WebKit can obtain form value from plugins
+
+
+form values: "plugin=Plugin+form+value"
+PASS: The form value was successfully obtained.
Property changes on: trunk/LayoutTests/plugins/form-value-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/plugins/form-value.html (0 => 90707)


--- trunk/LayoutTests/plugins/form-value.html	                        (rev 0)
+++ trunk/LayoutTests/plugins/form-value.html	2011-07-11 02:28:59 UTC (rev 90707)
@@ -0,0 +1,31 @@
+<p>This tests that WebKit can obtain form value from plugins</p>
+<form action="" id="form">
+    <object type="application/x-webkit-test-netscape" test="form-value" name="plugin"></object>
+</form>
+<div id="console"></div>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+
+function log(message) {
+    var div = document.createElement('div');
+    div.innerHTML = message;
+    var console = document.getElementById('console');
+    console.appendChild(div);
+}
+
+if (document.location.href.indexOf('?') == -1) {
+    document.getElementById('form').submit();
+} else {
+    var values = document.location.search.substring(1);
+    log('form values: "' + values + '"');
+    if (values == 'plugin=Plugin+form+value')
+        log('PASS: The form value was successfully obtained.');
+    else
+        log('FAIL: Could not obtain the form value correctly.');
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+</script>
Property changes on: trunk/LayoutTests/plugins/form-value.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (90706 => 90707)


--- trunk/Source/WebCore/ChangeLog	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Source/WebCore/ChangeLog	2011-07-11 02:28:59 UTC (rev 90707)
@@ -1,3 +1,20 @@
+2011-07-10  Kenichi Ishibashi  <[email protected]>
+
+        Let plugins participate in form submission
+        https://bugs.webkit.org/show_bug.cgi?id=13061
+
+        Implements HTMLObjectElement::appendFormData() so that object
+        elements respond as form associated elements.
+
+        Reviewed by Anders Carlsson.
+
+        Test: plugins/form-value.html
+
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::appendFormData): Implemented.
+        * plugins/PluginViewBase.h:
+        (WebCore::PluginViewBase::getFormValue): Added.
+
 2011-07-10  Anders Carlsson  <[email protected]>
 
         WebKit2 is leaking NSCursors created by leakNamedCursor

Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (90706 => 90707)


--- trunk/Source/WebCore/html/HTMLObjectElement.cpp	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp	2011-07-11 02:28:59 UTC (rev 90707)
@@ -28,6 +28,7 @@
 #include "CSSValueKeywords.h"
 #include "EventNames.h"
 #include "ExceptionCode.h"
+#include "FormDataList.h"
 #include "Frame.h"
 #include "HTMLDocument.h"
 #include "HTMLFormElement.h"
@@ -39,12 +40,14 @@
 #include "MIMETypeRegistry.h"
 #include "NodeList.h"
 #include "Page.h"
+#include "PluginViewBase.h"
 #include "RenderEmbeddedObject.h"
 #include "RenderImage.h"
 #include "RenderWidget.h"
 #include "ScriptEventListener.h"
 #include "Settings.h"
 #include "Text.h"
+#include "Widget.h"
 
 namespace WebCore {
 
@@ -535,10 +538,19 @@
     HTMLPlugInImageElement::removedFromTree(deep);
 }
 
-bool HTMLObjectElement::appendFormData(FormDataList&, bool)
+bool HTMLObjectElement::appendFormData(FormDataList& encoding, bool)
 {
-    // FIXME: Implements this function.
-    return false;
+    if (name().isEmpty())
+        return false;
+
+    Widget* widget = pluginWidget();
+    if (!widget || !widget->isPluginViewBase())
+        return false;
+    String value;
+    if (!static_cast<PluginViewBase*>(widget)->getFormValue(value))
+        return false;
+    encoding.appendData(name(), value);
+    return true;
 }
 
 const AtomicString& HTMLObjectElement::formControlName() const

Modified: trunk/Source/WebCore/plugins/PluginViewBase.h (90706 => 90707)


--- trunk/Source/WebCore/plugins/PluginViewBase.h	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Source/WebCore/plugins/PluginViewBase.h	2011-07-11 02:28:59 UTC (rev 90707)
@@ -27,6 +27,7 @@
 
 #include "Widget.h"
 #include "GraphicsLayer.h"
+#include <wtf/text/WTFString.h>
 
 namespace JSC {
     class ExecState;
@@ -46,6 +47,7 @@
 
     virtual JSC::JSObject* scriptObject(JSC::JSGlobalObject*) { return 0; }
     virtual void privateBrowsingStateChanged(bool) { }
+    virtual bool getFormValue(String&) { return false; }
 
 protected:
     PluginViewBase(PlatformWidget widget = 0) : Widget(widget) { }

Modified: trunk/Source/WebKit/mac/ChangeLog (90706 => 90707)


--- trunk/Source/WebKit/mac/ChangeLog	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Source/WebKit/mac/ChangeLog	2011-07-11 02:28:59 UTC (rev 90707)
@@ -1,3 +1,27 @@
+2011-07-10  Kenichi Ishibashi  <[email protected]>
+
+        Let plugins participate in form submission
+        https://bugs.webkit.org/show_bug.cgi?id=13061
+
+        Adds methods to get form value from NPAPI plugins.
+
+        Reviewed by Anders Carlsson.
+
+        * Plugins/Hosted/WebHostedNetscapePluginView.h:
+        * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+        (-[WebHostedNetscapePluginView getFormValue:]): Added.
+        * Plugins/WebBaseNetscapePluginView.h:
+        * Plugins/WebBaseNetscapePluginView.mm:
+        (-[WebBaseNetscapePluginView getFormValue:]): Added.
+        * Plugins/WebNetscapePluginPackage.h:
+        * Plugins/WebNetscapePluginPackage.mm:
+        (-[WebNetscapePluginPackage browserFuncs]): Added.
+        * Plugins/WebNetscapePluginView.h:
+        * Plugins/WebNetscapePluginView.mm:
+        (-[WebNetscapePluginView getFormValue:]): Added.
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (NetscapePluginWidget::getFormValue): Added.
+
 2011-07-04  Dan Bernstein  <[email protected]>
 
         Moved handling of frame size changes into its own method.

Modified: trunk/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h (90706 => 90707)


--- trunk/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h	2011-07-11 02:28:59 UTC (rev 90707)
@@ -59,6 +59,7 @@
 
 - (void)pluginHostDied;
 - (CALayer *)pluginLayer;
+- (BOOL)getFormValue:(NSString **)value;
 - (void)webFrame:(WebFrame *)webFrame didFinishLoadWithReason:(NPReason)reason;
 
 @end

Modified: trunk/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm (90706 => 90707)


--- trunk/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm	2011-07-11 02:28:59 UTC (rev 90707)
@@ -156,6 +156,14 @@
     return _pluginLayer.get();
 }
 
+- (BOOL)getFormValue:(NSString **)value
+{
+    // FIXME: We cannot implement this method for now because NPP_GetValue
+    // is not currently exposed by the plugin host. Once we have an IPC routine
+    // which allows us to invoke NPP_GetValue, we could implement this method.
+    return false;
+}
+
 - (void)setLayer:(CALayer *)newLayer
 {
     // FIXME: This should use the same implementation as WebNetscapePluginView (and move to the base class).

Modified: trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.h (90706 => 90707)


--- trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.h	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.h	2011-07-11 02:28:59 UTC (rev 90707)
@@ -146,6 +146,8 @@
 
 - (CALayer *)pluginLayer;
 
+- (BOOL)getFormValue:(NSString **)value;
+
 @end
 
 

Modified: trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm (90706 => 90707)


--- trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm	2011-07-11 02:28:59 UTC (rev 90707)
@@ -989,6 +989,12 @@
     return nil;
 }
 
+- (BOOL)getFormValue:(NSString **)value
+{
+    ASSERT_NOT_REACHED();
+    return false;
+}
+
 @end
 
 namespace WebKit {

Modified: trunk/Source/WebKit/mac/Plugins/WebNetscapePluginPackage.h (90706 => 90707)


--- trunk/Source/WebKit/mac/Plugins/WebNetscapePluginPackage.h	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Source/WebKit/mac/Plugins/WebNetscapePluginPackage.h	2011-07-11 02:28:59 UTC (rev 90707)
@@ -73,6 +73,7 @@
 
 - (WebExecutableType)executableType;
 - (NPPluginFuncs *)pluginFuncs;
+- (NPNetscapeFuncs *)browserFuncs;
 
 - (BOOL)supportsSnapshotting;
 

Modified: trunk/Source/WebKit/mac/Plugins/WebNetscapePluginPackage.mm (90706 => 90707)


--- trunk/Source/WebKit/mac/Plugins/WebNetscapePluginPackage.mm	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Source/WebKit/mac/Plugins/WebNetscapePluginPackage.mm	2011-07-11 02:28:59 UTC (rev 90707)
@@ -659,6 +659,11 @@
     return &pluginFuncs;
 }
 
+- (NPNetscapeFuncs *)browserFuncs
+{
+    return &browserFuncs;
+}
+
 - (void)wasRemovedFromPluginDatabase:(WebPluginDatabase *)database
 {
     [super wasRemovedFromPluginDatabase:database];

Modified: trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.h (90706 => 90707)


--- trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.h	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.h	2011-07-11 02:28:59 UTC (rev 90707)
@@ -127,6 +127,9 @@
 // The return value is expected to be retained.
 - (NPObject *)createPluginScriptableObject;
 
+// Returns the form value associated with the plugin instance.
+- (BOOL)getFormValue:(NSString **)value;
+
 // -willCallPlugInFunction must be called before calling any of the NPP_* functions for this view's plugin.
 // This is necessary to ensure that plug-ins are not destroyed while WebKit calls into them.  Some plug-ins (Flash
 // at least) are written with the assumption that nothing they do in their plug-in functions can cause NPP_Destroy()

Modified: trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm (90706 => 90707)


--- trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm	2011-07-11 02:28:59 UTC (rev 90707)
@@ -1452,6 +1452,26 @@
     return value;
 }
 
+- (BOOL)getFormValue:(NSString **)value
+{
+    if (![_pluginPackage.get() pluginFuncs]->getvalue || !_isStarted)
+        return false;
+    // Plugins will allocate memory for the buffer by using NPN_MemAlloc().
+    char* buffer = NULL;
+    NPError error;
+    [self willCallPlugInFunction];
+    {
+        JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+        error = [_pluginPackage.get() pluginFuncs]->getvalue(plugin, NPPVformValue, &buffer);
+    }
+    [self didCallPlugInFunction];
+    if (error != NPERR_NO_ERROR || !buffer)
+        return false;
+    *value = [[NSString alloc] initWithUTF8String:buffer];
+    [_pluginPackage.get() browserFuncs]->memfree(buffer);
+    return true;
+}
+
 - (void)willCallPlugInFunction
 {
     ASSERT(plugin);

Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (90706 => 90707)


--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm	2011-07-11 02:28:59 UTC (rev 90707)
@@ -1617,6 +1617,19 @@
     }
 #endif
 
+    virtual bool getFormValue(String& value)
+    {
+        NSString* nsValue = 0;
+        if ([(WebBaseNetscapePluginView *)platformWidget() getFormValue:&nsValue]) {
+            if (!nsValue)
+                return false;
+            value = String(nsValue);
+            [nsValue release];
+            return true;
+        }
+        return false;
+    }
+
     virtual void handleEvent(Event* event)
     {
         Frame* frame = Frame::frameForWidget(this);

Modified: trunk/Tools/ChangeLog (90706 => 90707)


--- trunk/Tools/ChangeLog	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Tools/ChangeLog	2011-07-11 02:28:59 UTC (rev 90707)
@@ -1,3 +1,17 @@
+2011-07-10  Kenichi Ishibashi  <[email protected]>
+
+        Let plugins participate in form submission
+        https://bugs.webkit.org/show_bug.cgi?id=13061
+
+        Adds NPPVformValue support to the testing plugin.
+
+        Reviewed by Anders Carlsson.
+
+        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added FormValue.cpp
+        * DumpRenderTree/TestNetScapePlugIn/Tests/FormValue.cpp: Added.
+        (FormValue::FormValue): Ditto.
+        (FormValue::NPP_GetValue): Ditto.
+
 2011-07-11  Roland Steiner  <[email protected]>
 
         Reviewed by Tony Chang.

Modified: trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj (90706 => 90707)


--- trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj	2011-07-11 02:19:46 UTC (rev 90706)
+++ trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj	2011-07-11 02:28:59 UTC (rev 90707)
@@ -60,6 +60,7 @@
 		440590711268453800CFD48D /* WebArchiveDumpSupportMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 440590701268453800CFD48D /* WebArchiveDumpSupportMac.mm */; };
 		4437730E125CBC3600AAE02C /* WebArchiveDumpSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */; };
 		4437730F125CBC4D00AAE02C /* WebArchiveDumpSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 44A997820FCDE86400580F10 /* WebArchiveDumpSupport.h */; };
+		4AD6A11413C8124000EA9737 /* FormValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AD6A11313C8124000EA9737 /* FormValue.cpp */; };
 		5185F6B210714E07007AA393 /* HistoryDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5185F69F10714A57007AA393 /* HistoryDelegate.mm */; };
 		5185F6B310714E12007AA393 /* HistoryDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5185F69E10714A57007AA393 /* HistoryDelegate.h */; };
 		53CBB832134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBB830134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp */; };
@@ -251,6 +252,7 @@
 		440590701268453800CFD48D /* WebArchiveDumpSupportMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebArchiveDumpSupportMac.mm; path = mac/WebArchiveDumpSupportMac.mm; sourceTree = "<group>"; };
 		44A997820FCDE86400580F10 /* WebArchiveDumpSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebArchiveDumpSupport.h; path = cf/WebArchiveDumpSupport.h; sourceTree = "<group>"; };
 		44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebArchiveDumpSupport.cpp; path = cf/WebArchiveDumpSupport.cpp; sourceTree = "<group>"; };
+		4AD6A11313C8124000EA9737 /* FormValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormValue.cpp; sourceTree = "<group>"; };
 		5185F69E10714A57007AA393 /* HistoryDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HistoryDelegate.h; path = mac/HistoryDelegate.h; sourceTree = "<group>"; };
 		5185F69F10714A57007AA393 /* HistoryDelegate.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = HistoryDelegate.mm; path = mac/HistoryDelegate.mm; sourceTree = "<group>"; };
 		53CBB830134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CyclicRedundancyCheck.cpp; sourceTree = "<group>"; };
@@ -497,6 +499,7 @@
 				1A31EB3613466AC100017372 /* mac */,
 				1A215A7511F26072008AD0F5 /* DocumentOpenInDestroyStream.cpp */,
 				C0E720741281C828004EF533 /* EvaluateJSAfterRemovingPluginElement.cpp */,
+				4AD6A11313C8124000EA9737 /* FormValue.cpp */,
 				1AFF66BB137DEA8300791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp */,
 				1A5CC1F3137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp */,
 				1A3E28A91311D73B00501349 /* GetURLWithJavaScriptURLDestroyingPlugin.cpp */,
@@ -823,6 +826,7 @@
 				C031182B134E4A2B00919757 /* NPPSetWindowCalledDuringDestruction.cpp in Sources */,
 				1A5CC1F5137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp in Sources */,
 				1AFF66BC137DEFD200791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp in Sources */,
+				4AD6A11413C8124000EA9737 /* FormValue.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Added: trunk/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/FormValue.cpp (0 => 90707)


--- trunk/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/FormValue.cpp	                        (rev 0)
+++ trunk/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/FormValue.cpp	2011-07-11 02:28:59 UTC (rev 90707)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "PluginTest.h"
+#include <string.h>
+
+extern NPNetscapeFuncs *browser;
+
+class FormValue : public PluginTest {
+public:
+    FormValue(NPP npp, const std::string& identifier)
+        : PluginTest(npp, identifier)
+    {
+    }
+    virtual NPError NPP_GetValue(NPPVariable, void*);
+};
+
+NPError FormValue::NPP_GetValue(NPPVariable variable, void *value)
+{
+    if (variable == NPPVformValue) {
+        static const char formValueText[] = "Plugin form value";
+        *((void**)value) = browser->memalloc(sizeof(formValueText));
+        if (!*((void**)value))
+            return NPERR_OUT_OF_MEMORY_ERROR;
+        strncpy(*((char**)value), formValueText, sizeof(formValueText));
+        return NPERR_NO_ERROR;
+    }
+    return NPERR_GENERIC_ERROR;
+}
+
+static PluginTest::Register<FormValue> formValue("form-value");
Property changes on: trunk/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/FormValue.cpp
___________________________________________________________________

Added: svn:eol-style

_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to