<?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>63236</bug_id>
          
          <creation_ts>2011-06-23 01:55:08 -0700</creation_ts>
          <short_desc>[Qt] Fix tst_QWebFrame::renderGeometry() API test</short_desc>
          <delta_ts>2011-07-01 07:47:15 -0700</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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt, QtTriaged</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>38654</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Csaba Osztrogonác">ossy</reporter>
          <assigned_to name="Rafael Brandao">rafael.lobo</assigned_to>
          <cc>ademar</cc>
    
    <cc>kling</cc>
    
    <cc>luiz</cc>
    
    <cc>menard</cc>
    
    <cc>ossy</cc>
    
    <cc>rafael.lobo</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>426026</commentid>
    <comment_count>0</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2011-06-23 01:55:08 -0700</bug_when>
    <thetext>http://build.webkit.org/builders/Qt%20Linux%20Release/builds/34519

FAIL!  : tst_QWebFrame::renderGeometry() Compared values are not the same
   Actual (size.width()): 100
   Expected (picture.boundingRect().width() + frame-&gt;scrollBarGeometry(Qt::Vertical).width()): 0
   Loc: [/ramdisk/qt-linux-release/build/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp(2912)]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>426107</commentid>
    <comment_count>1</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2011-06-23 05:51:43 -0700</bug_when>
    <thetext>Three more fails:

FAIL!  : tst_QWebFrame::renderGeometry() Compared values are not the same
   Actual (size.height()): 100
   Expected (picture.boundingRect().height() + frame-&gt;scrollBarGeometry(Qt::Horizontal).height()): 0
   Loc: [/home/oszi/WebKit/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp(2915)]

FAIL!  : tst_QWebFrame::renderGeometry() Compared values are not the same
   Actual (size.width()): 100
   Expected (picture.boundingRect().width()): 0
   Loc: [/home/oszi/WebKit/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp(2924)]

FAIL!  : tst_QWebFrame::renderGeometry() Compared values are not the same
   Actual (size.height()): 100
   Expected (picture.boundingRect().height()): 0
   Loc: [/home/oszi/WebKit/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp(2927)]

Marked as expected fails: http://trac.webkit.org/changeset/89561</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>428924</commentid>
    <comment_count>2</comment_count>
    <who name="Rafael Brandao">rafael.lobo</who>
    <bug_when>2011-06-28 09:27:09 -0700</bug_when>
    <thetext>It looks like a regression, but I don&apos;t know what patch caused this. When you load with substitute data and there are local resources on it, it is no longer emitting loadFinished signal; it might not be trying to load them.

In this test, the image inside the inner frame is not being loaded, then the content size remains the same as the frame&apos;s size. The expected behavior is to put the image inside, let it expand the content size to 120x120, and then you&apos;ll need scrollbars, as the frame size is only 100x100. Without this expansion, the scrollbars are not created, and there&apos;s also no painting inside the frame, as there&apos;s no content. So in the end, the sizes sum is zero.

This is happening only for local resources, like file or qrc protocol, that are supposed to get loaded as soon as the substitute data lands. If you set the substitute data and inside it there&apos;s an image that uses a http protocol, for example, then it will try to request it normally. If instead of substitute data, you load the page as a local file (with file protocol), then everything works fine too.

This issue is probably causing tst_QWebFrame::setHtmlWithResource to fail as well. It would be really nice to identify what caused this regression.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>430047</commentid>
    <comment_count>3</comment_count>
    <who name="Rafael Brandao">rafael.lobo</who>
    <bug_when>2011-06-29 18:00:24 -0700</bug_when>
    <thetext>I think I&apos;ve finally got what is going wrong. It&apos;s a security origin issue. When we load substitute data in that test without defining its base url, it won&apos;t have an origin that can load local files (by default only local files can load local files). For some yet unknown reason, we&apos;re not enforcing our setting defined in QWebPagePrivate&apos;s constructor that we should allow local loads for local files and for substitute data. That&apos;s what I&apos;m currently investigating.

A quick fix for this test is to put some local file as base url for the iframe, like &quot;file://path/to/local&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>430757</commentid>
    <comment_count>4</comment_count>
      <attachid>99384</attachid>
    <who name="Rafael Brandao">rafael.lobo</who>
    <bug_when>2011-06-30 15:57:26 -0700</bug_when>
    <thetext>Created attachment 99384
We need a proper security origin in order to load local resources, so specified a local file to be its baseUrl.

It took me a while, but this patch made this &quot;bug&quot; appears: https://bugs.webkit.org/show_bug.cgi?id=61494. I&apos;ve explained there how it is happening, and it looks like it didn&apos;t affect the other ports. But sincerely I think we&apos;ve been using setHtml in the wrong way.

