Changeset 98679 in webkit
- Timestamp:
- Oct 27, 2011, 7:43:12 PM (15 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 deleted
- 13 edited
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/runtime/JSValue.h (modified) (1 diff)
-
JavaScriptCore/runtime/JSValueInlineMethods.h (modified) (2 diffs)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/GNUmakefile.list.am (modified) (1 diff)
-
WebCore/UseJSC.cmake (modified) (1 diff)
-
WebCore/WebCore.gypi (modified) (1 diff)
-
WebCore/WebCore.pro (modified) (1 diff)
-
WebCore/WebCore.xcodeproj/project.pbxproj (modified) (4 diffs)
-
WebCore/bindings/js/JSBindingsAllInOne.cpp (modified) (1 diff)
-
WebCore/bindings/js/JSDOMBinding.h (modified) (1 diff)
-
WebCore/bindings/js/JSWebKitCSSMatrixCustom.cpp (deleted)
-
WebCore/bindings/scripts/CodeGeneratorJS.pm (modified) (4 diffs)
-
WebCore/css/WebKitCSSMatrix.idl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r98674 r98679 1 2011-10-27 Kentaro Hara <haraken@chromium.org> 2 3 Generate WebKitCSSMatrix constructor for JSC by [Constructor] IDL 4 https://bugs.webkit.org/show_bug.cgi?id=70215 5 6 Reviewed by Adam Barth. 7 8 Added a method that judges if a given JSValue is empty. 9 10 Tests: transforms/svg-vs-css.xhtml 11 transforms/cssmatrix-2d-interface.xhtml 12 transforms/cssmatrix-3d-interface.xhtml 13 14 * runtime/JSValue.h: 15 * runtime/JSValueInlineMethods.h: 16 (JSC::JSValue::isEmpty): 17 1 18 2011-10-27 Michael Saboff <msaboff@apple.com> 2 19 -
trunk/Source/JavaScriptCore/runtime/JSValue.h
r97827 r98679 163 163 164 164 // Querying the type. 165 bool isEmpty() const; 165 166 bool isUndefined() const; 166 167 bool isNull() const; -
trunk/Source/JavaScriptCore/runtime/JSValueInlineMethods.h
r96717 r98679 224 224 } 225 225 226 inline bool JSValue::isEmpty() const 227 { 228 return tag() == EmptyValueTag; 229 } 230 226 231 inline bool JSValue::isUndefined() const 227 232 { … … 369 374 } 370 375 376 inline bool JSValue::isEmpty() const 377 { 378 return u.asInt64 == ValueEmpty; 379 } 380 371 381 inline bool JSValue::isUndefined() const 372 382 { -
trunk/Source/WebCore/ChangeLog
r98676 r98679 1 2011-10-27 Kentaro Hara <haraken@chromium.org> 2 3 Generate WebKitCSSMatrix constructor for JSC by [Constructor] IDL 4 https://bugs.webkit.org/show_bug.cgi?id=70215 5 6 Reviewed by Adam Barth. 7 8 This patch implements [Optional=CallWithNullValue] IDL for JSC. 9 While a parameter specified as [Optional=CallWithDefaultValue] is 10 handled as a string "undefined", a parameter specified as 11 [Optional=CallWithNullValue] is handled as a null string. 12 (Note: not a string "null", but a null string). 13 14 c.f. [Optional=CallWithNullValue] is implemented in V8 in bug 67458. 15 16 Tests: fast/dom/global-constructors.html 17 transforms/svg-vs-css.xhtml 18 transforms/cssmatrix-2d-interface.xhtml 19 transforms/cssmatrix-3d-interface.xhtml 20 21 * GNUmakefile.list.am: Removed JSWebKitCSSMatrixCustom.cpp. 22 * UseJSC.cmake: Ditto. 23 * WebCore.gypi: Ditto. 24 * WebCore.pro: Ditto. 25 * WebCore.xcodeproj/project.pbxproj: Ditto. 26 * bindings/js/JSBindingsAllInOne.cpp: Ditto. 27 * bindings/js/JSDOMBinding.h: MAYBE_MISSING_PARAMETER(exec, index, policy) returns the index-th parameter, if the parameter exists. It returns an undefined value, if the index-th parameter is missing and the policy is MissingIsUndefined. It returns an empty value, otherwise (i.e. if the index-th parameter is missing and the policy is MissingIsEmpty). 28 * bindings/js/JSWebKitCSSMatrixCustom.cpp: Removed. 29 * bindings/scripts/CodeGeneratorJS.pm: 30 (GenerateParametersCheck): Supported [Optional=CallWithNullValue]. 31 (GenerateConstructorDefinition): Supported [Optional=CallWithNullValue]. 32 * css/WebKitCSSMatrix.idl: Removed [JSCustomConstructor]. 33 1 34 2011-10-27 Julien Chaffraix <jchaffraix@webkit.org> 2 35 -
trunk/Source/WebCore/GNUmakefile.list.am
r98656 r98679 857 857 Source/WebCore/bindings/js/JSWebKitCSSKeyframesRuleCustom.cpp \ 858 858 Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp \ 859 Source/WebCore/bindings/js/JSWebKitCSSMatrixCustom.cpp \860 859 Source/WebCore/bindings/js/JSWebKitMutationObserverCustom.cpp \ 861 860 Source/WebCore/bindings/js/JSWebKitPointCustom.cpp \ -
trunk/Source/WebCore/UseJSC.cmake
r98196 r98679 122 122 bindings/js/JSWebKitCSSKeyframeRuleCustom.cpp 123 123 bindings/js/JSWebKitCSSKeyframesRuleCustom.cpp 124 bindings/js/JSWebKitCSSMatrixCustom.cpp125 124 bindings/js/JSWebKitMutationObserverCustom.cpp 126 125 bindings/js/JSWebKitPointCustom.cpp -
trunk/Source/WebCore/WebCore.gypi
r98656 r98679 1947 1947 'bindings/js/JSWebKitCSSKeyframeRuleCustom.cpp', 1948 1948 'bindings/js/JSWebKitCSSKeyframesRuleCustom.cpp', 1949 'bindings/js/JSWebKitCSSMatrixCustom.cpp',1950 1949 'bindings/js/JSWebKitMutationObserverCustom.cpp', 1951 1950 'bindings/js/JSWebKitPointCustom.cpp', -
trunk/Source/WebCore/WebCore.pro
r98656 r98679 345 345 bindings/js/JSWebKitCSSKeyframeRuleCustom.cpp \ 346 346 bindings/js/JSWebKitCSSKeyframesRuleCustom.cpp \ 347 bindings/js/JSWebKitCSSMatrixCustom.cpp \348 347 bindings/js/JSWebKitMutationObserverCustom.cpp \ 349 348 bindings/js/JSWebKitPointCustom.cpp \ -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r98656 r98679 4918 4918 BC274B31140EBED800EADFA6 /* CSSBorderImageSliceValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC274B30140EBED800EADFA6 /* CSSBorderImageSliceValue.cpp */; }; 4919 4919 BC275B7911C5D1C300C9206C /* JSWebKitPointCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC275B7811C5D1C300C9206C /* JSWebKitPointCustom.cpp */; }; 4920 BC275B7D11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC275B7C11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp */; };4921 4920 BC275CB311C5E85C00C9206C /* JSArrayBufferCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC275CB211C5E85C00C9206C /* JSArrayBufferCustom.cpp */; }; 4922 4921 BC2CBF4E140F1ABD003879BE /* JSWebGLContextEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2CBF4B140F1A65003879BE /* JSWebGLContextEvent.h */; }; … … 12142 12141 BC274B30140EBED800EADFA6 /* CSSBorderImageSliceValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSBorderImageSliceValue.cpp; sourceTree = "<group>"; }; 12143 12142 BC275B7811C5D1C300C9206C /* JSWebKitPointCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitPointCustom.cpp; sourceTree = "<group>"; }; 12144 BC275B7C11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitCSSMatrixCustom.cpp; sourceTree = "<group>"; };12145 12143 BC275CB211C5E85C00C9206C /* JSArrayBufferCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSArrayBufferCustom.cpp; sourceTree = "<group>"; }; 12146 12144 BC2CBF4B140F1A65003879BE /* JSWebGLContextEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLContextEvent.h; sourceTree = "<group>"; }; … … 19583 19581 E1AD14C41297354900ACA989 /* JSWebKitCSSKeyframeRuleCustom.cpp */, 19584 19582 E1AD14B4129734CA00ACA989 /* JSWebKitCSSKeyframesRuleCustom.cpp */, 19585 BC275B7C11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp */,19586 19583 C6F0917E143A2BB900685849 /* JSWebKitMutationObserverCustom.cpp */, 19587 19584 BC275B7811C5D1C300C9206C /* JSWebKitPointCustom.cpp */, … … 26422 26419 E1AD14B5129734CA00ACA989 /* JSWebKitCSSKeyframesRuleCustom.cpp in Sources */, 26423 26420 4983913F0F1E767500C23782 /* JSWebKitCSSMatrix.cpp in Sources */, 26424 BC275B7D11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp in Sources */,26425 26421 31611E5A0E1C4DE000F6A579 /* JSWebKitCSSTransformValue.cpp in Sources */, 26426 26422 898785B4122CA2A7003AABDA /* JSWebKitFlags.cpp in Sources */, -
trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
r98238 r98679 149 149 #include "JSWebKitCSSKeyframeRuleCustom.cpp" 150 150 #include "JSWebKitCSSKeyframesRuleCustom.cpp" 151 #include "JSWebKitCSSMatrixCustom.cpp"152 151 #include "JSWebKitPointCustom.cpp" 153 152 #include "JSWebSocketCustom.cpp" -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r97985 r98679 41 41 namespace WebCore { 42 42 43 enum ParameterMissingPolicy { 44 MissingIsUndefined, 45 MissingIsEmpty 46 }; 47 48 #define MAYBE_MISSING_PARAMETER(exec, index, policy) (((policy) == MissingIsEmpty && (index) >= (exec)->argumentCount()) ? (JSValue()) : ((exec)->argument(index))) 49 43 50 class Frame; 44 51 class KURL; -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r98617 r98679 2309 2309 # Optional callbacks should be treated differently, because they always have a default value (0), 2310 2310 # and we can reduce the number of overloaded functions that take a different number of parameters. 2311 # Optional arguments with [Optional=CallWithDefaultValue] should not generate an early call. 2311 # Optional arguments with [Optional=CallWithDefaultValue] or [Optional=CallWithNullValue] 2312 # should not generate an early call. 2312 2313 my $optional = $parameter->extendedAttributes->{"Optional"}; 2313 if ($optional && $optional ne "CallWithDefaultValue" && !$parameter->extendedAttributes->{"Callback"}) {2314 if ($optional && $optional ne "CallWithDefaultValue" && $optional ne "CallWithNullValue" && !$parameter->extendedAttributes->{"Callback"}) { 2314 2315 # Generate early call if there are enough parameters. 2315 2316 if (!$hasOptionalArguments) { … … 2369 2370 } 2370 2371 2371 push(@implContent, " " . GetNativeTypeFromSignature($parameter) . " $name(" . JSValueToNative($parameter, "exec->argument($argsIndex)") . ");\n"); 2372 my $optional = $parameter->extendedAttributes->{"Optional"}; 2373 my $parameterMissingPolicy = "MissingIsUndefined"; 2374 if ($optional && $optional eq "CallWithNullValue") { 2375 $parameterMissingPolicy = "MissingIsEmpty"; 2376 } 2377 2378 push(@$outputArray, " " . GetNativeTypeFromSignature($parameter) . " $name(" . JSValueToNative($parameter, "MAYBE_MISSING_PARAMETER(exec, $argsIndex, $parameterMissingPolicy)") . ");\n"); 2372 2379 2373 2380 # If a parameter is "an index" and it's negative it should throw an INDEX_SIZE_ERR exception. … … 2744 2751 return "valueToStringWithNullCheck(exec, $value)" if $signature->extendedAttributes->{"ConvertNullToNullString"} || $signature->extendedAttributes->{"Reflect"}; 2745 2752 return "valueToStringWithUndefinedOrNullCheck(exec, $value)" if $signature->extendedAttributes->{"ConvertUndefinedOrNullToNullString"}; 2746 return "ustringToString($value. toString(exec))";2753 return "ustringToString($value.isEmpty() ? UString() : $value.toString(exec))"; 2747 2754 } 2748 2755 … … 3278 3285 3279 3286 # For now, we do not support SVG constructors. 3280 # We do not also support a constructor [Optional] argument without CallWithDefaultValue. 3287 # We do not also support a constructor [Optional] argument without CallWithDefaultValue 3288 # nor CallWithNullValue. 3281 3289 my $numParameters = @{$function->parameters}; 3282 3290 my ($dummy, $paramIndex) = GenerateParametersCheck($outputArray, $function, $dataNode, $numParameters, $interfaceName, "constructorCallback", undef, undef, undef); -
trunk/Source/WebCore/css/WebKitCSSMatrix.idl
r96788 r98679 29 29 interface [ 30 30 CanBeConstructed, 31 JSCustomConstructor,32 31 ConstructorParameters=1, 33 32 Constructor(in [Optional=CallWithNullValue] DOMString cssValue),
Note:
See TracChangeset
for help on using the changeset viewer.