Commit a9a55e9c authored by pilgrim@chromium.org's avatar pilgrim@chromium.org

[Line Layout API] Add rubyBase to LineLayoutRubyRun

This CL updates all callers in InlineFlowBox.

BUG=499321

Review URL: https://codereview.chromium.org/1312713005

git-svn-id: svn://svn.chromium.org/blink/trunk@201991 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 42e3bce0
...@@ -35,6 +35,11 @@ public: ...@@ -35,6 +35,11 @@ public:
return toRubyRun()->rubyText(); return toRubyRun()->rubyText();
} }
LayoutRubyBase* rubyBase() const
{
return toRubyRun()->rubyBase();
}
private: private:
LayoutRubyRun* toRubyRun() LayoutRubyRun* toRubyRun()
{ {
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "core/layout/LayoutRubyText.h" #include "core/layout/LayoutRubyText.h"
#include "core/layout/LayoutView.h" #include "core/layout/LayoutView.h"
#include "core/layout/api/LineLayoutBox.h" #include "core/layout/api/LineLayoutBox.h"
#include "core/layout/api/LineLayoutRubyRun.h"
#include "core/layout/line/GlyphOverflow.h" #include "core/layout/line/GlyphOverflow.h"
#include "core/layout/line/InlineTextBox.h" #include "core/layout/line/InlineTextBox.h"
#include "core/layout/line/RootInlineBox.h" #include "core/layout/line/RootInlineBox.h"
...@@ -650,7 +651,7 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei ...@@ -650,7 +651,7 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei
else else
hasAnnotationsAfter = true; hasAnnotationsAfter = true;
LayoutRubyRun& rubyRun = toLayoutRubyRun(curr->layoutObject()); LineLayoutRubyRun rubyRun = LineLayoutRubyRun(curr->lineLayoutItem());
if (LayoutRubyBase* rubyBase = rubyRun.rubyBase()) { if (LayoutRubyBase* rubyBase = rubyRun.rubyBase()) {
LayoutUnit bottomRubyBaseLeading = (curr->logicalHeight() - rubyBase->logicalBottom()) + rubyBase->logicalHeight() - (rubyBase->lastRootBox() ? rubyBase->lastRootBox()->lineBottom() : LayoutUnit()); LayoutUnit bottomRubyBaseLeading = (curr->logicalHeight() - rubyBase->logicalBottom()) + rubyBase->logicalHeight() - (rubyBase->lastRootBox() ? rubyBase->lastRootBox()->lineBottom() : LayoutUnit());
LayoutUnit topRubyBaseLeading = rubyBase->logicalTop() + (rubyBase->firstRootBox() ? rubyBase->firstRootBox()->lineTop() : LayoutUnit()); LayoutUnit topRubyBaseLeading = rubyBase->logicalTop() + (rubyBase->firstRootBox() ? rubyBase->firstRootBox()->lineTop() : LayoutUnit());
...@@ -1143,7 +1144,7 @@ LayoutUnit InlineFlowBox::computeOverAnnotationAdjustment(LayoutUnit allowedPosi ...@@ -1143,7 +1144,7 @@ LayoutUnit InlineFlowBox::computeOverAnnotationAdjustment(LayoutUnit allowedPosi
result = std::max(result, toInlineFlowBox(curr)->computeOverAnnotationAdjustment(allowedPosition)); result = std::max(result, toInlineFlowBox(curr)->computeOverAnnotationAdjustment(allowedPosition));
if (curr->layoutObject().isReplaced() && curr->layoutObject().isRubyRun() && curr->layoutObject().style()->rubyPosition() == RubyPositionBefore) { if (curr->layoutObject().isReplaced() && curr->layoutObject().isRubyRun() && curr->layoutObject().style()->rubyPosition() == RubyPositionBefore) {
LayoutRubyRun& rubyRun = toLayoutRubyRun(curr->layoutObject()); LineLayoutRubyRun rubyRun = LineLayoutRubyRun(curr->lineLayoutItem());
LayoutRubyText* rubyText = rubyRun.rubyText(); LayoutRubyText* rubyText = rubyRun.rubyText();
if (!rubyText) if (!rubyText)
continue; continue;
...@@ -1191,7 +1192,7 @@ LayoutUnit InlineFlowBox::computeUnderAnnotationAdjustment(LayoutUnit allowedPos ...@@ -1191,7 +1192,7 @@ LayoutUnit InlineFlowBox::computeUnderAnnotationAdjustment(LayoutUnit allowedPos
result = std::max(result, toInlineFlowBox(curr)->computeUnderAnnotationAdjustment(allowedPosition)); result = std::max(result, toInlineFlowBox(curr)->computeUnderAnnotationAdjustment(allowedPosition));
if (curr->layoutObject().isReplaced() && curr->layoutObject().isRubyRun() && curr->layoutObject().style()->rubyPosition() == RubyPositionAfter) { if (curr->layoutObject().isReplaced() && curr->layoutObject().isRubyRun() && curr->layoutObject().style()->rubyPosition() == RubyPositionAfter) {
LayoutRubyRun& rubyRun = toLayoutRubyRun(curr->layoutObject()); LineLayoutRubyRun rubyRun = LineLayoutRubyRun(curr->lineLayoutItem());
LayoutRubyText* rubyText = rubyRun.rubyText(); LayoutRubyText* rubyText = rubyRun.rubyText();
if (!rubyText) if (!rubyText)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment