Changeset 147956 in webkit
- Timestamp:
- Apr 8, 2013 3:05:24 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r147955 r147956 1 2013-04-08 Arunprasad Rajkumar <arunprasadr@nds.com> 2 3 Call Netscape Plugin's toString() and valueOf() instead of providing default implementation 4 https://bugs.webkit.org/show_bug.cgi?id=113139 5 6 Reviewed by Anders Carlsson. 7 8 * platform/qt-mac/TestExpectations: 9 * platform/wk2/TestExpectations: 10 * plugins/npruntime/tostring-expected.txt: Added. 11 * plugins/npruntime/tostring.html: Added. 12 * plugins/npruntime/valueof-expected.txt: Added. 13 * plugins/npruntime/valueof.html: Added. 14 1 15 2013-04-08 Tim Horton <timothy_horton@apple.com> 2 16 -
trunk/LayoutTests/platform/qt-mac/TestExpectations
r147522 r147956 2641 2641 plugins/npruntime/round-trip-npobject.html 2642 2642 plugins/npruntime/throw-exception.html 2643 plugins/npruntime/tostring.html 2644 plugins/npruntime/valueof.html 2643 2645 plugins/object-embed-plugin-scripting.html 2644 2646 plugins/get-url-notify-with-url-that-fails-to-load.html -
trunk/LayoutTests/platform/wk2/TestExpectations
r147901 r147956 338 338 # https://bugs.webkit.org/show_bug.cgi?id=105266 339 339 plugins/npruntime/embed-property-iframe-equality.html 340 341 # [WK2] Call Netscape Plugin's toString() and valueOf() instead of providing default implementation 342 # https://bugs.webkit.org/show_bug.cgi?id=114213 343 plugins/npruntime/tostring.html 344 plugins/npruntime/valueof.html 340 345 341 346 webkit.org/b/105952 fast/loader/submit-form-while-parsing-2.html [ Pass Failure ] -
trunk/Source/WebCore/ChangeLog
r147955 r147956 1 2013-04-08 Arunprasad Rajkumar <arunprasadr@nds.com> 2 3 Call Netscape Plugin's toString() and valueOf() instead of providing default implementation 4 https://bugs.webkit.org/show_bug.cgi?id=113139 5 6 Reviewed by Anders Carlsson. 7 8 Tests: plugins/npruntime/tostring.html 9 plugins/npruntime/valueof.html 10 11 * bridge/c/c_instance.cpp: 12 (JSC::Bindings::CInstance::~CInstance): 13 (JSC::Bindings::CInstance::invokeMethod): 14 (JSC::Bindings::CInstance::invokeDefaultMethod): 15 (Bindings): 16 (JSC::Bindings::CInstance::invokeConstruct): 17 (JSC::Bindings::CInstance::stringValue): 18 (JSC::Bindings::CInstance::booleanValue): 19 (JSC::Bindings::CInstance::valueOf): 20 (JSC::Bindings::CInstance::toJSPrimitive): 21 * bridge/c/c_instance.h: 22 (CInstance): 23 1 24 2013-04-08 Tim Horton <timothy_horton@apple.com> 2 25 -
trunk/Source/WebCore/bridge/c/c_instance.cpp
r129969 r147956 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 … … 86 86 } 87 87 88 CInstance::~CInstance() 88 CInstance::~CInstance() 89 89 { 90 90 _NPN_ReleaseObject(_object); … … 181 181 moveGlobalExceptionToExecState(exec); 182 182 } 183 183 184 184 if (!retval) 185 throwError(exec, createError(exec, "Error calling method on NPObject."));185 throwError(exec, createError(exec, ASCIILiteral("Error calling method on NPObject."))); 186 186 187 187 for (i = 0; i < count; i++) … … 216 216 moveGlobalExceptionToExecState(exec); 217 217 } 218 218 219 219 if (!retval) 220 throwError(exec, createError(exec, "Error calling method on NPObject."));220 throwError(exec, createError(exec, ASCIILiteral("Error calling method on NPObject."))); 221 221 222 222 for (i = 0; i < count; i++) … … 232 232 return _object->_class->construct; 233 233 } 234 234 235 235 JSValue CInstance::invokeConstruct(ExecState* exec, const ArgList& args) 236 236 { … … 255 255 moveGlobalExceptionToExecState(exec); 256 256 } 257 257 258 258 if (!retval) 259 throwError(exec, createError(exec, "Error calling method on NPObject."));259 throwError(exec, createError(exec, ASCIILiteral("Error calling method on NPObject."))); 260 260 261 261 for (i = 0; i < count; i++) … … 278 278 JSValue CInstance::stringValue(ExecState* exec) const 279 279 { 280 JSValue value; 281 if (toJSPrimitive(exec, "toString", value)) 282 return value; 283 284 // Fallback to default implementation. 280 285 char buf[1024]; 281 286 snprintf(buf, sizeof(buf), "NPObject %p, NPClass %p", _object, _object->_class); … … 291 296 JSValue CInstance::booleanValue() const 292 297 { 293 // FIXME: Implement something sensible. 294 return jsBoolean(false); 295 } 296 297 JSValue CInstance::valueOf(ExecState* exec) const 298 { 298 // As per ECMA 9.2. 299 return jsBoolean(getObject()); 300 } 301 302 JSValue CInstance::valueOf(ExecState* exec) const 303 { 304 JSValue value; 305 if (toJSPrimitive(exec, "valueOf", value)) 306 return value; 307 308 // Fallback to default implementation. 299 309 return stringValue(exec); 310 } 311 312 bool CInstance::toJSPrimitive(ExecState* exec, const char* name, JSValue& resultValue) const 313 { 314 NPIdentifier ident = _NPN_GetStringIdentifier(name); 315 if (!_object->_class->hasMethod(_object, ident)) 316 return false; 317 318 // Invoke the 'C' method. 319 bool retval = true; 320 NPVariant resultVariant; 321 VOID_TO_NPVARIANT(resultVariant); 322 323 { 324 JSLock::DropAllLocks dropAllLocks(exec); 325 ASSERT(globalExceptionString().isNull()); 326 retval = _object->_class->invoke(_object, ident, 0, 0, &resultVariant); 327 moveGlobalExceptionToExecState(exec); 328 } 329 330 if (!retval) 331 throwError(exec, createError(exec, ASCIILiteral("Error calling method on NPObject."))); 332 333 resultValue = convertNPVariantToValue(exec, &resultVariant, m_rootObject.get()); 334 _NPN_ReleaseVariantValue(&resultVariant); 335 return true; 300 336 } 301 337 -
trunk/Source/WebCore/bridge/c/c_instance.h
r127191 r147956 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 … … 79 79 80 80 virtual RuntimeObject* newRuntimeObject(ExecState*); 81 bool toJSPrimitive(ExecState*, const char*, JSValue&) const; 82 81 83 82 84 mutable CClass *_class; -
trunk/Tools/ChangeLog
r147946 r147956 1 2013-04-08 Arunprasad Rajkumar <arunprasadr@nds.com> 2 3 Call Netscape Plugin's toString() and valueOf() instead of providing default implementation 4 https://bugs.webkit.org/show_bug.cgi?id=113139 5 6 Reviewed by Anders Carlsson. 7 8 * DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.vcxproj: 9 * DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.vcxproj.filters: 10 * DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt: 11 * DumpRenderTree/TestNetscapePlugIn/Tests/ToStringAndValueOfObject.cpp: Added. 12 (ToStringAndValueOfObject): 13 (ToStringAndValueOfObject::ToStringAndValueOfObject): 14 (ScriptableObject): 15 (ToStringAndValueOfObject::ScriptableObject::hasMethod): 16 (ToStringAndValueOfObject::ScriptableObject::invoke): 17 (ToStringAndValueOfObject::ScriptableObject::pluginTest): 18 (ToStringAndValueOfObject::NPP_GetValue): 19 * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj: 20 * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro: 21 * GNUmakefile.am: 22 1 23 2013-04-08 Manuel Rego Casasnovas <rego@igalia.com> 2 24 -
trunk/Tools/DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.vcxproj
r146530 r147956 51 51 <ClCompile Include="..\..\TestNetscapePlugIn\Tests\PluginScriptableObjectOverridesAllProperties.cpp" /> 52 52 <ClCompile Include="..\..\TestNetscapePlugIn\Tests\PrivateBrowsing.cpp" /> 53 <ClCompile Include="..\..\TestNetscapePlugIn\Tests\ToStringAndValueOfObject.cpp" /> 53 54 <ClCompile Include="..\..\TestNetscapePlugIn\Tests\win\CallJSThatDestroysPlugin.cpp" /> 54 55 <ClCompile Include="..\..\TestNetscapePlugIn\Tests\win\DrawsGradient.cpp" /> -
trunk/Tools/DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.vcxproj.filters
r142954 r147956 69 69 <Filter>Tests</Filter> 70 70 </ClCompile> 71 <ClCompile Include="..\..\TestNetscapePlugIn\Tests\ToStringAndValueOfObject.cpp"> 72 <Filter>Tests</Filter> 73 </ClCompile> 71 74 <ClCompile Include="..\..\TestNetscapePlugIn\Tests\win\CallJSThatDestroysPlugin.cpp"> 72 75 <Filter>Tests\win</Filter> -
trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
r144657 r147956 42 42 1A31EB3813466AC100017372 /* ConvertPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A31EB3713466AC100017372 /* ConvertPoint.cpp */; }; 43 43 1A3E28AA1311D73B00501349 /* GetURLWithJavaScriptURLDestroyingPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3E28A91311D73B00501349 /* GetURLWithJavaScriptURLDestroyingPlugin.cpp */; }; 44 1A4CCD4F171375A300981040 /* ToStringAndValueOfObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A4CCD4E171375A300981040 /* ToStringAndValueOfObject.cpp */; }; 44 45 1A5CC1F5137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5CC1F3137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp */; }; 45 46 1A66C35114576A920099A115 /* ContentsScaleFactor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A66C34F14576A920099A115 /* ContentsScaleFactor.cpp */; }; … … 256 257 1A31EB3713466AC100017372 /* ConvertPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConvertPoint.cpp; sourceTree = "<group>"; }; 257 258 1A3E28A91311D73B00501349 /* GetURLWithJavaScriptURLDestroyingPlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetURLWithJavaScriptURLDestroyingPlugin.cpp; sourceTree = "<group>"; }; 259 1A4CCD4E171375A300981040 /* ToStringAndValueOfObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ToStringAndValueOfObject.cpp; sourceTree = "<group>"; }; 258 260 1A5CC1F3137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetURLWithJavaScriptURL.cpp; sourceTree = "<group>"; }; 259 261 1A66C34F14576A920099A115 /* ContentsScaleFactor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentsScaleFactor.cpp; sourceTree = "<group>"; }; … … 586 588 1A1E4296141141C400388758 /* PrivateBrowsing.cpp */, 587 589 5106803D15CC7B10001A8A23 /* SlowNPPNew.cpp */, 590 1A4CCD4E171375A300981040 /* ToStringAndValueOfObject.cpp */, 588 591 ); 589 592 path = Tests; … … 914 917 files = ( 915 918 1A66C35114576A920099A115 /* ContentsScaleFactor.cpp in Sources */, 919 1A4CCD4F171375A300981040 /* ToStringAndValueOfObject.cpp in Sources */, 916 920 1A31EB3813466AC100017372 /* ConvertPoint.cpp in Sources */, 917 921 1A215BE711F27658008AD0F5 /* DocumentOpenInDestroyStream.cpp in Sources */, -
trunk/Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt
r144236 r147956 26 26 ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/PluginScriptableObjectOverridesAllProperties.cpp 27 27 ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/PrivateBrowsing.cpp 28 ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/ToStringAndValueOfObject.cpp 28 29 ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/x11/CallInvalidateRectWithNullNPPArgument.cpp 29 30 ) -
trunk/Tools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
r142495 r147956 462 462 > 463 463 </File> 464 <File 465 RelativePath="..\Tests\ToStringAndValueOfObject.cpp" 466 > 467 </File> 464 468 <Filter 465 469 Name="win" -
trunk/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
r132713 r147956 32 32 Tests/PluginScriptableNPObjectInvokeDefault.cpp \ 33 33 Tests/PluginScriptableObjectOverridesAllProperties.cpp \ 34 Tests/PrivateBrowsing.cpp 34 Tests/PrivateBrowsing.cpp \ 35 Tests/ToStringAndValueOfObject.cpp 35 36 36 37 WEBKIT += webcore # For NPAPI headers -
trunk/Tools/GNUmakefile.am
r147137 r147956 281 281 Tools/DumpRenderTree/TestNetscapePlugIn/Tests/PluginScriptableNPObjectInvokeDefault.cpp \ 282 282 Tools/DumpRenderTree/TestNetscapePlugIn/Tests/PrivateBrowsing.cpp \ 283 Tools/DumpRenderTree/TestNetscapePlugIn/Tests/ToStringAndValueOfObject.cpp \ 283 284 Tools/DumpRenderTree/TestNetscapePlugIn/Tests/x11/CallInvalidateRectWithNullNPPArgument.cpp \ 284 285 Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp \
Note: See TracChangeset
for help on using the changeset viewer.