Changeset 107059 in webkit


Ignore:
Timestamp:
Feb 8, 2012 2:42:55 AM (12 years ago)
Author:
Csaba Osztrogonác
Message:

[Qt] REGRESSION(r106918): It made svg/zoom/page/zoom-foreignObject.svg crash with Qt5-WK1
https://bugs.webkit.org/show_bug.cgi?id=77995

Patch by Nikolas Zimmermann <nzimmermann@rim.com> on 2012-02-08
Reviewed by Csaba Osztrogonác.

Source/WebCore:

From the stack traces it's obvious that SVGImageChromeClient tried to invalidate the root view,
while its SVGImage was being destructed, due to an updateStyleIfNeeded() call, coming
from frameDetached(). There's no point in redrawing there, so we should just stop it.

Covered by existing tests on the Qt but, unfortunately I couldn't reproduce it on Mac.

  • svg/graphics/SVGImage.cpp:

(WebCore::SVGImageChromeClient::invalidateContentsAndRootView): Stop invalidating if m_page is 0.
(WebCore::SVGImage::~SVGImage): Clear m_page, so that SVGImageChromeClient knows we're destructing.

  • svg/graphics/SVGImage.h:

LayoutTests:

  • platform/qt/Skipped: Unskip previously skipped tests.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r107058 r107059  
     12012-02-08  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        [Qt] REGRESSION(r106918): It made svg/zoom/page/zoom-foreignObject.svg crash with Qt5-WK1
     4        https://bugs.webkit.org/show_bug.cgi?id=77995
     5
     6        Reviewed by Csaba Osztrogonác.
     7
     8        * platform/qt/Skipped: Unskip previously skipped tests.
     9
    1102012-02-08  Pablo Flouret  <pablof@motorola.com>
    211
  • trunk/LayoutTests/platform/qt/Skipped

    r107052 r107059  
    25392539# https://bugs.webkit.org/show_bug.cgi?id=78026
    25402540svg/as-object/nested-embedded-svg-size-changes.html
    2541 
    2542 # [Qt] REGRESSION(r106918): It made svg/zoom/page/zoom-foreignObject.svg crash with Qt5-WK1
    2543 # https://bugs.webkit.org/show_bug.cgi?id=77995
    2544 svg/zoom/page/zoom-background-images.html
    2545 svg/zoom/page/zoom-coords-viewattr-01-b.svg
  • trunk/Source/WebCore/ChangeLog

    r107058 r107059  
     12012-02-08  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        [Qt] REGRESSION(r106918): It made svg/zoom/page/zoom-foreignObject.svg crash with Qt5-WK1
     4        https://bugs.webkit.org/show_bug.cgi?id=77995
     5
     6        Reviewed by Csaba Osztrogonác.
     7
     8        From the stack traces it's obvious that SVGImageChromeClient tried to invalidate the root view,
     9        while its SVGImage was being destructed, due to an updateStyleIfNeeded() call, coming
     10        from frameDetached(). There's no point in redrawing there, so we should just stop it.
     11
     12        Covered by existing tests on the Qt but, unfortunately I couldn't reproduce it on Mac.
     13
     14        * svg/graphics/SVGImage.cpp:
     15        (WebCore::SVGImageChromeClient::invalidateContentsAndRootView): Stop invalidating if m_page is 0.
     16        (WebCore::SVGImage::~SVGImage): Clear m_page, so that SVGImageChromeClient knows we're destructing.
     17        * svg/graphics/SVGImage.h:
     18
    1192012-02-08  Pablo Flouret  <pablof@motorola.com>
    220
  • trunk/Source/WebCore/svg/graphics/SVGImage.cpp

    r105513 r107059  
    7676    virtual void invalidateContentsAndRootView(const IntRect& r, bool)
    7777    {
    78         if (m_image && m_image->imageObserver())
     78        // If m_image->m_page is null, we're being destructed, don't fire changedInRect() in that case.
     79        if (m_image && m_image->imageObserver() && m_image->m_page)
    7980            m_image->imageObserver()->changedInRect(m_image, r);
    8081    }
     
    9192{
    9293    if (m_page) {
    93         m_page->mainFrame()->loader()->frameDetached(); // Break both the loader and view references to the frame
    94 
    95         // Clear explicitly because we want to delete the page before the ChromeClient.
    96         // FIXME: I believe that's already guaranteed by C++ object destruction rules,
    97         // so this may matter only for the assertion below.
    98         m_page.clear();
     94        // Store m_page in a local variable, clearing m_page, so that SVGImageChromeClient knows we're destructed.
     95        OwnPtr<Page> currentPage = m_page.release();
     96        currentPage->mainFrame()->loader()->frameDetached(); // Break both the loader and view references to the frame
    9997    }
    10098
  • trunk/Source/WebCore/svg/graphics/SVGImage.h

    r105513 r107059  
    6262
    6363private:
     64    friend class SVGImageChromeClient;
    6465    virtual ~SVGImage();
    6566
Note: See TracChangeset for help on using the changeset viewer.