Changeset 200037 in webkit
- Timestamp:
- Apr 25, 2016 11:38:56 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r200036 r200037 1 2016-04-25 Chris Dumez <cdumez@apple.com> 2 3 [Web IDL] Specify default values for parameters of type 'unsigned short' 4 https://bugs.webkit.org/show_bug.cgi?id=156967 5 6 Reviewed by Darin Adler. 7 8 Specify default values for parameters of type 'unsigned short' and let 9 the bindings generator use WTF::Optional<> for the ones without a 10 default value. 11 12 * bindings/scripts/CodeGeneratorJS.pm: 13 (CanUseWTFOptionalForParameter): 14 (GenerateParametersCheck): 15 * testing/Internals.cpp: 16 (WebCore::Internals::layerTreeAsText): Deleted. 17 (WebCore::Internals::displayListForElement): Deleted. 18 (WebCore::Internals::replayDisplayListForElement): Deleted. 19 * testing/Internals.h: 20 * testing/Internals.idl: 21 1 22 2016-04-25 Per Arne Vollan <peavo@outlook.com> 2 23 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r199976 r200037 3371 3371 } 3372 3372 3373 sub CanUseWTFOptionalForParameterType 3374 { 3375 my $type = shift; 3373 sub CanUseWTFOptionalForParameter 3374 { 3375 my $parameter = shift; 3376 my $type = $parameter->type; 3376 3377 3377 3378 # FIXME: We should progressively stop blacklisting each type below 3378 3379 # and eventually get rid of this function entirely. 3380 return 0 if $parameter->extendedAttributes->{"Clamp"}; 3381 return 0 if $parameter->isVariadic; 3382 return 0 if $codeGenerator->IsCallbackInterface($type); 3379 3383 return 0 if $codeGenerator->IsEnumType($type); 3380 3384 return 0 if $codeGenerator->IsTypedArrayType($type); … … 3388 3392 return 0 if $type eq "unrestricted double"; 3389 3393 return 0 if $type eq "unsigned long"; 3390 return 0 if $type eq "unsigned short";3391 3394 3392 3395 return 1; … … 3442 3445 # Optional Dictionary arguments always considered to have default of empty dictionary. 3443 3446 my $optional = $parameter->isOptional; 3444 if ($optional && !defined($parameter->default) && !CanUseWTFOptionalForParameter Type($parameter->type) && $argType ne "Dictionary" && !$codeGenerator->IsCallbackInterface($argType)) {3447 if ($optional && !defined($parameter->default) && !CanUseWTFOptionalForParameter($parameter) && $argType ne "Dictionary" && !$codeGenerator->IsCallbackInterface($argType)) { 3445 3448 # Generate early call if there are enough parameters. 3446 3449 if (!$hasOptionalArguments) { … … 3622 3625 $outer = "state->argument($argsIndex).isUndefined() ? $defaultValue : "; 3623 3626 $inner = "state->uncheckedArgument($argsIndex)"; 3624 } elsif ($optional && !defined($parameter->default) && CanUseWTFOptionalForParameter Type($parameter->type)) {3627 } elsif ($optional && !defined($parameter->default) && CanUseWTFOptionalForParameter($parameter)) { 3625 3628 # Use WTF::Optional<>() for optional parameters that are missing or undefined and that do not have 3626 3629 # a default value in the IDL. -
trunk/Source/WebCore/testing/Internals.cpp
r199798 r200037 1827 1827 // different document, and could just make the call through another Internals 1828 1828 // instance instead. 1829 String Internals::layerTreeAsText(Document& document, ExceptionCode& ec) const 1830 { 1831 return layerTreeAsText(document, 0, ec); 1832 } 1833 1834 String Internals::layerTreeAsText(Document& document, unsigned flags, ExceptionCode& ec) const 1829 String Internals::layerTreeAsText(Document& document, unsigned short flags, ExceptionCode& ec) const 1835 1830 { 1836 1831 if (!document.frame()) { … … 1974 1969 } 1975 1970 1976 String Internals::displayListForElement(Element& element, ExceptionCode& ec) 1977 { 1978 return displayListForElement(element, 0, ec); 1979 } 1980 1981 String Internals::displayListForElement(Element& element, unsigned flags, ExceptionCode& ec) 1971 String Internals::displayListForElement(Element& element, unsigned short flags, ExceptionCode& ec) 1982 1972 { 1983 1973 Document* document = contextDocument(); … … 2013 2003 } 2014 2004 2015 String Internals::replayDisplayListForElement(Element& element, ExceptionCode& ec) 2016 { 2017 return replayDisplayListForElement(element, 0, ec); 2018 } 2019 2020 String Internals::replayDisplayListForElement(Element& element, unsigned flags, ExceptionCode& ec) 2005 String Internals::replayDisplayListForElement(Element& element, unsigned short flags, ExceptionCode& ec) 2021 2006 { 2022 2007 Document* document = contextDocument(); -
trunk/Source/WebCore/testing/Internals.h
r199650 r200037 244 244 LAYER_TREE_INCLUDES_CONTENT_LAYERS = 16 245 245 }; 246 String layerTreeAsText(Document&, unsigned flags, ExceptionCode&) const; 247 String layerTreeAsText(Document&, ExceptionCode&) const; 246 String layerTreeAsText(Document&, unsigned short flags, ExceptionCode&) const; 248 247 String repaintRectsAsText(ExceptionCode&) const; 249 248 String scrollingStateTreeAsText(ExceptionCode&) const; … … 258 257 DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1, 259 258 }; 260 String displayListForElement(Element&, unsigned flags, ExceptionCode&); 261 String displayListForElement(Element&, ExceptionCode&); 262 263 String replayDisplayListForElement(Element&, unsigned flags, ExceptionCode&); 264 String replayDisplayListForElement(Element&, ExceptionCode&); 259 String displayListForElement(Element&, unsigned short flags, ExceptionCode&); 260 261 String replayDisplayListForElement(Element&, unsigned short flags, ExceptionCode&); 265 262 266 263 void garbageCollectDocumentResources(ExceptionCode&) const; -
trunk/Source/WebCore/testing/Internals.idl
r199650 r200037 227 227 const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 8; 228 228 const unsigned short LAYER_TREE_INCLUDES_CONTENT_LAYERS = 16; 229 [RaisesException] DOMString layerTreeAsText(Document document, optional unsigned short flags );229 [RaisesException] DOMString layerTreeAsText(Document document, optional unsigned short flags = 0); 230 230 231 231 [RaisesException] DOMString scrollingStateTreeAsText(); … … 242 242 const unsigned short DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1; 243 243 // Returns the recorded display list. 244 [RaisesException] DOMString displayListForElement(Element element, optional unsigned short flags );244 [RaisesException] DOMString displayListForElement(Element element, optional unsigned short flags = 0); 245 245 // Returns the display list that was actually painted. 246 [RaisesException] DOMString replayDisplayListForElement(Element element, optional unsigned short flags );246 [RaisesException] DOMString replayDisplayListForElement(Element element, optional unsigned short flags = 0); 247 247 248 248 [RaisesException] void garbageCollectDocumentResources();
Note: See TracChangeset
for help on using the changeset viewer.