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

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

Issue 132233016: [SVG] SVGAnimatedPointList migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: set NeedsRebaseline Created 6 years, 11 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/SVGTextContentElement.idl » ('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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars())); 104 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
105 return 0.0f; 105 return 0.0f;
106 } 106 }
107 107
108 if (nchars > numberOfChars - charnum) 108 if (nchars > numberOfChars - charnum)
109 nchars = numberOfChars - charnum; 109 nchars = numberOfChars - charnum;
110 110
111 return SVGTextQuery(renderer()).subStringLength(charnum, nchars); 111 return SVGTextQuery(renderer()).subStringLength(charnum, nchars);
112 } 112 }
113 113
114 SVGPoint SVGTextContentElement::getStartPositionOfChar(unsigned charnum, Excepti onState& exceptionState) 114 PassRefPtr<SVGPointTearOff> SVGTextContentElement::getStartPositionOfChar(unsign ed charnum, ExceptionState& exceptionState)
115 { 115 {
116 document().updateLayoutIgnorePendingStylesheets(); 116 document().updateLayoutIgnorePendingStylesheets();
117 117
118 if (charnum > getNumberOfChars()) { 118 if (charnum > getNumberOfChars()) {
119 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars())); 119 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
120 return FloatPoint(); 120 return 0;
121 } 121 }
122 122
123 return SVGTextQuery(renderer()).startPositionOfCharacter(charnum); 123 FloatPoint point = SVGTextQuery(renderer()).startPositionOfCharacter(charnum );
124 return SVGPointTearOff::create(SVGPoint::create(point), 0, PropertyIsNotAnim Val);
124 } 125 }
125 126
126 SVGPoint SVGTextContentElement::getEndPositionOfChar(unsigned charnum, Exception State& exceptionState) 127 PassRefPtr<SVGPointTearOff> SVGTextContentElement::getEndPositionOfChar(unsigned charnum, ExceptionState& exceptionState)
127 { 128 {
128 document().updateLayoutIgnorePendingStylesheets(); 129 document().updateLayoutIgnorePendingStylesheets();
129 130
130 if (charnum > getNumberOfChars()) { 131 if (charnum > getNumberOfChars()) {
131 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars())); 132 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
132 return FloatPoint(); 133 return 0;
133 } 134 }
134 135
135 return SVGTextQuery(renderer()).endPositionOfCharacter(charnum); 136 FloatPoint point = SVGTextQuery(renderer()).endPositionOfCharacter(charnum);
137 return SVGPointTearOff::create(SVGPoint::create(point), 0, PropertyIsNotAnim Val);
136 } 138 }
137 139
138 PassRefPtr<SVGRectTearOff> SVGTextContentElement::getExtentOfChar(unsigned charn um, ExceptionState& exceptionState) 140 PassRefPtr<SVGRectTearOff> SVGTextContentElement::getExtentOfChar(unsigned charn um, ExceptionState& exceptionState)
139 { 141 {
140 document().updateLayoutIgnorePendingStylesheets(); 142 document().updateLayoutIgnorePendingStylesheets();
141 143
142 if (charnum > getNumberOfChars()) { 144 if (charnum > getNumberOfChars()) {
143 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars())); 145 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
144 return 0; 146 return 0;
145 } 147 }
146 148
147 FloatRect rect = SVGTextQuery(renderer()).extentOfCharacter(charnum); 149 FloatRect rect = SVGTextQuery(renderer()).extentOfCharacter(charnum);
148 return SVGRectTearOff::create(SVGRect::create(rect), 0, PropertyIsNotAnimVal ); 150 return SVGRectTearOff::create(SVGRect::create(rect), 0, PropertyIsNotAnimVal );
149 } 151 }
150 152
151 float SVGTextContentElement::getRotationOfChar(unsigned charnum, ExceptionState& exceptionState) 153 float SVGTextContentElement::getRotationOfChar(unsigned charnum, ExceptionState& exceptionState)
152 { 154 {
153 document().updateLayoutIgnorePendingStylesheets(); 155 document().updateLayoutIgnorePendingStylesheets();
154 156
155 if (charnum > getNumberOfChars()) { 157 if (charnum > getNumberOfChars()) {
156 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars())); 158 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
157 return 0.0f; 159 return 0.0f;
158 } 160 }
159 161
160 return SVGTextQuery(renderer()).rotationOfCharacter(charnum); 162 return SVGTextQuery(renderer()).rotationOfCharacter(charnum);
161 } 163 }
162 164
163 int SVGTextContentElement::getCharNumAtPosition(const SVGPoint& point) 165 int SVGTextContentElement::getCharNumAtPosition(PassRefPtr<SVGPointTearOff> poin t, ExceptionState& exceptionState)
164 { 166 {
165 document().updateLayoutIgnorePendingStylesheets(); 167 document().updateLayoutIgnorePendingStylesheets();
166 return SVGTextQuery(renderer()).characterNumberAtPosition(point); 168 return SVGTextQuery(renderer()).characterNumberAtPosition(point->target()->v alue());
167 } 169 }
168 170
169 void SVGTextContentElement::selectSubString(unsigned charnum, unsigned nchars, E xceptionState& exceptionState) 171 void SVGTextContentElement::selectSubString(unsigned charnum, unsigned nchars, E xceptionState& exceptionState)
170 { 172 {
171 unsigned numberOfChars = getNumberOfChars(); 173 unsigned numberOfChars = getNumberOfChars();
172 if (charnum >= numberOfChars) { 174 if (charnum >= numberOfChars) {
173 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars())); 175 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
174 return; 176 return;
175 } 177 }
176 178
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 SVGElement* element = toSVGElement(renderer->node()); 280 SVGElement* element = toSVGElement(renderer->node());
279 ASSERT(element); 281 ASSERT(element);
280 282
281 if (!element->isTextContent()) 283 if (!element->isTextContent())
282 return 0; 284 return 0;
283 285
284 return toSVGTextContentElement(element); 286 return toSVGTextContentElement(element);
285 } 287 }
286 288
287 } 289 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGTextContentElement.h ('k') | Source/core/svg/SVGTextContentElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698