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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp

Issue 2374183004: Make non-null VisibleSelections creatable only by createVisibleSelection[Deprecated] (Closed)
Patch Set: Fix mac compile error 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 // Find selection start 190 // Find selection start
191 VisiblePosition start = VisiblePosition::firstPositionInNode(const_cast<SVGT extContentElement*>(this)); 191 VisiblePosition start = VisiblePosition::firstPositionInNode(const_cast<SVGT extContentElement*>(this));
192 for (unsigned i = 0; i < charnum; ++i) 192 for (unsigned i = 0; i < charnum; ++i)
193 start = nextPositionOf(start); 193 start = nextPositionOf(start);
194 194
195 // Find selection end 195 // Find selection end
196 VisiblePosition end(start); 196 VisiblePosition end(start);
197 for (unsigned i = 0; i < nchars; ++i) 197 for (unsigned i = 0; i < nchars; ++i)
198 end = nextPositionOf(end); 198 end = nextPositionOf(end);
199 199
200 document().frame()->selection().setSelection(VisibleSelection(start, end)); 200 document().frame()->selection().setSelection(createVisibleSelectionDeprecate d(start, end));
201 } 201 }
202 202
203 bool SVGTextContentElement::isPresentationAttribute(const QualifiedName& name) c onst 203 bool SVGTextContentElement::isPresentationAttribute(const QualifiedName& name) c onst
204 { 204 {
205 if (name.matches(XMLNames::spaceAttr)) 205 if (name.matches(XMLNames::spaceAttr))
206 return true; 206 return true;
207 return SVGGraphicsElement::isPresentationAttribute(name); 207 return SVGGraphicsElement::isPresentationAttribute(name);
208 } 208 }
209 209
210 void SVGTextContentElement::collectStyleForPresentationAttribute(const Qualified Name& name, const AtomicString& value, MutableStylePropertySet* style) 210 void SVGTextContentElement::collectStyleForPresentationAttribute(const Qualified Name& name, const AtomicString& value, MutableStylePropertySet* style)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 { 255 {
256 if (!lineLayoutItem || (!lineLayoutItem.isSVGText() && !lineLayoutItem.isSVG Inline())) 256 if (!lineLayoutItem || (!lineLayoutItem.isSVGText() && !lineLayoutItem.isSVG Inline()))
257 return nullptr; 257 return nullptr;
258 258
259 SVGElement* element = toSVGElement(lineLayoutItem.node()); 259 SVGElement* element = toSVGElement(lineLayoutItem.node());
260 ASSERT(element); 260 ASSERT(element);
261 return isSVGTextContentElement(*element) ? toSVGTextContentElement(element) : 0; 261 return isSVGTextContentElement(*element) ? toSVGTextContentElement(element) : 0;
262 } 262 }
263 263
264 } // namespace blink 264 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698