Changeset 147156 in webkit


Ignore:
Timestamp:
Mar 28, 2013 2:03:44 PM (11 years ago)
Author:
leviw@chromium.org
Message:

Source/WebCore: Enable font measurement optimization for Chromium-mac when there are no font-feature-settings.

Enable measure-once optimization on Chromium-Mac
https://bugs.webkit.org/show_bug.cgi?id=113243

Reviewed by Eric Seidel.

Bugs in Chromium-mac's -webkit-font-feature-settings support prevented us from enabling the
optimization when it was enabled for all other platforms. This was believed to be related to
kerning, but the bug shows up when there are any font-feature-settings specified. For now,
optimizing the common case and only turning off the optimization when there are font-feature-
settings in play.

Updated test fast/text/shaping/shaping-selection-rect.html to avoid breaking due to
https://bugs.webkit.org/show_bug.cgi?id=113418

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::setLogicalWidthForTextRun):

LayoutTests: Disable font measurement optimization for Chromium-mac when there are font-feature-settings.

Enable measure-once optimization on Chromium-Mac
https://bugs.webkit.org/show_bug.cgi?id=113243

Reviewed by Eric Seidel.

  • fast/text/shaping/shaping-selection-rect.html: Adding a small-caps case to prevent regressing

due to https://bugs.webkit.org/show_bug.cgi?id=113418.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147155 r147156  
     12013-03-28  Levi Weintraub  <leviw@chromium.org>
     2
     3        Disable font measurement optimization for Chromium-mac when there are font-feature-settings.
     4
     5        Enable measure-once optimization on Chromium-Mac
     6        https://bugs.webkit.org/show_bug.cgi?id=113243
     7
     8        Reviewed by Eric Seidel.
     9
     10        * fast/text/shaping/shaping-selection-rect.html: Adding a small-caps case to prevent regressing
     11        due to https://bugs.webkit.org/show_bug.cgi?id=113418.
     12
    1132013-03-28  Zoltan Horvath  <zoltan@webkit.org>
    214
  • trunk/LayoutTests/fast/text/shaping/shaping-selection-rect.html

    r122562 r147156  
    22<head>
    33<style>
    4     #target {
     4    div {
    55        font-family: "times new roman"; /* non AAT font on mac */
     6    }
     7    span {
     8        direction: rtl;
     9        unicode-bidi: bidi-override;
     10    }
     11    #kerning {
    612        -webkit-font-feature-settings: 'kern';
    7     };
     13    }
     14    #smallcaps {
     15        -webkit-font-feature-settings: 'smcp';
     16    }
    817</style>
    918<script>
    1019function test()
    1120{
    12     var targetText = document.getElementById("target").firstChild;
    13     window.getSelection().setBaseAndExtent(target, 0, target, 9);
     21    var start = document.getElementById("kerning").firstChild;
     22    var end = document.getElementById("smallcaps").lastChild;
     23    window.getSelection().setBaseAndExtent(start, 0, end, 3);
    1424}
    1525</script>
    1626</head>
    1727<body onload="test()">
    18 <p>The selection should cover the all of the below text. There should be no blank between C and F.
    19 <div id="target">
    20 ABC<span style="direction: rtl; unicode-bidi: bidi-override;">DEF</span>GHI
     28<p>The selection should cover the all of the below text. There should be no blank between either C and F.
     29<div id="kerning">
     30ABC<span>DEF</span>GHI
     31</div>
     32<div id="smallcaps">
     33ABC<span>DEF</span>GHI
    2134</div>
    2235</body>
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r147149 r147156  
    37643764webkit.org/b/112369 [ Debug ] inspector/debugger/pause-in-inline-script.html [ Pass Crash Timeout ]
    37653765
     3766# Needs rebaseline on all platforms
     3767Bug(leviw) fast/text/shaping/shaping-selection-rect.html [ Failure ]
     3768
    37663769# Flaky tests
    37673770webkit.org/b/112598 [ Win Mac Linux ] http/tests/security/mixedContent/insecure-audio-video-in-main-frame.html [ Failure Pass ]
  • trunk/Source/WebCore/ChangeLog

    r147155 r147156  
     12013-03-28  Levi Weintraub  <leviw@chromium.org>
     2
     3        Enable font measurement optimization for Chromium-mac when there are no font-feature-settings.
     4
     5        Enable measure-once optimization on Chromium-Mac
     6        https://bugs.webkit.org/show_bug.cgi?id=113243
     7
     8        Reviewed by Eric Seidel.
     9
     10        Bugs in Chromium-mac's -webkit-font-feature-settings support prevented us from enabling the
     11        optimization when it was enabled for all other platforms. This was believed to be related to
     12        kerning, but the bug shows up when there are any font-feature-settings specified. For now,
     13        optimizing the common case and only turning off the optimization when there are font-feature-
     14        settings in play.
     15
     16        Updated test fast/text/shaping/shaping-selection-rect.html to avoid breaking due to
     17        https://bugs.webkit.org/show_bug.cgi?id=113418
     18
     19        * rendering/RenderBlockLineLayout.cpp:
     20        (WebCore::setLogicalWidthForTextRun):
     21
    1222013-03-28  Zoltan Horvath  <zoltan@webkit.org>
    223
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r147155 r147156  
    785785                                             GlyphOverflowAndFallbackFontsMap& textBoxDataMap, VerticalPositionCache& verticalPositionCache, WordMeasurements& wordMeasurements)
    786786{
    787 #if !(PLATFORM(CHROMIUM) && OS(DARWIN))
    788     UNUSED_PARAM(wordMeasurements);
    789 #endif
    790787    HashSet<const SimpleFontData*> fallbackFonts;
    791788    GlyphOverflow glyphOverflow;
     
    813810    float measuredWidth = 0;
    814811
    815 #if !(PLATFORM(CHROMIUM) && OS(DARWIN))
    816812    bool kerningIsEnabled = font.typesettingFeatures() & Kerning;
     813
     814#if PLATFORM(CHROMIUM) && OS(DARWIN)
     815    // FIXME: Having any font feature settings enabled can lead to selection gaps on
     816    // Chromium-mac. https://bugs.webkit.org/show_bug.cgi?id=113418
     817    bool canUseSimpleFontCodePath = renderer->canUseSimpleFontCodePath() && !font.fontDescription().featureSettings();
     818#else
     819    bool canUseSimpleFontCodePath = renderer->canUseSimpleFontCodePath();
     820#endif
    817821   
    818822    // Since we don't cache glyph overflows, we need to re-measure the run if
    819823    // the style is linebox-contain: glyph.
    820824   
    821     if (!lineBox->fitsToGlyphs() && renderer->canUseSimpleFontCodePath()) {
     825    if (!lineBox->fitsToGlyphs() && canUseSimpleFontCodePath) {
    822826        int lastEndOffset = run->m_start;
    823827        for (size_t i = 0, size = wordMeasurements.size(); i < size && lastEndOffset < run->m_stop; ++i) {
     
    848852        }
    849853    }
    850 #endif
    851854
    852855    if (!measuredWidth)
Note: See TracChangeset for help on using the changeset viewer.