Changeset 41071 in webkit


Ignore:
Timestamp:
Feb 18, 2009 6:04:23 PM (15 years ago)
Author:
mitz@apple.com
Message:

WebCore:

Reviewed by Brady Eidson.

  • WebCore part of fixing <rdar://problem/6507512> Crash in iChat at CSSStyleSelector::adjustRenderStyle

The crash results from re-entry into
CSSMutableStyleDeclaration::setCssText, which in turn is caused by
the first style change causing a cached image to load from the memory
cache, causing load delegate dispatch, and iChat's delegate method
calling back into WebKit.

The workaround is to use defer delegate callbacks for memory cache. In
this case, deferring callbacks during image load event dispatch was
found to be sufficient.

The crash is a regression. See also the discussion in
<https://bugs.webkit.org/show_bug.cgi?id=22521>.

  • WebCore.base.exp: Added Settings::setNeedsIChatMemoryCacheCallsQuirk().
  • dom/Document.cpp: (WebCore::Document::dispatchImageLoadEventsNow): If the quirk is enabled, defer memory cache callbacks during image load event dispatch.
  • page/Settings.cpp: (WebCore::Settings::Settings): Initialize m_needsIChatMemoryCacheCallsQuirk. (WebCore::Settings::setNeedsIChatMemoryCacheCallsQuirk): Added this setter.
  • page/Settings.h: (WebCore::Settings::needsIChatMemoryCacheCallsQuirk): Added this getter.

WebKit/mac:

Reviewed by Brady Eidson.

  • WebKit part of fixing <rdar://problem/6507512> Crash in iChat at CSSStyleSelector::adjustRenderStyle
  • WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Activate the WebCore workaround for this crash in iChat.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r41067 r41071  
     12009-02-18  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Brady Eidson.
     4
     5        - WebCore part of fixing <rdar://problem/6507512> Crash in iChat at CSSStyleSelector::adjustRenderStyle
     6
     7        The crash results from re-entry into
     8        CSSMutableStyleDeclaration::setCssText, which in turn is caused by
     9        the first style change causing a cached image to load from the memory
     10        cache, causing load delegate dispatch, and iChat's delegate method
     11        calling back into WebKit.
     12
     13        The workaround is to use defer delegate callbacks for memory cache. In
     14        this case, deferring callbacks during image load event dispatch was
     15        found to be sufficient.
     16
     17        The crash is a regression. See also the discussion in
     18        <https://bugs.webkit.org/show_bug.cgi?id=22521>.
     19
     20        * WebCore.base.exp: Added
     21        Settings::setNeedsIChatMemoryCacheCallsQuirk().
     22        * dom/Document.cpp:
     23        (WebCore::Document::dispatchImageLoadEventsNow): If the quirk is
     24        enabled, defer memory cache callbacks during image load event dispatch.
     25        * page/Settings.cpp:
     26        (WebCore::Settings::Settings): Initialize
     27        m_needsIChatMemoryCacheCallsQuirk.
     28        (WebCore::Settings::setNeedsIChatMemoryCacheCallsQuirk): Added this
     29        setter.
     30        * page/Settings.h:
     31        (WebCore::Settings::needsIChatMemoryCacheCallsQuirk): Added this getter.
     32
    1332009-02-18  Adam Roben  <aroben@apple.com>
    234
  • trunk/WebCore/WebCore.base.exp

    r41067 r41071  
    617617__ZN7WebCore8Settings32setNeedsAdobeFrameReloadingQuirkEb
    618618__ZN7WebCore8Settings33setEnforceCSSMIMETypeInStrictModeEb
     619__ZN7WebCore8Settings34setNeedsIChatMemoryCacheCallsQuirkEb
    619620__ZN7WebCore8Settings35disableRangeMutationForOldAppleMailEb
    620621__ZN7WebCore8Settings36setOfflineWebApplicationCacheEnabledEb
  • trunk/WebCore/dom/Document.cpp

    r41047 r41071  
    29052905    if (!m_imageLoadEventDispatchingList.isEmpty())
    29062906        return;
    2907 
     2907#ifdef BUILDING_ON_LEOPARD
     2908    bool shouldReenableMemoryCacheClientCalls = false;
     2909    if (settings() && settings()->needsIChatMemoryCacheCallsQuirk() && page()->areMemoryCacheClientCallsEnabled()) {
     2910        shouldReenableMemoryCacheClientCalls = true;
     2911        page()->setMemoryCacheClientCallsEnabled(false);
     2912    }
     2913#endif
    29082914    m_imageLoadEventTimer.stop();
    29092915
     
    29162922    }
    29172923    m_imageLoadEventDispatchingList.clear();
     2924#ifdef BUILDING_ON_LEOPARD
     2925    if (shouldReenableMemoryCacheClientCalls && page())
     2926        page()->setMemoryCacheClientCallsEnabled(true);
     2927#endif
    29182928}
    29192929
  • trunk/WebCore/page/Settings.cpp

    r40449 r41071  
    8888    , m_maximumDecodedImageSize(std::numeric_limits<size_t>::max())
    8989    , m_allowScriptsToCloseWindows(false)
     90    , m_needsIChatMemoryCacheCallsQuirk(false)
    9091{
    9192    // A Frame may not have been created yet, so we initialize the AtomicString
     
    418419}
    419420
     421void Settings::setNeedsIChatMemoryCacheCallsQuirk(bool needsIChatMemoryCacheCallsQuirk)
     422{
     423    m_needsIChatMemoryCacheCallsQuirk = needsIChatMemoryCacheCallsQuirk;
     424}
     425
    420426} // namespace WebCore
  • trunk/WebCore/page/Settings.h

    r40449 r41071  
    205205        void setAllowScriptsToCloseWindows(bool);
    206206        bool allowScriptsToCloseWindows() const { return m_allowScriptsToCloseWindows; }
     207
     208        void setNeedsIChatMemoryCacheCallsQuirk(bool);
     209        bool needsIChatMemoryCacheCallsQuirk() const { return m_needsIChatMemoryCacheCallsQuirk; }
    207210
    208211    private:
     
    259262        size_t m_maximumDecodedImageSize;
    260263        bool m_allowScriptsToCloseWindows : 1;
     264        bool m_needsIChatMemoryCacheCallsQuirk : 1;
    261265
    262266#if USE(SAFARI_THEME)
  • trunk/WebKit/mac/ChangeLog

    r41070 r41071  
     12009-02-18  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Brady Eidson.
     4
     5        - WebKit part of fixing <rdar://problem/6507512> Crash in iChat at CSSStyleSelector::adjustRenderStyle
     6
     7        * WebView/WebView.mm:
     8        (-[WebView _preferencesChangedNotification:]): Activate the WebCore
     9        workaround for this crash in iChat.
     10
    1112009-02-18  Anders Carlsson  <andersca@apple.com>
    212
  • trunk/WebKit/mac/WebView/WebView.mm

    r41067 r41071  
    13461346    settings->setZoomsTextOnly([preferences zoomsTextOnly]);
    13471347    settings->setEnforceCSSMIMETypeInStrictMode(!WKAppVersionCheckLessThan(@"com.apple.iWeb", -1, 2.1));
     1348#ifdef BUILDING_ON_LEOPARD
     1349    settings->setNeedsIChatMemoryCacheCallsQuirk([[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.iChat"]);
     1350#endif
    13481351}
    13491352
Note: See TracChangeset for help on using the changeset viewer.