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

Unified Diff: third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp

Issue 2437873008: Get rid of flat tree version of createVisibleSelection() taking two VisiblePosition (Closed)
Patch Set: 2016-10-21T16:03:11 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/svg/SVGTextContentElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp b/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp
index fed038575bf6f775bdba83a56fb23fb3bca43017..511affe33374697dbb6360147eed25c7df21b05e 100644
--- a/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp
@@ -225,8 +225,18 @@ void SVGTextContentElement::selectSubString(unsigned charnum,
for (unsigned i = 0; i < nchars; ++i)
end = nextPositionOf(end);
+ SelectionInDOMTree::Builder builder;
Xiaocheng 2016/10/21 11:18:36 How about just setBaseAndExtentDeprecated? Since
yosin_UTC9 2016/10/24 06:19:44 Done.
+ if (start.isNotNull() && end.isNotNull()) {
+ builder.collapse(start.toPositionWithAffinity())
+ .extend(end.deepEquivalent());
+ } else if (start.isNotNull()) {
+ builder.collapse(start.toPositionWithAffinity());
+ } else if (end.isNotNull()) {
+ builder.collapse(end.toPositionWithAffinity());
+ }
+
document().frame()->selection().setSelection(
Xiaocheng 2016/10/21 11:18:36 We should use the FrameSelection::setSelection(Sel
yosin_UTC9 2016/10/24 06:19:44 Good catch!
- createVisibleSelection(start, end));
+ createVisibleSelection(builder.build()));
}
bool SVGTextContentElement::isPresentationAttribute(

Powered by Google App Engine
This is Rietveld 408576698