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

Changeset 181528 in webkit


Ignore:
Timestamp:
Mar 16, 2015, 1:42:25 AM (11 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r181387 - Inline block children do not have correct baselines if their children are also block elements
https://bugs.webkit.org/show_bug.cgi?id=142559

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2015-03-11
Reviewed by Darin Adler.

Source/WebCore:

Perform the same computation on child block elements as child inline elements.

Test: fast/text/baseline-inline-block-block-children.html

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::inlineBlockBaseline):

LayoutTests:

  • fast/text/baseline-inline-block-block-children-expected.html: Added.
  • fast/text/baseline-inline-block-block-children.html: Added.
Location:
releases/WebKitGTK/webkit-2.8
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog

    r181370 r181528  
     12015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Inline block children do not have correct baselines if their children are also block elements
     4        https://bugs.webkit.org/show_bug.cgi?id=142559
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/text/baseline-inline-block-block-children-expected.html: Added.
     9        * fast/text/baseline-inline-block-block-children.html: Added.
     10
    1112015-03-09  Myles C. Maxfield  <mmaxfield@apple.com>
    212
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog

    r181527 r181528  
     12015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Inline block children do not have correct baselines if their children are also block elements
     4        https://bugs.webkit.org/show_bug.cgi?id=142559
     5
     6        Reviewed by Darin Adler.
     7
     8        Perform the same computation on child block elements as child inline elements.
     9
     10        Test: fast/text/baseline-inline-block-block-children.html
     11
     12        * rendering/RenderBlockFlow.cpp:
     13        (WebCore::RenderBlockFlow::inlineBlockBaseline):
     14
    1152015-03-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
    216
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/RenderBlockFlow.cpp

    r181370 r181528  
    30033003        return -1;
    30043004
    3005     if (!childrenInline())
    3006         return RenderBlock::inlineBlockBaseline(lineDirection);
    3007 
    3008     if (!hasLines()) {
    3009         if (!hasLineIfEmpty())
    3010             return -1;
    3011         const FontMetrics& fontMetrics = firstLineStyle().fontMetrics();
    3012         return fontMetrics.ascent()
    3013              + (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - fontMetrics.height()) / 2
    3014              + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight());
    3015     }
    3016 
    30173005    // Note that here we only take the left and bottom into consideration. Our caller takes the right and top into consideration.
    30183006    float boxHeight = lineDirection == HorizontalLine ? height() + m_marginBox.bottom() : width() + m_marginBox.left();
    30193007    float lastBaseline;
    3020     if (auto simpleLineLayout = this->simpleLineLayout())
    3021         lastBaseline = SimpleLineLayout::computeFlowLastLineBaseline(*this, *simpleLineLayout);
     3008    if (!childrenInline())
     3009        lastBaseline = RenderBlock::inlineBlockBaseline(lineDirection);
    30223010    else {
    3023         bool isFirstLine = lastRootBox() == firstRootBox();
    3024         const RenderStyle& style = isFirstLine ? firstLineStyle() : this->style();
    3025         lastBaseline = lastRootBox()->logicalTop() + style.fontMetrics().ascent(lastRootBox()->baselineType());
     3011        if (!hasLines()) {
     3012            if (!hasLineIfEmpty())
     3013                return -1;
     3014            const auto& fontMetrics = firstLineStyle().fontMetrics();
     3015            return fontMetrics.ascent()
     3016                + (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - fontMetrics.height()) / 2
     3017                + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight());
     3018        }
     3019
     3020        if (auto simpleLineLayout = this->simpleLineLayout())
     3021            lastBaseline = SimpleLineLayout::computeFlowLastLineBaseline(*this, *simpleLineLayout);
     3022        else {
     3023            bool isFirstLine = lastRootBox() == firstRootBox();
     3024            const auto& style = isFirstLine ? firstLineStyle() : this->style();
     3025            lastBaseline = lastRootBox()->logicalTop() + style.fontMetrics().ascent(lastRootBox()->baselineType());
     3026        }
    30263027    }
    30273028    // According to the CSS spec http://www.w3.org/TR/CSS21/visudet.html, we shouldn't be performing this min, but should
Note: See TracChangeset for help on using the changeset viewer.