<?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>75469</bug_id>
          
          <creation_ts>2012-01-03 05:32:56 -0800</creation_ts>
          <short_desc>Clear localStorage before making assumption about its contents</short_desc>
          <delta_ts>2012-01-03 17:11:16 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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>jochen</reporter>
          <assigned_to>jochen</assigned_to>
          <cc>abarth</cc>
    
    <cc>dbates</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>528738</commentid>
    <comment_count>0</comment_count>
    <who name="">jochen</who>
    <bug_when>2012-01-03 05:32:56 -0800</bug_when>
    <thetext>Clear localStorage before making assumption about its contents</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528739</commentid>
    <comment_count>1</comment_count>
      <attachid>120937</attachid>
    <who name="">jochen</who>
    <bug_when>2012-01-03 05:34:12 -0800</bug_when>
    <thetext>Created attachment 120937
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528740</commentid>
    <comment_count>2</comment_count>
    <who name="">jochen</who>
    <bug_when>2012-01-03 05:36:42 -0800</bug_when>
    <thetext>This test fails flakily on our bots when there are already other entries in localStorage

Adam, can you please have a look?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528848</commentid>
    <comment_count>3</comment_count>
      <attachid>120937</attachid>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2012-01-03 10:50:17 -0800</bug_when>
    <thetext>Comment on attachment 120937
Patch

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

&gt; LayoutTests/platform/chromium/permissionclient/storage-permission.html:21
&gt; +    localStorage.clear();

Is this necessary? Can we reuse/simplify the logic in clearLocalStorage.js (*)? By line 3 of LayoutTests/platform/chromium/permissionclient/storage-permission.html, &lt;http://trac.webkit.org/browser/trunk/LayoutTests/platform/chromium/permissionclient/storage-permission.html?rev=87597#L3&gt;, we reference this script using the relative URL: resources/clearLocalStorage.js. However this script isn&apos;t included because it doesn&apos;t exist in directory LayoutTests/platform/chromium/permissionclient/resources. Instead, it exists in directory LayoutTests/storage/domstorage/localstorage/resources.

(*) I&apos;m unclear how the decision was made to clear localStorage using the approach taken in &lt;http://trac.webkit.org/browser/trunk/LayoutTests/storage/domstorage/localstorage/resources/clearLocalStorage.js?rev=31908&gt; as opposed to calling localStorage.clear().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528853</commentid>
    <comment_count>4</comment_count>
    <who name="">jochen</who>
    <bug_when>2012-01-03 10:56:36 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 120937 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=120937&amp;action=review
&gt; 
&gt; &gt; LayoutTests/platform/chromium/permissionclient/storage-permission.html:21
&gt; &gt; +    localStorage.clear();
&gt; 
&gt; Is this necessary? Can we reuse/simplify the logic in clearLocalStorage.js (*)? By line 3 of LayoutTests/platform/chromium/permissionclient/storage-permission.html, &lt;http://trac.webkit.org/browser/trunk/LayoutTests/platform/chromium/permissionclient/storage-permission.html?rev=87597#L3&gt;, we reference this script using the relative URL: resources/clearLocalStorage.js. However this script isn&apos;t included because it doesn&apos;t exist in directory LayoutTests/platform/chromium/permissionclient/resources. Instead, it exists in directory LayoutTests/storage/domstorage/localstorage/resources.

Ouch, seems I forgot to copy this over...



&gt; 
&gt; (*) I&apos;m unclear how the decision was made to clear localStorage using the approach taken in &lt;http://trac.webkit.org/browser/trunk/LayoutTests/storage/domstorage/localstorage/resources/clearLocalStorage.js?rev=31908&gt; as opposed to calling localStorage.clear().


I have no idea either. I think localStorage.clear() is preferable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528906</commentid>
    <comment_count>5</comment_count>
      <attachid>120971</attachid>
    <who name="">jochen</who>
    <bug_when>2012-01-03 11:31:49 -0800</bug_when>
    <thetext>Created attachment 120971
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528913</commentid>
    <comment_count>6</comment_count>
      <attachid>120971</attachid>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2012-01-03 11:36:07 -0800</bug_when>
    <thetext>Comment on attachment 120971
Patch

Can you elaborate on why we can&apos;t use the script clearLocalStorage.js?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528921</commentid>
    <comment_count>7</comment_count>
    <who name="">jochen</who>
    <bug_when>2012-01-03 11:47:19 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; (From update of attachment 120971 [details])
