Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Unified Diff: third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp

Issue 1910053003: Get the right ascent/descent for the tallest vertically aligned container (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@396717-4
Patch Set: Updated Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/transforms/svg-vs-css-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
index 7a1b4dbb2d2f62435dcd1f6fd6cc7680cfffc2ef..18e37831e5e76d6fcce75e04d7bcb52fd593fcd8 100644
--- a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
+++ b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
@@ -460,13 +460,15 @@ FontBaseline InlineFlowBox::dominantBaseline() const
void InlineFlowBox::adjustMaxAscentAndDescent(int& maxAscent, int& maxDescent, int maxPositionTop, int maxPositionBottom)
{
+ int originalMaxAscent = maxAscent;
+ int originalMaxDescent = maxDescent;
for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
// The computed lineheight needs to be extended for the
// positioned elements
if (curr->getLineLayoutItem().isOutOfFlowPositioned())
continue; // Positioned placeholders don't affect calculations.
if (curr->verticalAlign() == VerticalAlignTop || curr->verticalAlign() == VerticalAlignBottom) {
- int lineHeight = curr->lineHeight();
+ int lineHeight = curr->lineHeight().round();
if (curr->verticalAlign() == VerticalAlignTop) {
if (maxAscent + maxDescent < lineHeight)
maxDescent = lineHeight - maxAscent;
@@ -477,6 +479,8 @@ void InlineFlowBox::adjustMaxAscentAndDescent(int& maxAscent, int& maxDescent, i
if (maxAscent + maxDescent >= std::max(maxPositionTop, maxPositionBottom))
break;
+ maxAscent = originalMaxAscent;
+ maxDescent = originalMaxDescent;
}
if (curr->isInlineFlowBox())
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/transforms/svg-vs-css-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698