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

Unified Diff: sky/engine/core/rendering/RenderFlexibleBox.cpp

Issue 1200233002: Use the baseline information exposed by C++ to pipe baseline data through RenderBox. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 | « sky/engine/core/rendering/RenderFlexibleBox.h ('k') | sky/engine/core/rendering/RenderParagraph.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderFlexibleBox.cpp
diff --git a/sky/engine/core/rendering/RenderFlexibleBox.cpp b/sky/engine/core/rendering/RenderFlexibleBox.cpp
index bfd8e9775d37444bfce59cd9ec3aa609c52ceca1..629f1c001c9281a008012d8b57e62343f4de6781 100644
--- a/sky/engine/core/rendering/RenderFlexibleBox.cpp
+++ b/sky/engine/core/rendering/RenderFlexibleBox.cpp
@@ -119,14 +119,14 @@ static int synthesizedBaselineFromContentBox(const RenderBox* box, LineDirection
int RenderFlexibleBox::baselinePosition(FontBaseline, bool, LineDirectionMode direction, LinePositionMode mode) const
{
ASSERT(mode == PositionOnContainingLine);
- int baseline = firstLineBoxBaseline();
+ int baseline = firstLineBoxBaseline(FontBaselineOrAuto());
if (baseline == -1)
baseline = synthesizedBaselineFromContentBox(this, direction);
return beforeMarginInLineDirection(direction) + baseline;
}
-int RenderFlexibleBox::firstLineBoxBaseline() const
+int RenderFlexibleBox::firstLineBoxBaseline(FontBaselineOrAuto baselineType) const
{
if (m_numberOfInFlowChildrenOnFirstLine <= 0)
return -1;
@@ -155,7 +155,7 @@ int RenderFlexibleBox::firstLineBoxBaseline() const
if (isColumnFlow() && !hasOrthogonalFlow(baselineChild))
return mainAxisExtentForChild(baselineChild) + baselineChild->logicalTop();
- int baseline = baselineChild->firstLineBoxBaseline();
+ int baseline = baselineChild->firstLineBoxBaseline(baselineType);
if (baseline == -1) {
// FIXME: We should pass |direction| into firstLineBoxBaseline and stop bailing out if we're a writing mode root.
// This would also fix some cases where the flexbox is orthogonal to its container.
@@ -168,7 +168,7 @@ int RenderFlexibleBox::firstLineBoxBaseline() const
int RenderFlexibleBox::inlineBlockBaseline(LineDirectionMode direction) const
{
- int baseline = firstLineBoxBaseline();
+ int baseline = firstLineBoxBaseline(FontBaselineOrAuto());
if (baseline != -1)
return baseline;
@@ -680,7 +680,7 @@ bool RenderFlexibleBox::updateAutoMarginsInCrossAxis(RenderBox* child, LayoutUni
LayoutUnit RenderFlexibleBox::marginBoxAscentForChild(RenderBox* child)
{
- LayoutUnit ascent = child->firstLineBoxBaseline();
+ LayoutUnit ascent = child->firstLineBoxBaseline(FontBaselineOrAuto());
if (ascent == -1)
ascent = crossAxisExtentForChild(child);
return ascent + flowAwareMarginBeforeForChild(child);
« no previous file with comments | « sky/engine/core/rendering/RenderFlexibleBox.h ('k') | sky/engine/core/rendering/RenderParagraph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698