[Webkit-unassigned] [Bug 42484] Support localized numbers in <input type=number>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 29 08:04:43 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=42484

Jari <jarilittlenen at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jarilittlenen at yahoo.com

--- Comment #26 from Jari <jarilittlenen at yahoo.com> ---
(In reply to Alexey Proskuryakov from comment #18)
> > Source/WebCore/platform/text/mac/LocalizedNumberMac.mm:58
> > +    NSNumberFormatter* formatter = [[[NSNumberFormatter alloc] init] autorelease];
> 
> Although autorelease works, we prefer explicit refcounting in WebCore. So,
> this should be:
> 
> RetainPtr<NSNumberFormatter> formatter(AdoptNS, [[NSNumberFormatter alloc]
> init]);
> 
> +    NSNumber* num = [formatter numberFromString:numberString];
> 
> Please don't abbreviate.
> 
> +    if (num == nil)
> 
> WebKit style is to not compare to zero, so this should just be "if (!num)"
> (with a better name http://www.jopspeech.com/ for num).
> 
> +    NSNumber* num = [NSNumber numberWithDouble:number];
> 
> WebKit style is to put stars on the other side for Objective-C types. But it
> would be better to use alloc/init and RetainPtr here, too. The reasons I
> know of are:
> 1) It's faster to destroy temporaries right away, while they are in memory
> cache.
> 2) The autorelease pool won't be drained during micro-benchmarks that spin
> without returning to message loop, causing high memory usage.


Thank you Alexey

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211029/c96f6f3d/attachment-0001.htm>


More information about the webkit-unassigned mailing list