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

Unified Diff: Source/core/rendering/RootInlineBox.cpp

Issue 141683003: Return the right top position for text selections when there are no previous root inline boxes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added [ NeedsRebaseline ] for editing/selection/move-left-right.html Created 6 years, 10 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 | « LayoutTests/platform/linux/fast/text/selection-rect-line-height-too-small-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RootInlineBox.cpp
diff --git a/Source/core/rendering/RootInlineBox.cpp b/Source/core/rendering/RootInlineBox.cpp
index b110fc65afcd8cba273b551aea14471900723be7..7fc0f0462ca1bf1d59eae2b043b41b830dca4171 100644
--- a/Source/core/rendering/RootInlineBox.cpp
+++ b/Source/core/rendering/RootInlineBox.cpp
@@ -403,10 +403,10 @@ LayoutUnit RootInlineBox::selectionTop() const
if (m_hasAnnotationsBefore)
selectionTop -= !renderer()->style()->isFlippedLinesWritingMode() ? computeOverAnnotationAdjustment(m_lineTop) : computeUnderAnnotationAdjustment(m_lineTop);
- if (renderer()->style()->isFlippedLinesWritingMode())
+ if (renderer()->style()->isFlippedLinesWritingMode() || !prevRootBox())
return selectionTop;
- LayoutUnit prevBottom = prevRootBox() ? prevRootBox()->selectionBottom() : block()->borderBefore() + block()->paddingBefore();
+ LayoutUnit prevBottom = prevRootBox()->selectionBottom();
if (prevBottom < selectionTop && block()->containsFloats()) {
// This line has actually been moved further down, probably from a large line-height, but possibly because the
// line was forced to clear floats. If so, let's check the offsets, and only be willing to use the previous
« no previous file with comments | « LayoutTests/platform/linux/fast/text/selection-rect-line-height-too-small-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698