&gt; Can you elaborate on why we can&apos;t use the script clearLocalStorage.js?

We can, but I don&apos;t see the benefit. clearLocalStorage seems to stem from before localStorage.clear() was implemented: http://trac.webkit.org/browser/trunk/WebCore/storage/Storage.idl?rev=31908

I&apos;m preparing a separate CL that removes clearLocalStorage and replaces it with localStorage.clear() wdyt?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528929</commentid>
    <comment_count>8</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2012-01-03 11:52:46 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; I&apos;m preparing a separate CL that removes clearLocalStorage and replaces it with localStorage.clear() wdyt?

Sounds good.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>529181</commentid>
    <comment_count>9</comment_count>
      <attachid>120971</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-01-03 17:11:11 -0800</bug_when>
    <thetext>Comment on attachment 120971
Patch

Clearing flags on attachment: 120971

Committed r103991: &lt;http://trac.webkit.org/changeset/103991&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>529182</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-01-03 17:11:16 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>120937</attachid>
            <date>2012-01-03 05:34:12 -0800</date>
            <delta_ts>2012-01-03 11:31:44 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-75469-20120103143410.patch</filename>
            <type>text/plain</type>
            <size>1285</size>
            <attacher>jochen</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTAzOTA2CmRpZmYgLS1naXQgYS9MYXlvdXRUZXN0cy9DaGFu
Z2VMb2cgYi9MYXlvdXRUZXN0cy9DaGFuZ2VMb2cKaW5kZXggYjE1N2U5ODAzOWI1MDU2Nzc4NGU4
ZTVkYjY3Mzk4ZDZhN2M2ODVkNS4uMjM1MWQ3ZmM2ZWI0NjFkNDEyZmNjNjBmMTVlYzM5M2RkYjBj
MzcyZCAxMDA2NDQKLS0tIGEvTGF5b3V0VGVzdHMvQ2hhbmdlTG9nCisrKyBiL0xheW91dFRlc3Rz
L0NoYW5nZUxvZwpAQCAtMSwzICsxLDEyIEBACisyMDEyLTAxLTAzICBKb2NoZW4gRWlzaW5nZXIg
IDxqb2NoZW5AY2hyb21pdW0ub3JnPgorCisgICAgICAgIENsZWFyIGxvY2FsU3RvcmFnZSBiZWZv
cmUgbWFraW5nIGFzc3VtcHRpb24gY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91dFRlc3RDb250cm9sbGVyICYmIGxheW91dFRlc3RDb250cm9s
bGVyLnNldFN0b3JhZ2VBbGxvd2VkKQogICAgICAgICBsYXlvdXRUZXN0Q29udHJvbGxlci5zZXRT
dG9yYWdlQWxsb3dlZCh0cnVlKTsKICAgICBlbHNlCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>120971</attachid>
            <date>2012-01-03 11:31:49 -0800</date>
            <delta_ts>2012-01-03 17:11:11 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-75469-20120103203147.patch</filename>
            <type>text/plain</type>
            <size>1419</size>
            <attacher>jochen</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTAzOTA2CmRpZmYgLS1naXQgYS9MYXlvdXRUZXN0cy9DaGFu
Z2VMb2cgYi9MYXlvdXRUZXN0cy9DaGFuZ2VMb2cKaW5kZXggYjE1N2U5ODAzOWI1MDU2Nzc4NGU4
ZTVkYjY3Mzk4ZDZhN2M2ODVkNS4uMjM1MWQ3ZmM2ZWI0NjFkNDEyZmNjNjBmMTVlYzM5M2RkYjBj
MzcyZCAxMDA2NDQKLS0tIGEvTGF5b3V0VGVzdHMvQ2hhbmdlTG9nCisrKyBiL0xheW91dFRlc3Rz
L0NoYW5nZUxvZwpAQCAtMSwzICsxLDEyIEBACisyMDEyLTAxLTAzICBKb2NoZW4gRWlzaW5nZXIg
IDxqb2NoZW5AY2hyb21pdW0ub3JnPgorCisgICAgICAgIENsZWFyIGxvY2FsU3RvcmFnZSBiZWZv
cmUgbWFraW5nIGFzc3VtcHRpb24gYWJvdXQgaXRzIGNvbnRlbnRzCisgICAgICAgIGh0dHBzOi8v
YnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD03NTQ2OQorCisgICAgICAgIFJldmlld2Vk
IGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICogcGxhdGZvcm0vY2hyb21pdW0vcGVybWl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