Changeset 158085 in webkit


Ignore:
Timestamp:
Oct 26, 2013 8:44:26 AM (10 years ago)
Author:
Antti Koivisto
Message:

Source/WebCore: fast/frames/seamless/seamless-nested-crash.html asserts on wk2 only
https://bugs.webkit.org/show_bug.cgi?id=123354

Reviewed by Andreas Kling.

  • rendering/SimpleLineLayout.cpp:

(WebCore::SimpleLineLayout::canUseFor):

Don't enable simple line layout if the primary font is loading. The code expects
to use the primary font metrics for all lines but those won't match the fallbacks
when font is not loaded.

LayoutTests: fast/frames/seamless/seamless-nested-crash.html asserts on wk2 only
https://bugs.webkit.org/show_bug.cgi?id=123354

Reviewed by Andreas Kling.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r158078 r158085  
     12013-10-26  Antti Koivisto  <antti@apple.com>
     2
     3        fast/frames/seamless/seamless-nested-crash.html asserts on wk2 only
     4        https://bugs.webkit.org/show_bug.cgi?id=123354
     5       
     6        Reviewed by Andreas Kling.
     7
     8        * TestExpectations: Remove failure expectation
     9
    1102013-10-25  Alexey Proskuryakov  <ap@apple.com>
    211
  • trunk/LayoutTests/TestExpectations

    r158031 r158085  
    7676webkit.org/b/122679 security/crypto-subtle-gc-2.html [ Skip ]
    7777webkit.org/b/122679 security/crypto-subtle-gc-3.html [ Skip ]
    78 
    79 # hits simple line layout sanity check assert
    80 webkit.org/b/123354 fast/frames/seamless/seamless-nested-crash.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r158083 r158085  
     12013-10-26  Antti Koivisto  <antti@apple.com>
     2
     3        fast/frames/seamless/seamless-nested-crash.html asserts on wk2 only
     4        https://bugs.webkit.org/show_bug.cgi?id=123354
     5
     6        Reviewed by Andreas Kling.
     7
     8        * rendering/SimpleLineLayout.cpp:
     9        (WebCore::SimpleLineLayout::canUseFor):
     10       
     11            Don't enable simple line layout if the primary font is loading. The code expects
     12            to use the primary font metrics for all lines but those won't match the fallbacks
     13            when font is not loaded.
     14
    1152013-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
    216
  • trunk/Source/WebCore/css/CSSFontFaceSource.cpp

    r157924 r158085  
    116116                       | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0);
    117117
    118     RefPtr<SimpleFontData>& fontData = m_fontDataTable.add(hashKey, nullptr).iterator->value;
     118    RefPtr<SimpleFontData> fontData = m_fontDataTable.add(hashKey, nullptr).iterator->value;
    119119    if (fontData)
    120         return fontData; // No release, because fontData is a reference to a RefPtr that is held in the m_fontDataTable.
     120        return fontData.release();
    121121
    122122    // If we are still loading, then we let the system pick a font.
     
    171171        fontSelector->beginLoadingFontSoon(m_font.get());
    172172
    173         // This temporary font is not retained and should not be returned.
    174         FontCachePurgePreventer fontCachePurgePreventer;
    175         SimpleFontData* temporaryFont = fontCache()->getNonRetainedLastResortFallbackFont(fontDescription);
    176         fontData = SimpleFontData::create(temporaryFont->platformData(), true, true);
     173        RefPtr<SimpleFontData> fallback = fontSelector->userStandardFont(fontDescription);
     174        if (!fallback)
     175            fallback = fontCache()->getLastResortFallbackFont(fontDescription);
     176        fontData = SimpleFontData::create(fallback->platformData(), /*isCustomFont*/ true, /*isLoading*/ true);
    177177    }
    178178
    179     return fontData; // No release, because fontData is a reference to a RefPtr that is held in the m_fontDataTable.
     179    return fontData.release();
    180180}
    181181
  • trunk/Source/WebCore/css/CSSFontSelector.cpp

    r157971 r158085  
    364364}
    365365
    366 static PassRefPtr<FontData> fontDataForGenericFamily(Document* document, const FontDescription& fontDescription, const AtomicString& familyName)
     366static PassRefPtr<SimpleFontData> fontDataForGenericFamily(Document* document, const FontDescription& fontDescription, const AtomicString& familyName)
    367367{
    368368    if (!document || !document->frame())
     
    392392        return fontCache()->getCachedFontData(fontDescription, genericFamily);
    393393
    394     return 0;
     394    return nullptr;
    395395}
    396396
     
    477477}
    478478
     479PassRefPtr<SimpleFontData> CSSFontSelector::userStandardFont(const FontDescription& description)
     480{
     481    return fontDataForGenericFamily(m_document, description, standardFamily);
     482}
     483
    479484PassRefPtr<FontData> CSSFontSelector::getFontData(const FontDescription& fontDescription, const AtomicString& familyName)
    480485{
     
    483488            return fontDataForGenericFamily(m_document, fontDescription, familyName);
    484489        if (fontDescription.genericFamily() == FontDescription::StandardFamily && !fontDescription.isSpecifiedFont())
    485             return fontDataForGenericFamily(m_document, fontDescription, "-webkit-standard");
     490            return fontDataForGenericFamily(m_document, fontDescription, standardFamily);
    486491        return 0;
    487492    }
     
    493498        // settings.
    494499        if (fontDescription.genericFamily() == FontDescription::StandardFamily && !fontDescription.isSpecifiedFont())
    495             return fontDataForGenericFamily(m_document, fontDescription, "-webkit-standard");
     500            return fontDataForGenericFamily(m_document, fontDescription, standardFamily);
    496501        return fontDataForGenericFamily(m_document, fontDescription, familyName);
    497502    }
  • trunk/Source/WebCore/css/CSSFontSelector.h

    r157653 r158085  
    6161    virtual PassRefPtr<FontData> getFallbackFontData(const FontDescription&, size_t) OVERRIDE;
    6262    CSSSegmentedFontFace* getFontFace(const FontDescription&, const AtomicString& family);
     63    virtual PassRefPtr<SimpleFontData> userStandardFont(const FontDescription&) OVERRIDE;
    6364
    6465    virtual bool resolvesFamilyFor(const FontDescription&) const OVERRIDE;
  • trunk/Source/WebCore/rendering/SimpleLineLayout.cpp

    r158012 r158085  
    150150        return false;
    151151
    152     auto primaryFontData = style.font().primaryFont();
     152    // We assume that all lines have metrics based purely on the primary font.
     153    auto& primaryFontData = *style.font().primaryFont();
     154    if (primaryFontData.isLoading())
     155        return false;
    153156
    154157    unsigned length = textRenderer.textLength();
     
    158161        // This is because we don't currently do subruns within lines. Fixing this would improve coverage significantly.
    159162        UChar character = textRenderer.characterAt(i);
    160         if (isWhitespace(character))
     163        if (isWhitespace(character)) {
    161164            ++consecutiveSpaceCount;
    162         else {
    163             if (consecutiveSpaceCount != i && consecutiveSpaceCount > 1)
    164                 return false;
    165             consecutiveSpaceCount = 0;
     165            continue;
    166166        }
     167        if (consecutiveSpaceCount != i && consecutiveSpaceCount > 1)
     168            return false;
     169        consecutiveSpaceCount = 0;
     170
    167171        // These would be easy to support.
    168172        if (character == noBreakSpace)
     
    179183                return false;
    180184        }
    181         if (!primaryFontData->glyphForCharacter(character))
     185
     186        if (!primaryFontData.glyphForCharacter(character))
    182187            return false;
    183188    }
Note: See TracChangeset for help on using the changeset viewer.