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

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

Issue 2398583002: Do not de-select text across continuations (Closed)
Patch Set: Add tests for different editing behaviors 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
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 1c173c48b6254174163a90d83fbe0907a8019dfe..1ecbc13ea12dfc19d87f3fc42675036abb540b35 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.
pdr. 2016/10/06 04:52:32 This code was added in 2007 in https://chromium.go
- 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);

Powered by Google App Engine
This is Rietveld 408576698