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

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

Issue 1303653002: Introduce LayoutObject::createPositionWithAffinity(int offset) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T12:20:28 Created 5 years, 4 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 | « Source/core/layout/LayoutBR.cpp ('k') | Source/core/layout/LayoutObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBlock.cpp
diff --git a/Source/core/layout/LayoutBlock.cpp b/Source/core/layout/LayoutBlock.cpp
index 00fd49ac48a81fc9340041380d47c71dad147a54..47aa91a67527ca9e71f82675d40d313b667f3b4b 100644
--- a/Source/core/layout/LayoutBlock.cpp
+++ b/Source/core/layout/LayoutBlock.cpp
@@ -1822,7 +1822,7 @@ static PositionWithAffinity positionForPointRespectingEditingBoundaries(LayoutBl
LayoutUnit childMiddle = parent->logicalWidthForChild(*child) / 2;
LayoutUnit logicalLeft = parent->isHorizontalWritingMode() ? pointInChildCoordinates.x() : pointInChildCoordinates.y();
if (logicalLeft < childMiddle)
- return ancestor->createPositionWithAffinity(childNode->nodeIndex(), DOWNSTREAM);
+ return ancestor->createPositionWithAffinity(childNode->nodeIndex());
return ancestor->createPositionWithAffinity(childNode->nodeIndex() + 1, UPSTREAM);
}
@@ -1831,7 +1831,7 @@ PositionWithAffinity LayoutBlock::positionForPointWithInlineChildren(const Layou
ASSERT(childrenInline());
if (!firstRootBox())
- return createPositionWithAffinity(0, DOWNSTREAM);
+ return createPositionWithAffinity(0);
bool linesAreFlipped = style()->isFlippedLinesWritingMode();
bool blocksAreFlipped = style()->isFlippedBlocksWritingMode();
@@ -1911,7 +1911,7 @@ PositionWithAffinity LayoutBlock::positionForPointWithInlineChildren(const Layou
// Can't reach this. We have a root line box, but it has no kids.
// FIXME: This should ASSERT_NOT_REACHED(), but clicking on placeholder text
// seems to hit this code path.
- return createPositionWithAffinity(0, DOWNSTREAM);
+ return createPositionWithAffinity(0);
}
static inline bool isChildHitTestCandidate(LayoutBox* box)
@@ -1930,13 +1930,13 @@ PositionWithAffinity LayoutBlock::positionForPoint(const LayoutPoint& point)
LayoutUnit pointLogicalTop = isHorizontalWritingMode() ? point.y() : point.x();
if (pointLogicalLeft < 0)
- return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM);
+ return createPositionWithAffinity(caretMinOffset());
if (pointLogicalLeft >= logicalWidth())
- return createPositionWithAffinity(caretMaxOffset(), DOWNSTREAM);
+ return createPositionWithAffinity(caretMaxOffset());
if (pointLogicalTop < 0)
- return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM);
+ return createPositionWithAffinity(caretMinOffset());
if (pointLogicalTop >= logicalHeight())
- return createPositionWithAffinity(caretMaxOffset(), DOWNSTREAM);
+ return createPositionWithAffinity(caretMaxOffset());
}
LayoutPoint pointInContents = point;
« no previous file with comments | « Source/core/layout/LayoutBR.cpp ('k') | Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698