<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>194272</bug_id>
          
          <creation_ts>2019-02-04 19:48:00 -0800</creation_ts>
          <short_desc>URLHelpers should use unorm2_quickCheck before converting to NFC</short_desc>
          <delta_ts>2019-03-04 07:18:50 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>ap</cc>
    
    <cc>benjamin</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>cdumez</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>dbates</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1502227</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-02-04 19:48:00 -0800</bug_when>
    <thetext>Bug #174816 turned gargantuan so I&apos;ll use a new bug to address these follow-ups:

&gt; Any tests we&apos;re adding to the cross-platform test should be removed from the
&gt; platform-specific test. Ideally the entire test would become cross-platform,
&gt; but I see that would require a bit more work and we&apos;re just days away from
&gt; API freeze, so I understand if that can&apos;t happen now.
&gt; 
&gt; This is minor, but Darin did request that we not use
&gt; charactersWithNullTermination if we are just going to cut off the null
&gt; termination right away. His suggested idiom was:
&gt; 
&gt; auto characters = StringView { string }.upconvertedCharacters();
&gt; 
&gt; Were there any troubles with that?
&gt; 
&gt; Then the unorm2_quickCheck should be one extra function call towards the top
&gt; of toNormalizationFormC(), just to avoid calling unorm2_normalize() if it&apos;s
&gt; not really needed. That could be done in a follow-up, of course, but it
&gt; seems easy?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1507961</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-02-19 18:55:23 -0800</bug_when>
    <thetext>Might be able to share code with FontCairoHarfbuzzNG.cpp.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1509412</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-02-23 16:34:20 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #0)
&gt; &gt; This is minor, but Darin did request that we not use
&gt; &gt; charactersWithNullTermination if we are just going to cut off the null
&gt; &gt; termination right away. His suggested idiom was:
&gt; &gt; 
&gt; &gt; auto characters = StringView { string }.upconvertedCharacters();
&gt; &gt; 
&gt; &gt; Were there any troubles with that?

Not happy with the gymnastics required to keep length separately:

    auto characters = StringView { string }.upconvertedCharacters();
    const UChar* sourceBuffer = characters.get();
    auto length = string.length();

The code is more clear when we just have a Vector&lt;UChar&gt;, like currently.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1509413</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-02-23 16:34:50 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #1)
&gt; Might be able to share code with FontCairoHarfbuzzNG.cpp.

It&apos;s used in so many other places. That should be left for a different bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1509414</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-02-23 16:45:13 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #0)
&gt; Bug #174816 turned gargantuan so I&apos;ll use a new bug to address these
&gt; follow-ups:
&gt; 
&gt; &gt; Any tests we&apos;re adding to the cross-platform test should be removed from the
&gt; &gt; platform-specific test. Ideally the entire test would become cross-platform,
&gt; &gt; but I see that would require a bit more work and we&apos;re just days away from
&gt; &gt; API freeze, so I understand if that can&apos;t happen now

I&apos;m going to punt on this too since the Cocoa test relies on some APIs that we don&apos;t plan to make cross-platform.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1509415</commentid>
    <comment_count>5</comment_count>
      <attachid>362841</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-02-23 16:56:13 -0800</bug_when>
    <thetext>Created attachment 362841
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1511924</commentid>
    <comment_count>6</comment_count>
      <attachid>362841</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2019-03-03 00:37:32 -0800</bug_when>
    <thetext>Comment on attachment 362841
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=362841&amp;action=review

This seems OK as is, but I think there is room for improvement.

&gt; Source/WTF/wtf/URLHelpers.cpp:778
&gt; -    auto sourceBuffer = string.charactersWithNullTermination();
&gt; +    Vector&lt;UChar&gt; sourceBuffer = string.charactersWithNullTermination();

I guess you don’t like auto in a case like this. I do; keeps the code less wordy.

I don’t understand why we need the null termination. I think unorm2_quickCheck can work on characters in place; charactersWithNullTermination is an expensive operation that should be avoided if possible.

&gt; Source/WTF/wtf/URLHelpers.cpp:783
&gt; +    const UNormalizer2* normalizer = unorm2_getNFCInstance(&amp;uerror);

I prefer auto to writing out const UNormalizer2*, but I suppose tastes differ.

&gt; Source/WTF/wtf/URLHelpers.cpp:787
&gt; +    UNormalizationCheckResult checkResult = unorm2_quickCheck(normalizer, sourceBuffer.data(), sourceBuffer.size(), &amp;uerror);

