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

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

Issue 688233002: Remove writing mode code from the linebox tree. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT Created 6 years, 2 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/RenderLineBoxList.cpp ('k') | sky/engine/core/rendering/RootInlineBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderText.cpp
diff --git a/sky/engine/core/rendering/RenderText.cpp b/sky/engine/core/rendering/RenderText.cpp
index 8fe2391691ee03063818dcce0b576df4fb5e3ff2..e6284693a87569b98579aa0f86ea4a4403caf4ad 100644
--- a/sky/engine/core/rendering/RenderText.cpp
+++ b/sky/engine/core/rendering/RenderText.cpp
@@ -238,13 +238,8 @@ static FloatRect localQuadForTextBox(InlineTextBox* box, unsigned start, unsigne
if (!useSelectionHeight) {
// Change the height and y position (or width and x for vertical text)
// because selectionRect uses selection-specific values.
- if (box->isHorizontal()) {
- r.setHeight(box->height());
- r.setY(box->y());
- } else {
- r.setWidth(box->width());
- r.setX(box->x());
- }
+ r.setHeight(box->height());
+ r.setY(box->y());
}
return FloatRect(r);
}
@@ -269,13 +264,8 @@ void RenderText::absoluteRectsForRange(Vector<IntRect>& rects, unsigned start, u
FloatRect r = box->calculateBoundaries();
if (useSelectionHeight) {
LayoutRect selectionRect = box->localSelectionRect(start, end);
- if (box->isHorizontal()) {
- r.setHeight(selectionRect.height().toFloat());
- r.setY(selectionRect.y().toFloat());
- } else {
- r.setWidth(selectionRect.width().toFloat());
- r.setX(selectionRect.x().toFloat());
- }
+ r.setHeight(selectionRect.height().toFloat());
+ r.setY(selectionRect.y().toFloat());
}
rects.append(localToAbsoluteQuad(r, 0).enclosingBoundingBox());
} else {
@@ -349,13 +339,8 @@ void RenderText::absoluteQuadsForRange(Vector<FloatQuad>& quads, unsigned start,
FloatRect r = box->calculateBoundaries();
if (useSelectionHeight) {
LayoutRect selectionRect = box->localSelectionRect(start, end);
- if (box->isHorizontal()) {
- r.setHeight(selectionRect.height().toFloat());
- r.setY(selectionRect.y().toFloat());
- } else {
- r.setWidth(selectionRect.width().toFloat());
- r.setX(selectionRect.x().toFloat());
- }
+ r.setHeight(selectionRect.height().toFloat());
+ r.setY(selectionRect.y().toFloat());
}
quads.append(localToAbsoluteQuad(r, 0));
} else {
@@ -499,8 +484,8 @@ PositionWithAffinity RenderText::positionForPoint(const LayoutPoint& point)
if (!firstTextBox() || textLength() == 0)
return createPositionWithAffinity(0, DOWNSTREAM);
- LayoutUnit pointLineDirection = firstTextBox()->isHorizontal() ? point.x() : point.y();
- LayoutUnit pointBlockDirection = firstTextBox()->isHorizontal() ? point.y() : point.x();
+ LayoutUnit pointLineDirection = point.x();
+ LayoutUnit pointBlockDirection = point.y();
InlineTextBox* lastBox = 0;
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
« no previous file with comments | « sky/engine/core/rendering/RenderLineBoxList.cpp ('k') | sky/engine/core/rendering/RootInlineBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698