<?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>78339</bug_id>
          
          <creation_ts>2012-02-10 01:52:08 -0800</creation_ts>
          <short_desc>[GTK] KURL::fileSystemPath() doesn&apos;t work if uri contains #</short_desc>
          <delta_ts>2012-02-10 03:51:24 -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>528+ (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="Carlos Garcia Campos">cgarcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>gustavo</cc>
    
    <cc>pnormand</cc>
    
    <cc>xan.lopez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>553950</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-02-10 01:52:08 -0800</bug_when>
    <thetext>The problem is that  KURL::fileSystemPath() uses g_filename_from_uri() to convert the uri to a local path. g_filename_from_uri() doesn&apos;t allow uris containing #, returning NULL in that case with a G_CONVERT_ERROR_BAD_URI error. 

In WebKit2, when html has been loaded from a string with loadHTML(), all relative paths must be relative to the baseURL passed to loadHTML(). To check whether a relative path is in the same directory than the baseURL, both are converted to local path. If the relative path contains a # KURL::fileSystemPath() returns an empty String and the condition is always false, making the web process to terminate. 

The solution is using GFile instead of g_filename_from_uri(), since GFile removes the anchor from the uri when converting the uri to a local path.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>553952</commentid>
    <comment_count>1</comment_count>
      <attachid>126477</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-02-10 01:56:21 -0800</bug_when>
    <thetext>Created attachment 126477
Patch

Implementation with GFile is also bit cleaner and simpler.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>553995</commentid>
    <comment_count>2</comment_count>
      <attachid>126477</attachid>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2012-02-10 03:42:10 -0800</bug_when>
    <thetext>Comment on attachment 126477
Patch

Looks good!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>554004</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-02-10 03:51:24 -0800</bug_when>
    <thetext>Committed r107395: &lt;http://trac.webkit.org/changeset/107395&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>126477</attachid>
            <date>2012-02-10 01:56:21 -0800</date>
            <delta_ts>2012-02-10 03:42:10 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>wk-kurl-filesystem-path.diff</filename>
            <type>text/plain</type>
            <size>1706</size>
            <attacher name="Carlos Garcia Campos">cgarcia</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCBkMjk3OGNjLi4yNjhiMWY4IDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTYg
QEAKKzIwMTItMDItMTAgIENhcmx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rL0tVUkxHdGsuY3BwCkBAIC0yMCw2ICsyMCw5IEBACiAjaW5jbHVkZSAiS1VS
TC5oIgogCiAjaW5jbHVkZSAiRmlsZVN5c3RlbS5oIgorI2luY2x1ZGUgPGdpby9naW8uaD4KKyNp
bmNsdWRlIDx3dGYvZ29iamVjdC9HT3duUHRyLmg+CisjaW5jbHVkZSA8d3RmL2dvYmplY3QvR1Jl
ZlB0ci5oPgogI2luY2x1ZGUgPHd0Zi90ZXh0L0NTdHJpbmcuaD4KIAogI2luY2x1ZGUgPGdsaWIu
aD4KQEAgLTI4LDEzICszMSw5IEBAIG5hbWVzcGFjZSBXZWJDb3JlIHsKIAogU3RyaW5nIEtVUkw6
OmZpbGVTeXN0ZW1QYXRoKCkgY29uc3QKIHsKLSAgICBnY2hhciogZmlsZW5hbWUgPSBnX2ZpbGVu
YW1lX2Zyb21fdXJpKG1fc3RyaW5nLnV0ZjgoKS5kYXRhKCksIDAsIDApOwotICAgIGlmICghZmls
ZW5hbWUpCi0gICAgICAgIHJldHVybiBTdHJpbmcoKTsKLQotICAgIFN0cmluZyBwYXRoID0gZmls
ZW5hbWVUb1N0cmluZyhmaWxlbmFtZSk7Ci0gICAgZ19mcmVlKGZpbGVuYW1lKTsKLSAgICByZXR1
cm4gcGF0aDsKKyAgICBHUmVmUHRyPEdGaWxlPiBmaWxlID0gYWRvcHRHUmVmKGdfZmlsZV9uZXdf
Zm9yX3VyaShtX3N0cmluZy51dGY4KCkuZGF0YSgpKSk7CisgICAgR093blB0cjxjaGFyPiBmaWxl
bmFtZShnX2ZpbGVfZ2V0X3BhdGgoZmlsZS5nZXQoKSkpOworICAgIHJldHVybiBmaWxlbmFtZVRv
U3RyaW5nKGZpbGVuYW1lLmdldCgpKTsKIH0KIAogfSAvLyBuYW1lc3BhY2UgV2ViQ29yZQo=
</data>
<flag name="review"
          id="128302"
          type_id="1"
          status="+"
          setter="pnormand"
    />
          </attachment>
      

    </bug>

</bugzilla>