Changeset 98379 in webkit
- Timestamp:
- Oct 25, 2011, 12:48:28 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/canvas/canvas-putImageData-expected.txt (modified) (1 diff)
-
LayoutTests/fast/canvas/canvas-putImageData.js (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (modified) (4 diffs)
-
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (modified) (5 diffs)
-
Source/WebCore/html/canvas/CanvasRenderingContext2D.idl (modified) (1 diff)
-
Source/WebCore/page/DOMWindow.idl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r98375 r98379 1 2011-10-25 Pavel Podivilov <podivilov@chromium.org> 2 3 Get rid of optional parameters in the middle in IDLs. 4 https://bugs.webkit.org/show_bug.cgi?id=70816 5 6 Reviewed by Adam Barth. 7 8 Optional parameters in the middle are prohibited by WebIDL spec. 9 10 * fast/canvas/canvas-putImageData-expected.txt: 11 * fast/canvas/canvas-putImageData.js: 12 1 13 2011-10-25 Julien Chaffraix <jchaffraix@webkit.org> 2 14 -
trunk/LayoutTests/fast/canvas/canvas-putImageData-expected.txt
r97566 r98379 145 145 PASS getPixel(1,1) is [0,128,0,255] 146 146 PASS getPixel(9,9) is [0,128,0,255] 147 PASS context.putImageData({}, 0, 0) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.147 PASS context.putImageData({}, 0, 0) threw exception TypeError: Type error. 148 148 PASS context.putImageData(buffer, NaN, 0, 0, 0, 0, 0) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 149 149 PASS context.putImageData(buffer, 0, NaN, 0, 0, 0, 0) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. -
trunk/LayoutTests/fast/canvas/canvas-putImageData.js
r59582 r98379 202 202 203 203 204 shouldThrow("context.putImageData({}, 0, 0)", "' Error: TYPE_MISMATCH_ERR: DOM Exception 17'");204 shouldThrow("context.putImageData({}, 0, 0)", "'TypeError: Type error'"); 205 205 shouldThrow("context.putImageData(buffer, NaN, 0, 0, 0, 0, 0)", "'Error: NOT_SUPPORTED_ERR: DOM Exception 9'"); 206 206 shouldThrow("context.putImageData(buffer, 0, NaN, 0, 0, 0, 0)", "'Error: NOT_SUPPORTED_ERR: DOM Exception 9'"); -
trunk/Source/WebCore/ChangeLog
r98374 r98379 1 2011-10-25 Pavel Podivilov <podivilov@chromium.org> 2 3 Get rid of optional parameters in the middle in IDLs. 4 https://bugs.webkit.org/show_bug.cgi?id=70816 5 6 Reviewed by Adam Barth. 7 8 Optional parameters in the middle are prohibited by WebIDL spec. 9 10 * bindings/scripts/CodeGeneratorJS.pm: 11 (GenerateHeader): 12 (GenerateImplementation): 13 * bindings/scripts/CodeGeneratorV8.pm: 14 (GenerateHeader): 15 (GenerateArgumentsCountCheck): 16 (GenerateImplementation): 17 * html/canvas/CanvasRenderingContext2D.idl: 18 * page/DOMWindow.idl: 19 1 20 2011-10-25 Chris Evans <cevans@google.com> 2 21 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r98261 r98379 911 911 push(@headerContent, "\n // Custom functions\n"); 912 912 foreach my $function (@{$dataNode->functions}) { 913 if ($function->signature->extendedAttributes->{"Custom"} || $function->signature->extendedAttributes->{"JSCCustom"}) {914 my $functionImplementationName = $function->signature->extendedAttributes->{"ImplementationFunction"} || $codeGenerator->WK_lcfirst($function->signature->name);915 push(@headerContent, " JSC::JSValue " . $functionImplementationName . "(JSC::ExecState*);\n");916 }913 next unless $function->signature->extendedAttributes->{"Custom"} or $function->signature->extendedAttributes->{"JSCCustom"}; 914 next if $function->{overloads} && $function->{overloadIndex} != 1; 915 my $functionImplementationName = $function->signature->extendedAttributes->{"ImplementationFunction"} || $codeGenerator->WK_lcfirst($function->signature->name); 916 push(@headerContent, " JSC::JSValue " . $functionImplementationName . "(JSC::ExecState*);\n"); 917 917 } 918 918 } … … 1979 1979 1980 1980 my $functionName = $codeGenerator->WK_lcfirst($className) . "PrototypeFunction" . $codeGenerator->WK_ucfirst($function->signature->name); 1981 1982 if ($function->{overloads} && @{$function->{overloads}} > 1) { 1981 my $isCustom = $function->signature->extendedAttributes->{"Custom"} || $function->signature->extendedAttributes->{"JSCCustom"}; 1982 my $isOverloaded = $function->{overloads} && @{$function->{overloads}} > 1; 1983 1984 next if $isCustom && $isOverloaded && $function->{overloadIndex} > 1; 1985 1986 if (!$isCustom && $isOverloaded) { 1983 1987 # Append a number to an overloaded method's name to make it unique: 1984 1988 $functionName = $functionName . $function->{overloadIndex}; … … 2023 2027 } 2024 2028 2025 if ($ function->signature->extendedAttributes->{"Custom"} || $function->signature->extendedAttributes->{"JSCCustom"}) {2029 if ($isCustom) { 2026 2030 push(@implContent, " return JSValue::encode(castedThis->" . $functionImplementationName . "(exec));\n"); 2027 2031 } else { … … 2060 2064 push(@implContent, "}\n\n"); 2061 2065 2062 if ( $function->{overloads} && @{$function->{overloads}} > 1&& $function->{overloadIndex} == @{$function->{overloads}}) {2066 if (!$isCustom && $isOverloaded && $function->{overloadIndex} == @{$function->{overloads}}) { 2063 2067 # Generate a function dispatching call to the rest of the overloads. 2064 2068 GenerateOverloadedPrototypeFunction($function, $dataNode, $implClassName); -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r98278 r98379 265 265 # EventTarget. 266 266 $codeGenerator->AddMethodsConstantsAndAttributesFromParentClasses($dataNode, \@allParents, 1); 267 $codeGenerator->LinkOverloadedFunctions($dataNode); 267 268 268 269 my $hasDependentLifetime = $dataNode->extendedAttributes->{"V8DependentLifetime"} || $dataNode->extendedAttributes->{"ActiveDOMObject"} || $className =~ /SVG/; … … 372 373 my $attrExt = $function->signature->extendedAttributes; 373 374 374 if ( $attrExt->{"Custom"} || $attrExt->{"V8Custom"}) {375 if (($attrExt->{"Custom"} || $attrExt->{"V8Custom"}) && $function->{overloadIndex} == 1) { 375 376 push(@headerContent, <<END); 376 377 static v8::Handle<v8::Value> ${name}Callback(const v8::Arguments&); … … 1390 1391 $requiresAllArguments = $function->signature->extendedAttributes->{"RequiresAllArguments"} || $requiresAllArgumentsDefault; 1391 1392 if ($requiresAllArguments) { 1392 my $numMandatoryParams = @{$function->parameters}; 1393 foreach my $param (reverse(@{$function->parameters})) { 1393 my $numMandatoryParams = 0; 1394 my $optionalSeen = 0; 1395 foreach my $param (@{$function->parameters}) { 1394 1396 if ($param->extendedAttributes->{"Optional"}) { 1395 $ numMandatoryParams--;1397 $optionalSeen = 1; 1396 1398 } else { 1397 last; 1399 die "An argument must not be declared to be optional unless all subsequent arguments to the operation are also optional." if $optionalSeen; 1400 $numMandatoryParams++; 1398 1401 } 1399 1402 } … … 2003 2006 } 2004 2007 2005 $codeGenerator->LinkOverloadedFunctions($dataNode);2006 2007 2008 my $indexer; 2008 2009 my $namedPropertyGetter; 2009 2010 # Generate methods for functions. 2010 2011 foreach my $function (@{$dataNode->functions}) { 2011 if (!($function->signature->extendedAttributes->{"Custom"} || $function->signature->extendedAttributes->{"V8Custom"})) { 2012 my $isCustom = $function->signature->extendedAttributes->{"Custom"} || $function->signature->extendedAttributes->{"V8Custom"}; 2013 if (!$isCustom) { 2012 2014 GenerateFunctionCallback($function, $dataNode, $implClassName); 2013 2015 if ($function->{overloadIndex} > 1 && $function->{overloadIndex} == @{$function->{overloads}}) { … … 2028 2030 # for different calling context. 2029 2031 if (($dataNode->extendedAttributes->{"CheckDomainSecurity"} || ($interfaceName eq "DOMWindow")) && $function->signature->extendedAttributes->{"DoNotCheckDomainSecurity"}) { 2030 GenerateDomainSafeFunctionGetter($function, $implClassName); 2032 if (!$isCustom || $function->{overloadIndex} == 1) { 2033 GenerateDomainSafeFunctionGetter($function, $implClassName); 2034 } 2031 2035 } 2032 2036 } -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl
r96626 r98379 158 158 CanvasPattern createPattern(in HTMLImageElement image, in [ConvertNullToNullString] DOMString repetitionType) 159 159 raises (DOMException); 160 void putImageData(in ImageData imagedata, in float dx, in float dy, in [Optional] float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight) 160 void putImageData(in ImageData imagedata, in float dx, in float dy) 161 raises(DOMException); 162 void putImageData(in ImageData imagedata, in float dx, in float dy, in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight) 161 163 raises(DOMException); 162 164 ImageData createImageData(in ImageData imagedata) -
trunk/Source/WebCore/page/DOMWindow.idl
r97926 r98379 213 213 // cross-document messaging 214 214 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT 215 [DoNotCheckDomainSecurity, Custom] void postMessage(in SerializedScriptValue message, in [Optional] Array messagePorts, inDOMString targetOrigin)215 [DoNotCheckDomainSecurity, Custom] void postMessage(in SerializedScriptValue message, in DOMString targetOrigin) 216 216 raises(DOMException); 217 [DoNotCheckDomainSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in [Optional] Array transferList, in DOMString targetOrigin) 217 [DoNotCheckDomainSecurity, Custom] void postMessage(in SerializedScriptValue message, in Array messagePorts, in DOMString targetOrigin) 218 raises(DOMException); 219 220 [DoNotCheckDomainSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in DOMString targetOrigin) 221 raises(DOMException); 222 [DoNotCheckDomainSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in Array transferList, in DOMString targetOrigin) 218 223 raises(DOMException); 219 224 #else
Note:
See TracChangeset
for help on using the changeset viewer.