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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutInline.cpp

Issue 2398583002: Do not de-select text across continuations (Closed)
Patch Set: Switch to non-pixel tests Created 4 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 | « third_party/WebKit/LayoutTests/editing/selection/continuations-without-move-caret-to-boundary.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutInline.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutInline.cpp b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
index 17a5d3f9f8b5a806b33f7a1745da58f1403524c7..7e9767b93fcf3a703dc3141d2382a5c687347d9b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutInline.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
@@ -936,23 +936,20 @@ bool LayoutInline::hitTestCulledInline(
PositionWithAffinity LayoutInline::positionForPoint(const LayoutPoint& point) {
// FIXME: Does not deal with relative positioned inlines (should it?)
- LayoutBlock* cb = containingBlock();
+
+ // If there are continuations, test them first because our containing block
+ // will not check them.
+ LayoutBoxModelObject* continuation = this->continuation();
+ while (continuation) {
+ if (continuation->isInline() || continuation->slowFirstChild())
+ return continuation->positionForPoint(point);
+ continuation = toLayoutBlockFlow(continuation)->inlineElementContinuation();
+ }
+
if (firstLineBoxIncludingCulling()) {
// This inline actually has a line box. We must have clicked in the border/padding of one of these boxes. We
// should try to find a result by asking our containing block.
- return cb->positionForPoint(point);
- }
-
- // Translate the coords from the pre-anonymous block to the post-anonymous block.
- LayoutPoint parentBlockPoint = cb->location() + point;
- LayoutBoxModelObject* c = continuation();
- while (c) {
- LayoutBox* contBlock =
- c->isInline() ? c->containingBlock() : toLayoutBlock(c);
- if (c->isInline() || c->slowFirstChild())
- return c->positionForPoint(parentBlockPoint -
- contBlock->locationOffset());
- c = toLayoutBlockFlow(c)->inlineElementContinuation();
+ return containingBlock()->positionForPoint(point);
}
return LayoutBoxModelObject::positionForPoint(point);
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/selection/continuations-without-move-caret-to-boundary.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698