⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 176527 in webkit


Ignore:
Timestamp:
Nov 24, 2014, 4:10:17 PM (12 years ago)
Author:
Alan Bujtas
Message:

SimpleLineLayout::canUseFor() should iterate through RenderTexts to check if their content is eligible for simple line layout.
https://bugs.webkit.org/show_bug.cgi?id=139007

Reviewed by Antti Koivisto.

Source/WebCore:

Tests: fast/text/simple-line-layout-multiple-renderers-non-breaking-space.html

fast/text/simple-line-layout-multiple-renderers-with-float.html

  • rendering/SimpleLineLayout.cpp:

(WebCore::SimpleLineLayout::canUseFor):

LayoutTests:

  • fast/text/simple-line-layout-multiple-renderers-non-breaking-space-expected.html: Added.
  • fast/text/simple-line-layout-multiple-renderers-non-breaking-space.html: Added.
  • fast/text/simple-line-layout-multiple-renderers-with-float-expected.html: Added.
  • fast/text/simple-line-layout-multiple-renderers-with-float.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r176525 r176527  
     12014-11-24  Zalan Bujtas  <zalan@apple.com>
     2
     3        SimpleLineLayout::canUseFor() should iterate through RenderTexts to check if their content is eligible for simple line layout.
     4        https://bugs.webkit.org/show_bug.cgi?id=139007
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/text/simple-line-layout-multiple-renderers-non-breaking-space-expected.html: Added.
     9        * fast/text/simple-line-layout-multiple-renderers-non-breaking-space.html: Added.
     10        * fast/text/simple-line-layout-multiple-renderers-with-float-expected.html: Added.
     11        * fast/text/simple-line-layout-multiple-renderers-with-float.html: Added.
     12
    1132014-11-24  Zalan Bujtas  <zalan@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r176524 r176527  
     12014-11-24  Zalan Bujtas  <zalan@apple.com>
     2
     3        SimpleLineLayout::canUseFor() should iterate through RenderTexts to check if their content is eligible for simple line layout.
     4        https://bugs.webkit.org/show_bug.cgi?id=139007
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Tests: fast/text/simple-line-layout-multiple-renderers-non-breaking-space.html
     9               fast/text/simple-line-layout-multiple-renderers-with-float.html
     10
     11        * rendering/SimpleLineLayout.cpp:
     12        (WebCore::SimpleLineLayout::canUseFor):
     13
    1142014-11-22  Sam Weinig  <sam@webkit.org>
    215
  • trunk/Source/WebCore/rendering/SimpleLineLayout.cpp

    r176521 r176527  
    164164    if (style.lineBreak() != LineBreakAuto)
    165165        return false;
    166     const RenderText& textRenderer = downcast<RenderText>(*flow.firstChild());
     166
     167    // We can't use the code path if any lines would need to be shifted below floats. This is because we don't keep per-line y coordinates.
    167168    if (flow.containsFloats()) {
    168         // We can't use the code path if any lines would need to be shifted below floats. This is because we don't keep per-line y coordinates.
    169         float minimumWidthNeeded = textRenderer.minLogicalWidth();
     169        float minimumWidthNeeded = std::numeric_limits<float>::max();
     170        for (const auto& textRenderer : childrenOfType<RenderText>(flow))
     171            minimumWidthNeeded = std::min(minimumWidthNeeded, textRenderer.minLogicalWidth());
     172
    170173        for (auto& floatRenderer : *flow.floatingObjectSet()) {
    171174            ASSERT(floatRenderer);
     
    175178        }
    176179    }
    177     if (textRenderer.isCombineText() || textRenderer.isCounter() || textRenderer.isQuote() || textRenderer.isTextFragment()
    178         || textRenderer.isSVGInlineText())
    179         return false;
    180     if (style.font().codePath(TextRun(textRenderer.text())) != Font::Simple)
    181         return false;
    182180    if (style.font().primaryFont()->isSVGFont())
    183181        return false;
    184 
    185182    // We assume that all lines have metrics based purely on the primary font.
    186183    auto& primaryFontData = *style.font().primaryFont();
    187184    if (primaryFontData.isLoading())
    188185        return false;
    189     if (!canUseForText(textRenderer, primaryFontData))
    190         return false;
    191 
     186    for (const auto& textRenderer : childrenOfType<RenderText>(flow)) {
     187        if (textRenderer.isCombineText() || textRenderer.isCounter() || textRenderer.isQuote() || textRenderer.isTextFragment()
     188            || textRenderer.isSVGInlineText())
     189            return false;
     190        if (style.font().codePath(TextRun(textRenderer.text())) != Font::Simple)
     191            return false;
     192        if (!canUseForText(textRenderer, primaryFontData))
     193            return false;
     194    }
    192195    return true;
    193196}
Note: See TracChangeset for help on using the changeset viewer.