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

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

Issue 18098007: Get rid of SVGPoint special case from the bindings generator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGTextContentElement.h ('k') | Source/core/svg/SVGZoomEvent.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 unsigned numberOfChars = getNumberOfChars(); 119 unsigned numberOfChars = getNumberOfChars();
120 if (charnum >= numberOfChars) { 120 if (charnum >= numberOfChars) {
121 ec = IndexSizeError; 121 ec = IndexSizeError;
122 return 0.0f; 122 return 0.0f;
123 } 123 }
124 124
125 return SVGTextQuery(renderer()).subStringLength(charnum, nchars); 125 return SVGTextQuery(renderer()).subStringLength(charnum, nchars);
126 } 126 }
127 127
128 FloatPoint SVGTextContentElement::getStartPositionOfChar(unsigned charnum, Excep tionCode& ec) 128 SVGPoint SVGTextContentElement::getStartPositionOfChar(unsigned charnum, Excepti onCode& ec)
129 { 129 {
130 document()->updateLayoutIgnorePendingStylesheets(); 130 document()->updateLayoutIgnorePendingStylesheets();
131 131
132 if (charnum > getNumberOfChars()) { 132 if (charnum > getNumberOfChars()) {
133 ec = IndexSizeError; 133 ec = IndexSizeError;
134 return FloatPoint(); 134 return FloatPoint();
135 } 135 }
136 136
137 return SVGTextQuery(renderer()).startPositionOfCharacter(charnum); 137 return SVGTextQuery(renderer()).startPositionOfCharacter(charnum);
138 } 138 }
139 139
140 FloatPoint SVGTextContentElement::getEndPositionOfChar(unsigned charnum, Excepti onCode& ec) 140 SVGPoint SVGTextContentElement::getEndPositionOfChar(unsigned charnum, Exception Code& ec)
141 { 141 {
142 document()->updateLayoutIgnorePendingStylesheets(); 142 document()->updateLayoutIgnorePendingStylesheets();
143 143
144 if (charnum > getNumberOfChars()) { 144 if (charnum > getNumberOfChars()) {
145 ec = IndexSizeError; 145 ec = IndexSizeError;
146 return FloatPoint(); 146 return FloatPoint();
147 } 147 }
148 148
149 return SVGTextQuery(renderer()).endPositionOfCharacter(charnum); 149 return SVGTextQuery(renderer()).endPositionOfCharacter(charnum);
150 } 150 }
(...skipping 15 matching lines...) Expand all
166 document()->updateLayoutIgnorePendingStylesheets(); 166 document()->updateLayoutIgnorePendingStylesheets();
167 167
168 if (charnum > getNumberOfChars()) { 168 if (charnum > getNumberOfChars()) {
169 ec = IndexSizeError; 169 ec = IndexSizeError;
170 return 0.0f; 170 return 0.0f;
171 } 171 }
172 172
173 return SVGTextQuery(renderer()).rotationOfCharacter(charnum); 173 return SVGTextQuery(renderer()).rotationOfCharacter(charnum);
174 } 174 }
175 175
176 int SVGTextContentElement::getCharNumAtPosition(const FloatPoint& point) 176 int SVGTextContentElement::getCharNumAtPosition(const SVGPoint& point)
177 { 177 {
178 document()->updateLayoutIgnorePendingStylesheets(); 178 document()->updateLayoutIgnorePendingStylesheets();
179 return SVGTextQuery(renderer()).characterNumberAtPosition(point); 179 return SVGTextQuery(renderer()).characterNumberAtPosition(point);
180 } 180 }
181 181
182 void SVGTextContentElement::selectSubString(unsigned charnum, unsigned nchars, E xceptionCode& ec) 182 void SVGTextContentElement::selectSubString(unsigned charnum, unsigned nchars, E xceptionCode& ec)
183 { 183 {
184 unsigned numberOfChars = getNumberOfChars(); 184 unsigned numberOfChars = getNumberOfChars();
185 if (charnum >= numberOfChars) { 185 if (charnum >= numberOfChars) {
186 ec = IndexSizeError; 186 ec = IndexSizeError;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 SVGElement* element = toSVGElement(renderer->node()); 298 SVGElement* element = toSVGElement(renderer->node());
299 ASSERT(element); 299 ASSERT(element);
300 300
301 if (!element->isTextContent()) 301 if (!element->isTextContent())
302 return 0; 302 return 0;
303 303
304 return toSVGTextContentElement(element); 304 return toSVGTextContentElement(element);
305 } 305 }
306 306
307 } 307 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGTextContentElement.h ('k') | Source/core/svg/SVGZoomEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698