Changeset 38843 in webkit


Ignore:
Timestamp:
Nov 29, 2008 1:40:23 PM (15 years ago)
Author:
mitz@apple.com
Message:

WebCore:

Reviewed by Alexey Proskuryakov.

Test: http/tests/misc/font-face-in-multiple-segmented-faces.html

The crash happened because style recalculation was invoked by
CSSFontSelector after one CSSSegmentedFontFace had pruned its tables but
before another CSSSegmentedFontFace using the same CSSFontFace had done
so. The fix is to let all CSSSegmentedFontFaces using the CSSFontFace
prune their tables before telling the CSSFontSelector to recalc style.

  • css/CSSFontFace.cpp: (WebCore::CSSFontFace::fontLoaded):
  • css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::fontLoaded):
  • css/CSSFontSelector.h:
  • css/CSSSegmentedFontFace.cpp: (WebCore::CSSSegmentedFontFace::fontLoaded):

LayoutTests:

Reviewed by Alexey Proskuryakov.

  • http/tests/misc/font-face-in-multiple-segmented-faces-expected.txt: Added.
  • http/tests/misc/font-face-in-multiple-segmented-faces.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r38842 r38843  
     12008-11-29  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        - test for https://bugs.webkit.org/show_bug.cgi?id=22454
     6          <rdar://problem/6405550> REGRESSION (3.2-TOT): Crash below FontFallbackList::fontDataAt on jacobian.org
     7
     8        * http/tests/misc/font-face-in-multiple-segmented-faces-expected.txt: Added.
     9        * http/tests/misc/font-face-in-multiple-segmented-faces.html: Added.
     10
    1112008-11-29  Alexey Proskuryakov  <ap@webkit.org>
    212
  • trunk/WebCore/ChangeLog

    r38842 r38843  
     12008-11-29  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        - fix https://bugs.webkit.org/show_bug.cgi?id=22454
     6          <rdar://problem/6405550> REGRESSION (3.2-TOT): Crash below FontFallbackList::fontDataAt on jacobian.org
     7
     8        Test: http/tests/misc/font-face-in-multiple-segmented-faces.html
     9
     10        The crash happened because style recalculation was invoked by
     11        CSSFontSelector after one CSSSegmentedFontFace had pruned its tables but
     12        before another CSSSegmentedFontFace using the same CSSFontFace had done
     13        so. The fix is to let all CSSSegmentedFontFaces using the CSSFontFace
     14        prune their tables before telling the CSSFontSelector to recalc style.
     15
     16        * css/CSSFontFace.cpp:
     17        (WebCore::CSSFontFace::fontLoaded):
     18        * css/CSSFontSelector.cpp:
     19        (WebCore::CSSFontSelector::fontLoaded):
     20        * css/CSSFontSelector.h:
     21        * css/CSSSegmentedFontFace.cpp:
     22        (WebCore::CSSSegmentedFontFace::fontLoaded):
     23
    1242008-11-29  Alexey Proskuryakov  <ap@webkit.org>
    225
  • trunk/WebCore/css/CSSFontFace.cpp

    r34663 r38843  
    2828
    2929#include "CSSFontFaceSource.h"
     30#include "CSSFontSelector.h"
    3031#include "CSSSegmentedFontFace.h"
    3132#include "FontDescription.h"
     
    7980void CSSFontFace::fontLoaded(CSSFontFaceSource*)
    8081{
     82    // FIXME: Can we assert that m_segmentedFontFaces is not empty? That may
     83    // require stopping in-progress font loading when the last
     84    // CSSSegmentedFontFace is removed.
     85    if (m_segmentedFontFaces.isEmpty())
     86        return;
     87
    8188    HashSet<CSSSegmentedFontFace*>::iterator end = m_segmentedFontFaces.end();
    8289    for (HashSet<CSSSegmentedFontFace*>::iterator it = m_segmentedFontFaces.begin(); it != end; ++it)
    8390        (*it)->fontLoaded(this);
     91
     92    // Use one of the CSSSegmentedFontFaces' font selector. They all have
     93    // the same font selector, so it's wasteful to store it in the CSSFontFace.
     94    CSSFontSelector* fontSelector = (*m_segmentedFontFaces.begin())->fontSelector();
     95    fontSelector->fontLoaded();
    8496}
    8597
  • trunk/WebCore/css/CSSFontSelector.cpp

    r37248 r38843  
    358358}
    359359
    360 void CSSFontSelector::fontLoaded(CSSSegmentedFontFace*)
     360void CSSFontSelector::fontLoaded()
    361361{
    362362    if (!m_document || m_document->inPageCache() || !m_document->renderer())
  • trunk/WebCore/css/CSSFontSelector.h

    r37051 r38843  
    5757    void addFontFaceRule(const CSSFontFaceRule*);
    5858
    59     void fontLoaded(CSSSegmentedFontFace*);
     59    void fontLoaded();
    6060    virtual void fontCacheInvalidated();
    6161
  • trunk/WebCore/css/CSSSegmentedFontFace.cpp

    r34794 r38843  
    8383{
    8484    pruneTable();
    85     m_fontSelector->fontLoaded(this);
    8685}
    8786
Note: See TracChangeset for help on using the changeset viewer.