<?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>49466</bug_id>
          
          <creation_ts>2010-11-12 12:19:12 -0800</creation_ts>
          <short_desc>REGRESSION(r71895): API test javaScriptWindowObjectCleared fails</short_desc>
          <delta_ts>2010-11-14 10:43: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>WebKit Qt</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</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="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>benjamin</cc>
    
    <cc>hausmann</cc>
    
    <cc>kling</cc>
    
    <cc>ossy</cc>
    
    <cc>tonikitoo</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>308693</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-11-12 12:19:12 -0800</bug_when>
    <thetext>After http://trac.webkit.org/changeset/71895, javaScriptWindowObjectCleared fails.

Test content:
2396    void tst_QWebFrame::javaScriptWindowObjectCleared()
2397    {
2398        QWebPage page;
2399        QWebFrame* frame = page.mainFrame();
2400        QSignalSpy spy(frame, SIGNAL(javaScriptWindowObjectCleared()));
2401        QFETCH(QString, html);
2402        frame-&gt;setHtml(html);
2403    
2404        QFETCH(int, signalCount);
2405        QCOMPARE(spy.count(), signalCount);
2406    }

http://doc.qt.nokia.com/4.7/qwebframe.html#javaScriptWindowObjectCleared

&quot;This signal is emitted whenever the global window object of the JavaScript environment is cleared, e.g., before starting a new load.&quot;

We emit this signal when FrameLoader::dispatchDidClearWindowObjectInWorld() is called.

The failing test checks that loading the following HTML causes one emission of that signal:
&quot;&lt;html&gt;&lt;body&gt;&lt;script&gt;&lt;/script&gt;&lt;p&gt;hello world&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;&quot;

On Mac, dispatchDidClearWindowObjectInWorld is called when loading:
&lt;html&gt;&lt;body&gt;&lt;script&gt;&lt;/script&gt;&lt;p&gt;hello world&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;

#0    0x101865b54 in WebCore::FrameLoader::dispatchDidClearWindowObjectsInAllWorlds at FrameLoader.cpp:3348
#1    0x101869ac6 in WebCore::FrameLoader::receivedFirstData at FrameLoader.cpp:617
#2    0x101869cee in WebCore::FrameLoader::willSetEncoding at FrameLoader.cpp:1089
#3    0x101710989 in WebCore::DocumentWriter::setEncoding at DocumentWriter.cpp:236
#4    0x1017016d0 in WebCore::DocumentLoader::commitData at DocumentLoader.cpp:306
#5    0x100f34f76 in -[WebFrame(WebInternal) _commitData:] at WebFrame.mm:957
#6    0x100f5d8d6 in -[WebHTMLRepresentation receivedData:withDataSource:] at WebHTMLRepresentation.mm:173
#7    0x100f1d8c8 in -[WebDataSource(WebInternal) _receivedData:] at WebDataSource.mm:239
#8    0x100f407eb in WebFrameLoaderClient::committedLoad at WebFrameLoaderClient.mm:856
#9    0x101701825 in WebCore::DocumentLoader::commitLoad at DocumentLoader.cpp:293
#10    0x10170187e in WebCore::DocumentLoader::receivedData at DocumentLoader.cpp:320
#11    0x101d61d2e in WebCore::MainResourceLoader::addData at MainResourceLoader.cpp:157
#12    0x101f762c4 in WebCore::ResourceLoader::didReceiveData at ResourceLoader.cpp:276
#13    0x101d6147f in WebCore::MainResourceLoader::didReceiveData at MainResourceLoader.cpp:436
#14    0x101f75ab6 in WebCore::ResourceLoader::didReceiveData at ResourceLoader.cpp:429</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>308697</commentid>
    <comment_count>1</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-11-12 12:22:47 -0800</bug_when>
    <thetext>The failing test was added by http://trac.webkit.org/changeset/48166.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>309077</commentid>
    <comment_count>2</comment_count>
      <attachid>73849</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-11-14 09:58:42 -0800</bug_when>
    <thetext>Created attachment 73849
Proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>309078</commentid>
    <comment_count>3</comment_count>
      <attachid>73849</attachid>
    <who name="Antonio Gomes">tonikitoo</who>
    <bug_when>2010-11-14 10:20:54 -0800</bug_when>
    <thetext>Comment on attachment 73849
Proposed patch

Maybe adding a comment, kl0ng?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>309079</commentid>
    <comment_count>4</comment_count>
      <attachid>73849</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-11-14 10:23:00 -0800</bug_when>
    <thetext>Comment on attachment 73849
Proposed patch

&gt; Maybe adding a comment, kl0ng?

Sure thing, mang!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>309082</commentid>
    <comment_count>5</comment_count>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-11-14 10:43:50 -0800</bug_when>
    <thetext>Committed r71983: &lt;http://trac.webkit.org/changeset/71983&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>73849</attachid>
            <date>2010-11-14 09:58:42 -0800</date>
            <delta_ts>2010-11-14 10:23:00 -0800</delta_ts>
            <desc>Proposed patch</desc>
            <filename>bug-49466.diff</filename>
            <type>text/plain</type>
            <size>1403</size>
            <attacher name="Andreas Kling">kling</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYktpdC9xdC9DaGFuZ2VMb2cgYi9XZWJLaXQvcXQvQ2hhbmdlTG9nCmlu
ZGV4IGNhOTk0MmMuLjA0ODdkYjAgMTAwNjQ0Ci0tLSBhL1dlYktpdC9xdC9DaGFuZ2VMb2cKKysr
IGIvV2ViS2l0L3F0L0NoYW5nZUxvZwpAQCAtMSwzICsxLDE2IEBACisyMDEwLTExLTE0ICBBbmRy
ZWFzIEtsaW5nICA8a2xpbmdAd2Via2l0Lm9yZz4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JP
RFkgKE9PUFMhKS4KKworICAgICAgICBSRUdSRVNTSU9OKHI3MTg5NSk6IEFQSSB0ZXN0IGphdmFT
Y3JpcHRXaW5kb3dPYmplY3RDbGVhcmVkIGZhaWxzCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJr
aXQub3JnL3Nob3dfYnVnLmNnaT9pZD00OTQ2NgorCisgICAgICAgIEFzIG9mIHI3MTg5NSBlbXB0
eSBpbmxpbmUgc2NyaXB0cyBhcmUgbm8gbG9uZ2VyIGV4ZWN1dGVkIGFuZCBzbworICAgICAgICB0
aGUgamF2YVNjcmlwdFdpbmRvd09iamVjdENsZWFyZWQoKSBzaWduYWwgaXMgbm8gbG9uZ2VyIHRy
aWdnZXJlZAorICAgICAgICBieSA8c2NyaXB0Pjwvc2NyaXB0Pi4KKworICAgICAgICAqIHRlc3Rz
L3F3ZWJmcmFtZS90c3RfcXdlYmZyYW1lLmNwcDoKKwogMjAxMC0xMS0xMSAgWWkgU2hlbiAgPHlp
LjQuc2hlbkBub2tpYS5jb20+CiAKICAgICAgICAgUmV2aWV3ZWQgYnkgQW5kcmVhcyBLbGluZy4K
ZGlmZiAtLWdpdCBhL1dlYktpdC9xdC90ZXN0cy9xd2ViZnJhbWUvdHN0X3F3ZWJmcmFtZS5jcHAg
Yi9XZWJLaXQvcXQvdGVzdHMvcXdlYmZyYW1lL3RzdF9xd2ViZnJhbWUuY3BwCmluZGV4IGQ3NGI2
MzEuLmYwOTZkYjcgMTAwNjQ0Ci0tLSBhL1dlYktpdC9xdC90ZXN0cy9xd2ViZnJhbWUvdHN0X3F3
ZWJmcmFtZS5jcHAKKysrIGIvV2ViS2l0L3F0L3Rlc3RzL3F3ZWJmcmFtZS90c3RfcXdlYmZyYW1l
LmNwcApAQCAtMjM4OSw3ICsyMzg5LDcgQEAgdm9pZCB0c3RfUVdlYkZyYW1lOjpqYXZhU2NyaXB0
V2luZG93T2JqZWN0Q2xlYXJlZF9kYXRhKCkKIHsKICAgICBRVGVzdDo6YWRkQ29sdW1uPFFTdHJp
bmc+KCJodG1sIik7CiAgICAgUVRlc3Q6OmFkZENvbHVtbjxpbnQ+KCJzaWduYWxDb3VudCIpOwot
ICAgIFFUZXN0OjpuZXdSb3coIndpdGggPHNjcmlwdD4iKSA8PCAiPGh0bWw+PGJvZHk+PHNjcmlw
dD48L3NjcmlwdD48cD5oZWxsbyB3b3JsZDwvcD48L2JvZHk+PC9odG1sPiIgPDwgMTsKKyAgICBR
VGVzdDo6bmV3Um93KCJ3aXRoIDxzY3JpcHQ+IikgPDwgIjxodG1sPjxib2R5PjxzY3JpcHQ+aT0w
PC9zY3JpcHQ+PHA+aGVsbG8gd29ybGQ8L3A+PC9ib2R5PjwvaHRtbD4iIDw8IDE7CiAgICAgUVRl
c3Q6Om5ld1Jvdygid2l0aG91dCA8c2NyaXB0PiIpIDw8ICI8aHRtbD48Ym9keT48cD5oZWxsbyB3
b3JsZDwvcD48L2JvZHk+PC9odG1sPiIgPDwgMDsKIH0KIAo=
</data>
<flag name="review"
          id="64361"
          type_id="1"
          status="+"
          setter="tonikitoo"
    />
    <flag name="commit-queue"
          id="64362"
          type_id="3"
          status="-"
          setter="kling"
    />
          </attachment>
      

    </bug>

</bugzilla>