I prefer auto to writing out UNormalizationCheckResult, but I suppose tastes differ.

&gt; Source/WTF/wtf/URLHelpers.cpp:793
&gt; +        return String(sourceBuffer.data(), sourceBuffer.size());

Better performance if this does:

    return string;

Then we share the StringImpl instead of allocating a new one with the same characters in it.

&gt; Source/WTF/wtf/URLHelpers.cpp:798
&gt; +    uerror = U_ZERO_ERROR;

Is this needed? If there was an error, we would have returned, I think.

&gt; Source/WTF/wtf/URLHelpers.cpp:799
&gt; +    if (U_SUCCESS(uerror)) {

This is strange. It checks the value of something we set the line before. I think we instead want to remove this if statement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1511925</commentid>
    <comment_count>7</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2019-03-03 00:39:33 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #2)
&gt; Not happy with the gymnastics required to keep length separately:
&gt; 
&gt;     auto characters = StringView { string }.upconvertedCharacters();
&gt;     const UChar* sourceBuffer = characters.get();
&gt;     auto length = string.length();
&gt; 
&gt; The code is more clear when we just have a Vector&lt;UChar&gt;, like currently.

I’ll come back and do the optimization. Because that clarity comes at a real cost. The upconvertedCharacters() function is free when the string already is stored as UChar, whereas the Vector thing means copying all the characters into a newly allocated memory buffer!

Might also want a fast case for LChar strings to avoid upconverting them.

All depends on how often this function is used. A high quality implementation for extensive re-use should probably eventually have these optimizations.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1511951</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-03-03 11:25:21 -0800</bug_when>
    <thetext>(In reply to Darin Adler from comment #6)
&gt; &gt; Source/WTF/wtf/URLHelpers.cpp:778
&gt; &gt; -    auto sourceBuffer = string.charactersWithNullTermination();
&gt; &gt; +    Vector&lt;UChar&gt; sourceBuffer = string.charactersWithNullTermination();
&gt; 
&gt; I guess you don’t like auto in a case like this. I do; keeps the code less
&gt; wordy.

I think we don&apos;t have guidelines on this. My rule of thumb is: is the code easier to read with auto? Less-wordy code is usually easier to read, but sometimes it&apos;s more important to be able to see the type at a glance without having to open WTFString.h and search for &quot;charactersWithNullTermination,&quot; which is what I probably had to do here to figure out what type I was working with. It&apos;s important that this is a Vector and that it&apos;s a vector of UChar, not a char* or whatever. So I usually find myself using auto more for (a) integer types, (b) really long types, or (c) when the type is obvious, e.g. when there is a cast on the rhs of an assignment.

&gt; I don’t understand why we need the null termination. I think
&gt; unorm2_quickCheck can work on characters in place;
&gt; charactersWithNullTermination is an expensive operation that should be
&gt; avoided if possible.

We don&apos;t need the null termination. String just doesn&apos;t provide a function to get a Vector&lt;UChar&gt; without the null termination.

&gt; &gt; Source/WTF/wtf/URLHelpers.cpp:783
&gt; &gt; +    const UNormalizer2* normalizer = unorm2_getNFCInstance(&amp;uerror);
&gt; 
&gt; I prefer auto to writing out const UNormalizer2*, but I suppose tastes
&gt; differ.

I wish we had stronger guidelines so I didn&apos;t have to think about this whenever declaring variables. Here, I could go either way. You&apos;re probably not going to be able to modify this code without looking at the ICU API reference, so having the type written out seems much less important here than in the example above. But I don&apos;t see much advantage of using auto here, either. I think we normally also write out const auto* in WebKit to avoid hiding those modifiers, even though they&apos;re not necessary. (Especially the * is important for readability.)

&gt; &gt; Source/WTF/wtf/URLHelpers.cpp:793
&gt; &gt; +        return String(sourceBuffer.data(), sourceBuffer.size());
&gt; 
&gt; Better performance if this does:
&gt; 
&gt;     return string;
&gt; 
&gt; Then we share the StringImpl instead of allocating a new one with the same
&gt; characters in it.

Oh, right. Let me fix this....

&gt; &gt; Source/WTF/wtf/URLHelpers.cpp:798
&gt; &gt; +    uerror = U_ZERO_ERROR;
&gt; 
&gt; Is this needed? If there was an error, we would have returned, I think.
&gt; 
&gt; &gt; Source/WTF/wtf/URLHelpers.cpp:799
&gt; &gt; +    if (U_SUCCESS(uerror)) {
&gt; 
&gt; This is strange. It checks the value of something we set the line before. I
&gt; think we instead want to remove this if statement.

That&apos;s just a refactoring bug. Oops. Will fix this too.

I&apos;ll let you handle optimizing it by using upconvertedCharacters(), and convert to auto if you wish.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1511957</commentid>
    <comment_count>9</comment_count>
      <attachid>363462</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-03-03 11:45:50 -0800</bug_when>
    <thetext>Created attachment 363462
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1511959</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-03-03 11:46:36 -0800</bug_when>
    <thetext>And I removed the inadvertently-committed test file in r242329. I wish I had more time to work on making the URLExtras.mm test cross-platform, but I don&apos;t right now, sorry.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1511966</commentid>
    <comment_count>11</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2019-03-03 11:59:46 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #8)
&gt; I&apos;ll let you handle optimizing it by using upconvertedCharacters()

Might do that. Especially if we add enough tests that it’s easy for me to know I didn’t break it.

&gt; and convert to auto

Definitely won’t do that!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1512147</commentid>
    <comment_count>12</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-03-04 06:53:23 -0800</bug_when>
    <thetext>There are already tons of tests in URLExtras.mm, I just wish they were cross-platform. :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1512153</commentid>
    <comment_count>13</comment_count>
      <attachid>363462</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-03-04 07:18:48 -0800</bug_when>
    <thetext>Comment on attachment 363462
Patch

Clearing flags on attachment: 363462

Committed r242353: &lt;https://trac.webkit.org/changeset/242353&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1512154</commentid>
    <comment_count>14</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-03-04 07:18:50 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>362841</attachid>
            <date>2019-02-23 16:56:13 -0800</date>
            <delta_ts>2019-03-03 11:45:48 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-194272-20190223185613.patch</filename>
            <type>text/plain</type>
            <size>2863</size>
            <attacher name="Michael Catanzaro">mcatanzaro</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjQxOTk1CmRpZmYgLS1naXQgYS9Tb3VyY2UvV1RGL0NoYW5n
ZUxvZyBiL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCmluZGV4IDZiM2MzMzM3MjE4MGVmZDgxNmM4YzY3
MGFiOWQzNjBlMGJlYzcwMDkuLmNhNjVmZGRlZDVhODZlNjgyYWNlMWE5ZGY5ZTc5YjQ2OGNmYmI4
YjkgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9XVEYvQ2hh
bmdlTG9nCkBAIC0xLDMgKzEsMTUgQEAKKzIwMTktMDItMjMgIE1pY2hhZWwgQ2F0YW56YXJvICA8
bWNhdGFuemFyb0BpZ2FsaWEuY29tPgorCisgICAgICAgIFVSTEhlbHBlcnMgc2hvdWxkIHVzZSB1
bm9ybTJfcXVpY2tDaGVjayBiZWZvcmUgY29udmVydGluZyB0byBORkMKKyAgICAgICAgaHR0cHM6
Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTE5NDI3MgorCisgICAgICAgIFJldmll
d2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIElmIHRoZSBzdHJpbmcgaXMgYWxyZWFk
eSBpbiBub3JtYW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nZXRORkNJbnN0YW5jZSgmdWVycm9yKTsKLSAgICBpZiAoIVVfRkFJTFVSRSh1ZXJyb3Ip
KSB7CisgICAgdWVycm9yID0gVV9aRVJPX0VSUk9SOworICAgIGlmIChVX1NVQ0NFU1ModWVycm9y
KSkgewogICAgICAgICBub3JtYWxpemVkTGVuZ3RoID0gdW5vcm0yX25vcm1hbGl6ZShub3JtYWxp
emVyLCBzb3VyY2VCdWZmZXIuZGF0YSgpLCBzb3VyY2VCdWZmZXIuc2l6ZSgpLCBub3JtYWxpemVk
Q2hhcmFjdGVycy5kYXRhKCksIG5vcm1hbGl6ZWRDaGFyYWN0ZXJzLnNpemUoKSwgJnVlcnJvcik7
CiAgICAgICAgIGlmICh1ZXJyb3IgPT0gVV9CVUZGRVJfT1ZFUkZMT1dfRVJST1IpIHsKICAgICAg
ICAgICAgIHVlcnJvciA9IFVfWkVST19FUlJPUjsKICAgICAgICAgICAgIG5vcm1hbGl6ZWRDaGFy
YWN0ZXJzLnJlc2l6ZShub3JtYWxpemVkTGVuZ3RoKTsKICAgICAgICAgICAgIG5vcm1hbGl6ZWRM
ZW5ndGggPSB1bm9ybTJfbm9ybWFsaXplKG5vcm1hbGl6ZXIsIHNvdXJjZUJ1ZmZlci5kYXRhKCks
IHNvdXJjZUJ1ZmZlci5zaXplKCksIG5vcm1hbGl6ZWRDaGFyYWN0ZXJzLmRhdGEoKSwgbm9ybWFs
aXplZExlbmd0aCwgJnVlcnJvcik7CiAgICAgICAgIH0KLSAgICAgICAgaWYgKCFVX0ZBSUxVUkUo
dWVycm9yKSkKKyAgICAgICAgaWYgKFVfU1VDQ0VTUyh1ZXJyb3IpKQogICAgICAgICAgICAgcmVz
dWx0ID0gU3RyaW5nKG5vcm1hbGl6ZWRDaGFyYWN0ZXJzLmRhdGEoKSwgbm9ybWFsaXplZExlbmd0
aCk7CiAgICAgfQogCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>363462</attachid>
            <date>2019-03-03 11:45:50 -0800</date>
            <delta_ts>2019-03-04 07:18:48 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-194272-20190303134549.patch</filename>
            <type>text/plain</type>
            <size>3371</size>
            <attacher name="Michael Catanzaro">mcatanzaro</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjQyMzI5CmRpZmYgLS1naXQgYS9Tb3VyY2UvV1RGL0NoYW5n
ZUxvZyBiL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCmluZGV4IGIzMWEzYjdkMWFlYTMxOGQ0MzE1ZDJm
YTRhNTEzOGIzNzZjMzQ5ZTQuLjEwODMzNjNjMzZmMGVhZTIzN2Q4MTExNTgyZWIxMjJhNzk5OGZk
MDYgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9XVEYvQ2hh
bmdlTG9nCkBAIC0xLDMgKzEsMTUgQEAKKzIwMTktMDMtMDMgIE1pY2hhZWwgQ2F0YW56YXJvICA8
bWNhdGFuemFyb0BpZ2FsaWEuY29tPgorCisgICAgICAgIFVSTEhlbHBlcnMgc2hvdWxkIHVzZSB1
bm9ybTJfcXVpY2tDaGVjayBiZWZvcmUgY29udmVydGluZyB0byBORkMKKyAgICAgICAgaHR0cHM6
Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTE5NDI3MgorCisgICAgICAgIFJldmll
d2VkIGJ5IERhcmluIEFkbGVyLgorCisgICAgICAgIElmIHRoZSBzdHJpbmcgaXMgYWxyZWFkeSBp
biBub3JtYWxpemF0aW9uIGZvcm0gQywgZG9uJ3QgdHJ5IHRvIG5vcm1hbGl6ZSBpdC4KKworICAg
ICAgICAqIHd0Zi9VUkxIZWxwZXJzLmNwcDoKKyAgICAgICAgKFdURjo6VVJMSGVscGVyczo6dG9O
b3JtYWxpemF0aW9uRm9ybUMpOgorCiAyMDE5LTAyLTI3ICBEYXJpbi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SB1bm9ybTJfbm9ybWFsaXplKG5vcm1hbGl6ZXIs
IHNvdXJjZUJ1ZmZlci5kYXRhKCksIHNvdXJjZUJ1ZmZlci5zaXplKCksIG5vcm1hbGl6ZWRDaGFy
YWN0ZXJzLmRhdGEoKSwgbm9ybWFsaXplZExlbmd0aCwgJnVlcnJvcik7CiAgICAgfQorICAgIGlm
IChVX0ZBSUxVUkUodWVycm9yKSkKKyAgICAgICAgcmV0dXJuIHsgfTsKIAotICAgIHJldHVybiBy
ZXN1bHQ7CisgICAgcmV0dXJuIFN0cmluZyhub3JtYWxpemVkQ2hhcmFjdGVycy5kYXRhKCksIG5v
cm1hbGl6ZWRMZW5ndGgpOwogfQogCiBTdHJpbmcgdXNlclZpc2libGVVUkwoY29uc3QgQ1N0cmlu
ZyYgdXJsKQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>