[Webkit-unassigned] [Bug 174816] [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jan 27 04:14:01 PST 2018


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

--- Comment #50 from Gabriel Ivașcu <givascu at igalia.com> ---
(In reply to Alex Christensen from comment #49)
> Comment on attachment 331840 [details]

> > Source/WebCore/platform/URLParser.h:56
> > +    template<typename CharacterType> static bool isLookalikeCharacter(CharacterType, CharacterType anotherCharacter);
> > +    static String ICUConvertHostName(const String& hostName, bool encode, const uint32_t (&IDNScriptBlackList)[(USCRIPT_CODE_LIMIT + 31) / 32] = { 0 });
> 
> I'm not against moving this from a .mm to a sharable location, but the
> URLParser is an implementation of https://url.spec.whatwg.org so let's make
> a new class for this.

Hmm OK but that will make a class with only two static methods.

> > Source/WebCore/platform/mac/WebCoreNSURLExtras.mm:48
> > -static uint32_t IDNScriptWhiteList[(USCRIPT_CODE_LIMIT + 31) / 32];
> > +static uint32_t IDNScriptBlackList[(USCRIPT_CODE_LIMIT + 31) / 32];
> 
> Why are you making this change?  Let's not change the functionality of the
> ObjC code.

I changed this so that callers that don't use script white/black lists wouldn't have to create explicitly a whitelist with all bits set to one to pass to the function. This way, they would leave the function's default blacklist's value of all zeros, i.e. all scripts are allowed. I can change it back however.

> > Source/WebCore/platform/mac/WebCoreNSURLExtras.mm:639
> > -    std::optional<UChar32> previousCodePoint;
> > +    UChar32 previousCodePoint = INT32_MAX;
> 
> This doesn't look good.  We should use std::optional instead of having a
> sentinel value.  Also, there's a signed/unsigned mismatch, but we shouldn't
> do this anyway.

OK. But UChar32 is defined as int32_t in WTF/icu/unicode/umachine.h.

-- 
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/20180127/59826e0e/attachment.html>


More information about the webkit-unassigned mailing list