Changeset 81669 in webkit


Ignore:
Timestamp:
Mar 22, 2011 8:49:02 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-03-22 Andrew Wason <rectalogic@rectalogic.com>

Reviewed by Benjamin Poulain.

[Qt] QWebPage with WebGL content crashes when rendering if no QWebView parent
https://bugs.webkit.org/show_bug.cgi?id=54138

  • platform/graphics/qt/GraphicsContext3DQt.cpp: (WebCore::GraphicsContext3DInternal::getViewportGLWidget): Check if we actually have a QWebPageClient before dereferencing it.

2011-03-22 Andrew Wason <rectalogic@rectalogic.com>

Reviewed by Benjamin Poulain.

[Qt] QWebPage with WebGL content crashes when rendering if no QWebView parent
https://bugs.webkit.org/show_bug.cgi?id=54138

  • tests/qwebpage/tst_qwebpage.cpp: (webGLScreenshotWithoutView): (tst_QWebPage::acceleratedWebGLScreenshotWithoutView): (tst_QWebPage::unacceleratedWebGLScreenshotWithoutView): Render a QWebPage (with and without accelerated compositing) with a WebGL context that has no owning view. Shouldn't crash.
Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r81663 r81669  
     12011-03-22  Andrew Wason  <rectalogic@rectalogic.com>
     2
     3        Reviewed by Benjamin Poulain.
     4
     5        [Qt] QWebPage with WebGL content crashes when rendering if no QWebView parent
     6        https://bugs.webkit.org/show_bug.cgi?id=54138
     7
     8        * platform/graphics/qt/GraphicsContext3DQt.cpp:
     9        (WebCore::GraphicsContext3DInternal::getViewportGLWidget):
     10         Check if we actually have a QWebPageClient before dereferencing it.
     11
    1122011-03-22  Pavel Feldman  <pfeldman@chromium.org>
    213
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

    r81553 r81669  
    466466{
    467467    QWebPageClient* webPageClient = m_hostWindow->platformPageClient();
     468    if (!webPageClient)
     469        return 0;
    468470
    469471    QAbstractScrollArea* scrollArea = qobject_cast<QAbstractScrollArea*>(webPageClient->ownerWidget());
  • trunk/Source/WebKit/qt/ChangeLog

    r81600 r81669  
     12011-03-22  Andrew Wason  <rectalogic@rectalogic.com>
     2
     3        Reviewed by Benjamin Poulain.
     4
     5        [Qt] QWebPage with WebGL content crashes when rendering if no QWebView parent
     6        https://bugs.webkit.org/show_bug.cgi?id=54138
     7
     8        * tests/qwebpage/tst_qwebpage.cpp:
     9        (webGLScreenshotWithoutView):
     10        (tst_QWebPage::acceleratedWebGLScreenshotWithoutView):
     11        (tst_QWebPage::unacceleratedWebGLScreenshotWithoutView):
     12         Render a QWebPage (with and without accelerated compositing)
     13         with a WebGL context that has no owning view.  Shouldn't crash.
     14
    1152011-03-21  Chang Shu  <cshu@webkit.org>
    216
  • trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp

    r79996 r81669  
    127127    void screenshot();
    128128
     129#if defined(ENABLE_WEBGL) && ENABLE_WEBGL
     130    void acceleratedWebGLScreenshotWithoutView();
     131    void unacceleratedWebGLScreenshotWithoutView();
     132#endif
     133
    129134    void originatingObjectInNetworkRequests();
    130135    void testJSPrompt();
     
    24742479}
    24752480
     2481#if defined(ENABLE_WEBGL) && ENABLE_WEBGL
     2482// https://bugs.webkit.org/show_bug.cgi?id=54138
     2483static void webGLScreenshotWithoutView(bool accelerated)
     2484{
     2485    QWebPage page;
     2486    page.settings()->setAttribute(QWebSettings::WebGLEnabled, true);
     2487    page.settings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, accelerated);
     2488    QWebFrame* mainFrame = page.mainFrame();
     2489    mainFrame->setHtml("<html><body>"
     2490                       "<canvas id='webgl' width='300' height='300'></canvas>"
     2491                       "<script>document.getElementById('webgl').getContext('experimental-webgl')</script>"
     2492                       "</body></html>");
     2493
     2494    takeScreenshot(&page);
     2495}
     2496
     2497void tst_QWebPage::acceleratedWebGLScreenshotWithoutView()
     2498{
     2499    webGLScreenshotWithoutView(true);
     2500}
     2501
     2502void tst_QWebPage::unacceleratedWebGLScreenshotWithoutView()
     2503{
     2504    webGLScreenshotWithoutView(false);
     2505}
     2506#endif
     2507
    24762508void tst_QWebPage::originatingObjectInNetworkRequests()
    24772509{
Note: See TracChangeset for help on using the changeset viewer.