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

Unified Diff: Source/core/layout/LayoutText.cpp

Issue 1330433003: [Line Layout API] Add textStartOffset to LineLayoutText (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ignore previous patch, review hypnotoad Created 5 years, 3 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 | « no previous file | Source/core/layout/api/LineLayoutText.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutText.cpp
diff --git a/Source/core/layout/LayoutText.cpp b/Source/core/layout/LayoutText.cpp
index 173f6e38383864d60c045507b7850c1b804340e4..96f7d6baf55ccb9db8bb1fb47cd94b849733ea88 100644
--- a/Source/core/layout/LayoutText.cpp
+++ b/Source/core/layout/LayoutText.cpp
@@ -35,6 +35,7 @@
#include "core/layout/LayoutBlock.h"
#include "core/layout/LayoutTextCombine.h"
#include "core/layout/LayoutView.h"
+#include "core/layout/api/LineLayoutBox.h"
#include "core/layout/line/AbstractInlineTextBox.h"
#include "core/layout/line/EllipsisBox.h"
#include "core/layout/line/GlyphOverflow.h"
@@ -523,7 +524,7 @@ static PositionWithAffinity createPositionWithAffinityForBox(const InlineBox* bo
affinity = offset > box->caretMinOffset() ? VP_UPSTREAM_IF_POSSIBLE : TextAffinity::Downstream;
break;
}
- int textStartOffset = box->layoutObject().isText() ? toLayoutText(box->layoutObject()).textStartOffset() : 0;
+ int textStartOffset = box->lineLayoutItem().isText() ? LineLayoutText(box->lineLayoutItem()).textStartOffset() : 0;
return box->layoutObject().createPositionWithAffinity(offset + textStartOffset, affinity);
}
@@ -541,7 +542,7 @@ static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffset
const InlineBox* prevBox = box->prevLeafChildIgnoringLineBreak();
if ((prevBox && prevBox->bidiLevel() == box->bidiLevel())
- || box->layoutObject().containingBlock()->style()->direction() == box->direction()) // FIXME: left on 12CBA
+ || box->lineLayoutItem().containingBlock().style()->direction() == box->direction()) // FIXME: left on 12CBA
return createPositionWithAffinityForBox(box, box->caretLeftmostOffset(), shouldAffinityBeDownstream);
if (prevBox && prevBox->bidiLevel() > box->bidiLevel()) {
@@ -571,7 +572,7 @@ static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffset
const InlineBox* nextBox = box->nextLeafChildIgnoringLineBreak();
if ((nextBox && nextBox->bidiLevel() == box->bidiLevel())
- || box->layoutObject().containingBlock()->style()->direction() == box->direction())
+ || box->lineLayoutItem().containingBlock().style()->direction() == box->direction())
return createPositionWithAffinityForBox(box, box->caretRightmostOffset(), shouldAffinityBeDownstream);
// offset is on the right edge
« no previous file with comments | « no previous file | Source/core/layout/api/LineLayoutText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698