On QWebPagePrivate&apos;s constructor, you can see it&apos;s setting a SecurityOrigin policy to allow local files and substitute data to load local resources, but the user of the API is not aware of this (correct me if I&apos;m wrong), and until that patch they were able to do exactly like the test was using. And I&apos;ve already seen many other circumstances where I would think a certain behavior would happen and then had to specify a valid baseUrl to do it (local storage for example). So if we agree with this current behavior, then it looks like our API docs must reflect this in a better way.

The other option to fix this is to correct what was introduced by that patch, but still it looks awkward (for me) that we&apos;re doing this little exception here to download local resources, and to everything else we must get a proper security origin.

The other bug (https://bugs.webkit.org/show_bug.cgi?id=63235) could also be fixed like this, and I could also add there a case where the user specify the substitute data but do not provide a valid origin, so we can test both behaviors (as the other test is actually testing substitute data with local resources, differently from this one).

Waiting for feedback. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>430768</commentid>
    <comment_count>5</comment_count>
      <attachid>99384</attachid>
    <who name="Benjamin Poulain">benjamin</who>
    <bug_when>2011-06-30 16:04:49 -0700</bug_when>
    <thetext>Comment on attachment 99384
We need a proper security origin in order to load local resources, so specified a local file to be its baseUrl.

Good catch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>430812</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-06-30 16:29:00 -0700</bug_when>
    <thetext>The commit-queue encountered the following flaky tests while processing attachment 99384:

http/tests/local/formdata/upload-events.html bug 63357 (author: jianli@chromium.org)
The commit-queue is continuing to process your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>430815</commentid>
    <comment_count>7</comment_count>
      <attachid>99384</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-06-30 16:30:30 -0700</bug_when>
    <thetext>Comment on attachment 99384
We need a proper security origin in order to load local resources, so specified a local file to be its baseUrl.

Clearing flags on attachment: 99384

Committed r90181: &lt;http://trac.webkit.org/changeset/90181&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>430816</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-06-30 16:30:36 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>431154</commentid>
    <comment_count>9</comment_count>
    <who name="Ademar Reis">ademar</who>
    <bug_when>2011-07-01 07:47:15 -0700</bug_when>
    <thetext>Revision r90181 cherry-picked into qtwebkit-2.2 with commit 173b2e2 &lt;http://gitorious.org/webkit/qtwebkit/commit/173b2e2&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>99384</attachid>
            <date>2011-06-30 15:57:26 -0700</date>
            <delta_ts>2011-06-30 16:30:30 -0700</delta_ts>
            <desc>We need a proper security origin in order to load local resources, so specified a local file to be its baseUrl.</desc>
            <filename>renderGeometry-origin.diff</filename>
            <type>text/plain</type>
            <size>2718</size>
            <attacher name="Rafael Brandao">rafael.lobo</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQvcXQvQ2hhbmdlTG9nIGIvU291cmNlL1dlYktpdC9x
dC9DaGFuZ2VMb2cKaW5kZXggZGY2YWNkNi4uYTViNzAyOSAxMDA2NDQKLS0tIGEvU291cmNlL1dl
YktpdC9xdC9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYktpdC9xdC9DaGFuZ2VMb2cKQEAgLTEs
MyArMSwxNiBAQAorMjAxMS0wNi0zMCAgUmFmYWVsIEJyYW5kYW8gIDxyYWZhZWwubG9ib0BvcGVu
Ym9zc2Eub3JnPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAg
ICAgIFtRdF0gRml4IHRzdF9RV2ViRnJhbWU6OnJlbmRlckdlb21ldHJ5KCkgQVBJIHRlc3QKKyAg
ICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTYzMjM2CisgICAg
ICAgIAorICAgICAgICBUaGlzIHRlc3QgcmVxdWlyZWQgYSBzZWN1cml0eSBvcmlnaW4gd2l0aCBn
cmFudGVkIHBlcm1pc3Npb24gdG8gcmVxdWVzdCBsb2NhbCByZXNvdXJjZXMuCisgICAgICAgIEJ5
IGRlZmF1bHQsIG9ubHkgbG9jYWwgZmlsZXMgY2FuIGxvYWQgbG9jYWwgcmVzb3VyY2VzLiBTbyBt
b2RpZmllZCBiYXNlVXJsIHRvIGJlIGEgbG9jYWwgZmlsZS4KKworICAgICAgICAqIHRlc3RzL3F3
ZWJmcmFtZS90c3RfcXdlYmZyYW1lLm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