Changeset 53890 in webkit
- Timestamp:
- Jan 26, 2010 8:17:18 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r53886 r53890 1 2010-01-26 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Add Date type support for Objective-C binding. 6 https://bugs.webkit.org/show_bug.cgi?id=32810 7 8 The Date type in IDLs is mapped to NSTimeInterval in Objective-C. 9 10 * bindings/objc/DOMInternal.h: Add kit() and core() for NSTimeInterval. 11 * bindings/scripts/CodeGenerator.pm: Make Date a primitive type. 12 * bindings/scripts/CodeGeneratorJS.pm: Move some code for the CodeGeenrator.pm change. 13 * bindings/scripts/CodeGeneratorObjC.pm: 14 * bindings/scripts/CodeGeneratorV8.pm: Move some code for the CodeGeenrator.pm change. 15 * html/HTMLInputElement.idl: Remove Objective-C exclusion for valueAsDate. 16 1 17 2010-01-26 Dmitry Titov <dimich@chromium.org> 2 18 -
trunk/WebCore/bindings/objc/DOMInternal.h
r48513 r53890 88 88 WebCore::XPathNSResolver* core(DOMNativeXPathNSResolver *); 89 89 #endif // ENABLE(XPATH) 90 91 inline NSTimeInterval kit(double msSinceEpoch) 92 { 93 return msSinceEpoch / 1000.0 - NSTimeIntervalSince1970; 94 } 95 96 inline double core(NSTimeInterval sec) 97 { 98 return sec * 1000.0 + NSTimeIntervalSince1970; 99 } -
trunk/WebCore/bindings/scripts/CodeGenerator.pm
r52373 r53890 44 44 "unsigned long" => 1, "unsigned long long" => 1, 45 45 "float" => 1, "double" => 1, 46 "boolean" => 1, "void" => 1); 46 "boolean" => 1, "void" => 1, 47 "Date" => 1); 47 48 48 49 my %podTypeHash = ("SVGNumber" => 1, "SVGTransform" => 1); -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r53666 r53890 170 170 if ($codeGenerator->IsPrimitiveType($type) or AvoidInclusionOfType($type) 171 171 or $type eq "DOMString" or $type eq "DOMObject" or $type eq "Array") { 172 } elsif ($type eq "Date") {173 $implIncludes{"<runtime/DateInstance.h>"} = 1;174 172 } elsif ($type =~ /SVGPathSeg/) { 175 173 $joinedName = $type; … … 1877 1875 1878 1876 return "jsBoolean($value)" if $type eq "boolean"; 1879 1877 1878 # Need to check Date type before IsPrimitiveType(). 1879 if ($type eq "Date") { 1880 return "jsDateOrNull(exec, $value)"; 1881 } 1880 1882 if ($codeGenerator->IsPrimitiveType($type) or $type eq "SVGPaintType" or $type eq "DOMTimeStamp") { 1881 1883 $implIncludes{"<runtime/JSNumberCell.h>"} = 1; … … 1953 1955 $implIncludes{"$type.h"} = 1; 1954 1956 return "$value->deserialize(exec)"; 1955 } elsif ($type eq "Date") {1956 $implIncludes{"<runtime/DateInstance.h>"} = 1;1957 return "jsDateOrNull(exec, $value)";1958 1957 } else { 1959 1958 # Default, include header with same name. -
trunk/WebCore/bindings/scripts/CodeGeneratorObjC.pm
r53574 r53890 317 317 return "unsigned" if $name eq "unsigned long"; 318 318 return "int" if $name eq "long"; 319 return "NSTimeInterval" if $name eq "Date"; 319 320 return "DOMAbstractView" if $name eq "DOMWindow"; 320 321 return $name if $codeGenerator->IsPrimitiveType($name) or $name eq "DOMImplementation" or $name eq "DOMTimeStamp"; … … 1223 1224 } elsif ($attribute->signature->extendedAttributes->{"ConvertFromString"}) { 1224 1225 $getterContentTail .= ".toInt()"; 1225 } elsif ($codeGenerator->IsPodType($idlType) ) {1226 } elsif ($codeGenerator->IsPodType($idlType) or $idlType eq "Date") { 1226 1227 $getterContentHead = "kit($getterContentHead"; 1227 1228 $getterContentTail .= ")"; … … 1292 1293 unless ($codeGenerator->IsPrimitiveType($idlType) or $codeGenerator->IsStringType($idlType)) { 1293 1294 push(@implContent, " ASSERT($argName);\n\n"); 1295 } 1296 1297 if ($idlType eq "Date") { 1298 $arg = "core(" . $arg . ")"; 1294 1299 } 1295 1300 -
trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm
r53760 r53890 157 157 # When we're finished with the one-file-per-class 158 158 # reorganization, we won't need these special cases. 159 if ($codeGenerator->IsPrimitiveType($type) or AvoidInclusionOfType($type) or $type eq "Date") {159 if ($codeGenerator->IsPrimitiveType($type) or AvoidInclusionOfType($type)) { 160 160 } elsif ($type =~ /SVGPathSeg/) { 161 161 $joinedName = $type; … … 2531 2531 return "return v8::Integer::NewFromUnsigned($value)" if $nativeType eq "unsigned"; 2532 2532 2533 return "return v8DateOrNull($value);" if $type eq "Date"; 2533 2534 return "return v8::Number::New($value)" if $codeGenerator->IsPrimitiveType($type) or $type eq "SVGPaintType"; 2534 2535 … … 2587 2588 } 2588 2589 2589 if ($type eq "Date") {2590 return "return v8DateOrNull($value);";2591 }2592 2593 2590 else { 2594 2591 $implIncludes{"wtf/RefCounted.h"} = 1; -
trunk/WebCore/html/HTMLInputElement.idl
r52921 r53890 58 58 attribute [ConvertNullToNullString] DOMString useMap; 59 59 attribute [ConvertNullToNullString] DOMString value; 60 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT61 // FIXME: Add Date support for Objective-C and COM.62 60 attribute Date valueAsDate setter raises(DOMException); 63 #endif64 61 #if defined(ENABLE_DATALIST) && ENABLE_DATALIST 65 62 readonly attribute HTMLOptionElement selectedOption;
Note: See TracChangeset
for help on using the changeset viewer.