Changeset 88933 in webkit


Ignore:
Timestamp:
Jun 15, 2011 8:08:23 AM (13 years ago)
Author:
diegohcg@webkit.org
Message:

2011-06-15 Diego Gonzalez <diegohcg@webkit.org>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Inconsistent behavior on a form submit request...
https://bugs.webkit.org/show_bug.cgi?id=45523

The inconsistency occurs when a form submission requests a new window.
Two windows are opened (instead of only one) and the first window is opened
as a blank page.

By default each page is put into their own unique page group, which affects popup windows
and visited links. Page groups (per process only) is a feature making it possible to use
separate settings for each group, so that for instance an integrated browser/email reader
can use different settings for displaying HTML pages and HTML email. To make QtWebKit work
as expected out of the box, we use a default group similar to what other ports are doing.

  • Api/qwebpage.cpp:
Location:
trunk/Source/WebKit/qt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/qt/Api/qwebpage.cpp

    r88038 r88933  
    346346    page = new Page(pageClients);
    347347
     348    // By default each page is put into their own unique page group, which affects popup windows
     349    // and visited links. Page groups (per process only) is a feature making it possible to use
     350    // separate settings for each group, so that for instance an integrated browser/email reader
     351    // can use different settings for displaying HTML pages and HTML email. To make QtWebKit work
     352    // as expected out of the box, we use a default group similar to what other ports are doing.
     353    page->setGroupName("Default Group");
     354
    348355#if ENABLE(CLIENT_BASED_GEOLOCATION)
    349356    // In case running in DumpRenderTree mode set the controller to mock provider.
  • trunk/Source/WebKit/qt/ChangeLog

    r88796 r88933  
     12011-06-15  Diego Gonzalez  <diegohcg@webkit.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Inconsistent behavior on a form submit request...
     6        https://bugs.webkit.org/show_bug.cgi?id=45523
     7
     8        The inconsistency occurs when a form submission requests a new window.
     9        Two windows are opened (instead of only one) and the first window is opened
     10        as a blank page.
     11
     12        By default each page is put into their own unique page group, which affects popup windows
     13        and visited links. Page groups (per process only) is a feature making it possible to use
     14        separate settings for each group, so that for instance an integrated browser/email reader
     15        can use different settings for displaying HTML pages and HTML email. To make QtWebKit work
     16        as expected out of the box, we use a default group similar to what other ports are doing.
     17
     18        * Api/qwebpage.cpp:
     19
    1202011-06-14  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
    221
  • trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp

    r88065 r88933  
    9090    void initTestCase();
    9191    void cleanupTestCase();
    92 
    9392    void contextMenuCopy();
    9493    void acceptNavigationRequest();
    9594    void geolocationRequestJS();
    9695    void loadFinished();
     96    void popupFormSubmission();
    9797    void acceptNavigationRequestWithNewWindow();
    9898    void userStyleSheet();
     
    391391};
    392392
     393void tst_QWebPage::popupFormSubmission()
     394{
     395    TestPage page;
     396    page.settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
     397    page.mainFrame()->setHtml("<form name=form1 method=get action='' target=myNewWin>"\
     398                                "<input type=hidden name=foo value='bar'>"\
     399                                "</form>");
     400    page.mainFrame()->evaluateJavaScript("window.open('', 'myNewWin', 'width=500,height=300,toolbar=0')");
     401    page.mainFrame()->evaluateJavaScript("document.form1.submit();");
     402
     403    QTest::qWait(500);
     404    // The number of popup created should be one.
     405    QVERIFY(page.createdWindows.size() == 1);
     406
     407    QString url = page.createdWindows.takeFirst()->mainFrame()->url().toString();
     408    // Check if the form submission was OK.
     409    QVERIFY(url.contains("?foo=bar"));
     410}
     411
    393412void tst_QWebPage::acceptNavigationRequestWithNewWindow()
    394413{
Note: See TracChangeset for help on using the changeset viewer.