Changeset 149450 in webkit


Ignore:
Timestamp:
May 1, 2013, 1:37:04 PM (12 years ago)
Author:
enrica@apple.com
Message:

Incorrect layout for blocks containing ideographs with -webkit-linebox-contain: glyphs, font, inline-box.
https://bugs.webkit.org/show_bug.cgi?id=115478.

Reviewed by Dave Hyatt.

Source/WebCore:

Test: fast/block/lineboxcontain/block-with-ideographs.xhtml

When computing ascent and descent we need to take into account
the baseline type. RootInlineBox::ascentAndDescentForBox failed
to do that in few cases.

  • rendering/RootInlineBox.cpp:

(WebCore::RootInlineBox::ascentAndDescentForBox):

LayoutTests:

  • fast/block/lineboxcontain/block-with-ideographs.xhtml: Added.
  • platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.txt: Added.
  • platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.png : Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r149436 r149450  
     12013-05-01  Enrica Casucci  <enrica@apple.com>
     2
     3        Incorrect layout for blocks containing ideographs with -webkit-linebox-contain: glyphs, font, inline-box.
     4        https://bugs.webkit.org/show_bug.cgi?id=115478.
     5
     6        Reviewed by Dave Hyatt.
     7
     8        * fast/block/lineboxcontain/block-with-ideographs.xhtml: Added.
     9        * platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.txt: Added.
     10        * platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.png : Added.
     11
    1122013-05-01  Per-Erik Brodin  <per-erik.brodin@ericsson.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r149449 r149450  
     12013-05-01  Enrica Casucci  <enrica@apple.com>
     2
     3        Incorrect layout for blocks containing ideographs with -webkit-linebox-contain: glyphs, font, inline-box.
     4        https://bugs.webkit.org/show_bug.cgi?id=115478.
     5
     6        Reviewed by Dave Hyatt.
     7
     8        Test: fast/block/lineboxcontain/block-with-ideographs.xhtml
     9
     10        When computing ascent and descent we need to take into account
     11        the baseline type. RootInlineBox::ascentAndDescentForBox failed
     12        to do that in few cases.
     13
     14        * rendering/RootInlineBox.cpp:
     15        (WebCore::RootInlineBox::ascentAndDescentForBox):
     16
    1172013-05-01  Anders Carlsson  <andersca@apple.com>
    218
  • trunk/Source/WebCore/rendering/RootInlineBox.cpp

    r149007 r149450  
    844844   
    845845    if (includeFontForBox(box) && !setUsedFont) {
    846         int fontAscent = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent();
    847         int fontDescent = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent();
     846        int fontAscent = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent(baselineType());
     847        int fontDescent = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent(baselineType());
    848848        setAscentAndDescent(ascent, descent, fontAscent, fontDescent, ascentDescentSet);
    849849        affectsAscent = fontAscent - box->logicalTop() > 0;
     
    855855        affectsAscent = glyphOverflow->top - box->logicalTop() > 0;
    856856        affectsDescent = glyphOverflow->bottom + box->logicalTop() > 0;
    857         glyphOverflow->top = min(glyphOverflow->top, max(0, glyphOverflow->top - box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent()));
    858         glyphOverflow->bottom = min(glyphOverflow->bottom, max(0, glyphOverflow->bottom - box->renderer()->style(isFirstLineStyle())->fontMetrics().descent()));
     857        glyphOverflow->top = min(glyphOverflow->top, max(0, glyphOverflow->top - box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent(baselineType())));
     858        glyphOverflow->bottom = min(glyphOverflow->bottom, max(0, glyphOverflow->bottom - box->renderer()->style(isFirstLineStyle())->fontMetrics().descent(baselineType())));
    859859    }
    860860
    861861    if (includeMarginForBox(box)) {
    862         LayoutUnit ascentWithMargin = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent();
    863         LayoutUnit descentWithMargin = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent();
     862        LayoutUnit ascentWithMargin = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent(baselineType());
     863        LayoutUnit descentWithMargin = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent(baselineType());
    864864        if (box->parent() && !box->renderer()->isText()) {
    865865            ascentWithMargin += box->boxModelObject()->borderBefore() + box->boxModelObject()->paddingBefore() + box->boxModelObject()->marginBefore();
Note: See TracChangeset for help on using the changeset viewer.