Changeset 181387 in webkit
- Timestamp:
- Mar 11, 2015, 7:41:01 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/text/baseline-inline-block-block-children-expected.html (added)
-
LayoutTests/fast/text/baseline-inline-block-block-children.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderBlockFlow.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r181367 r181387 1 2015-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 1 11 2015-03-10 Joseph Pecoraro <pecoraro@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r181385 r181387 1 2015-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 1 15 2015-03-11 Carlos Alberto Lopez Perez <clopez@igalia.com> 2 16 -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r181292 r181387 3012 3012 return -1; 3013 3013 3014 if (!childrenInline())3015 return RenderBlock::inlineBlockBaseline(lineDirection);3016 3017 if (!hasLines()) {3018 if (!hasLineIfEmpty())3019 return -1;3020 const FontMetrics& fontMetrics = firstLineStyle().fontMetrics();3021 return fontMetrics.ascent()3022 + (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - fontMetrics.height()) / 23023 + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight());3024 }3025 3026 3014 // Note that here we only take the left and bottom into consideration. Our caller takes the right and top into consideration. 3027 3015 float boxHeight = lineDirection == HorizontalLine ? height() + m_marginBox.bottom() : width() + m_marginBox.left(); 3028 3016 float lastBaseline; 3029 if ( auto simpleLineLayout = this->simpleLineLayout())3030 lastBaseline = SimpleLineLayout::computeFlowLastLineBaseline(*this, *simpleLineLayout);3017 if (!childrenInline()) 3018 lastBaseline = RenderBlock::inlineBlockBaseline(lineDirection); 3031 3019 else { 3032 bool isFirstLine = lastRootBox() == firstRootBox(); 3033 const RenderStyle& style = isFirstLine ? firstLineStyle() : this->style(); 3034 lastBaseline = lastRootBox()->logicalTop() + style.fontMetrics().ascent(lastRootBox()->baselineType()); 3020 if (!hasLines()) { 3021 if (!hasLineIfEmpty()) 3022 return -1; 3023 const auto& fontMetrics = firstLineStyle().fontMetrics(); 3024 return fontMetrics.ascent() 3025 + (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - fontMetrics.height()) / 2 3026 + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight()); 3027 } 3028 3029 if (auto simpleLineLayout = this->simpleLineLayout()) 3030 lastBaseline = SimpleLineLayout::computeFlowLastLineBaseline(*this, *simpleLineLayout); 3031 else { 3032 bool isFirstLine = lastRootBox() == firstRootBox(); 3033 const auto& style = isFirstLine ? firstLineStyle() : this->style(); 3034 lastBaseline = lastRootBox()->logicalTop() + style.fontMetrics().ascent(lastRootBox()->baselineType()); 3035 } 3035 3036 } 3036 3037 // 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.