Like Bug#32698 for JavaScriptCore, we need to support Date type binding for Objective-C DOM binding.
Created attachment 45365 [details] Proposed patch This patch is similar to patches in Bug#32698 and Bug#32699.
style-queue ran check-webkit-style on attachment 45365 [details] without any errors.
Generated code will be: - (double)valueAsDate { return IMPL->valueAsDate(); } - (void)setValueAsDate:(double)newValueAsDate { WebCore::ExceptionCode ec = 0; IMPL->setValueAsDate(newValueAsDate, ec); WebCore::raiseOnDOMError(ec); }
Created attachment 45369 [details] Proposed patch (rev.2) - Remove #ifdef !LANGUAGE_COM. COM binding support was removed.
style-queue ran check-webkit-style on attachment 45369 [details] without any errors.
Comment on attachment 45369 [details] Proposed patch (rev.2) The type should be NSAbsoluteTime, not double.
Comment on attachment 45369 [details] Proposed patch (rev.2) WOuld making IsPrimitiveType return true for Date give you more of the code paths you need with out $idlType eq "Date"? Or is IsPrimitiveType used other places we don't want for Date? Could those be specialcased for Date? Seems fine though…
Comment on attachment 45369 [details] Proposed patch (rev.2) Darin is right, this should be NSAbsoluteTime.
I do think this can be done without adding "Date" in so many different places. Maybe we can claim it's a primitive type.
(In reply to comment #6) > The type should be NSAbsoluteTime, not double. Would you give me information about NSAbsoluteTime please? I couldn't find it in header files and references.
(In reply to comment #10) > Would you give me information about NSAbsoluteTime please? > I couldn't find it in header files and references. Oops, sorry. It's NSTimeInterval (from NSDate.h). There should be an NSAbsoluteTime, but there is not!
(In reply to comment #11) > Oops, sorry. It's NSTimeInterval (from NSDate.h). There should be an > NSAbsoluteTime, but there is not! But also, dates inside WebKit are in seconds from a base of 1970, whereas in AppKit they have a base of 2001. So we will need to correct by kCFAbsoluteTimeIntervalSince1970 as we do in CurrentTime.cpp.
(In reply to comment #11) > (In reply to comment #10) > > Would you give me information about NSAbsoluteTime please? > > I couldn't find it in header files and references. > > Oops, sorry. It's NSTimeInterval (from NSDate.h). There should be an > NSAbsoluteTime, but there is not! There is CFAbsoluteTime, documented with an epoch of 2001. But I think NSTimeInterval is better to use since we are not a CF API.
Created attachment 45464 [details] Proposed patch (rev.3) - Map Date to NSTimeInterval - Introduce functions to convert double from/to NSTimeInterval. - Make Date a primitive type
style-queue ran check-webkit-style on attachment 45464 [details] without any errors.
Comment on attachment 45464 [details] Proposed patch (rev.3) Looks good to me.
Committed r53890: <http://trac.webkit.org/changeset/53890>