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

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

Issue 1896793002: Rename (updateLayout/updateStyle).*.() to updateStyleAndLayout.*.() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 DEFINE_TRACE(SVGTextContentElement) 85 DEFINE_TRACE(SVGTextContentElement)
86 { 86 {
87 visitor->trace(m_textLength); 87 visitor->trace(m_textLength);
88 visitor->trace(m_lengthAdjust); 88 visitor->trace(m_lengthAdjust);
89 SVGGraphicsElement::trace(visitor); 89 SVGGraphicsElement::trace(visitor);
90 } 90 }
91 91
92 unsigned SVGTextContentElement::getNumberOfChars() 92 unsigned SVGTextContentElement::getNumberOfChars()
93 { 93 {
94 document().updateLayoutIgnorePendingStylesheets(); 94 document().updateStyleAndLayoutIgnorePendingStylesheets();
95 return SVGTextQuery(layoutObject()).numberOfCharacters(); 95 return SVGTextQuery(layoutObject()).numberOfCharacters();
96 } 96 }
97 97
98 float SVGTextContentElement::getComputedTextLength() 98 float SVGTextContentElement::getComputedTextLength()
99 { 99 {
100 document().updateLayoutIgnorePendingStylesheets(); 100 document().updateStyleAndLayoutIgnorePendingStylesheets();
101 return SVGTextQuery(layoutObject()).textLength(); 101 return SVGTextQuery(layoutObject()).textLength();
102 } 102 }
103 103
104 float SVGTextContentElement::getSubStringLength(unsigned charnum, unsigned nchar s, ExceptionState& exceptionState) 104 float SVGTextContentElement::getSubStringLength(unsigned charnum, unsigned nchar s, ExceptionState& exceptionState)
105 { 105 {
106 document().updateLayoutIgnorePendingStylesheets(); 106 document().updateStyleAndLayoutIgnorePendingStylesheets();
107 107
108 unsigned numberOfChars = getNumberOfChars(); 108 unsigned numberOfChars = getNumberOfChars();
109 if (charnum >= numberOfChars) { 109 if (charnum >= numberOfChars) {
110 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars())); 110 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
111 return 0.0f; 111 return 0.0f;
112 } 112 }
113 113
114 if (nchars > numberOfChars - charnum) 114 if (nchars > numberOfChars - charnum)
115 nchars = numberOfChars - charnum; 115 nchars = numberOfChars - charnum;
116 116
117 return SVGTextQuery(layoutObject()).subStringLength(charnum, nchars); 117 return SVGTextQuery(layoutObject()).subStringLength(charnum, nchars);
118 } 118 }
119 119
120 SVGPointTearOff* SVGTextContentElement::getStartPositionOfChar(unsigned charnum, ExceptionState& exceptionState) 120 SVGPointTearOff* SVGTextContentElement::getStartPositionOfChar(unsigned charnum, ExceptionState& exceptionState)
121 { 121 {
122 document().updateLayoutIgnorePendingStylesheets(); 122 document().updateStyleAndLayoutIgnorePendingStylesheets();
123 123
124 if (charnum >= getNumberOfChars()) { 124 if (charnum >= getNumberOfChars()) {
125 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars())); 125 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
126 return nullptr; 126 return nullptr;
127 } 127 }
128 128
129 FloatPoint point = SVGTextQuery(layoutObject()).startPositionOfCharacter(cha rnum); 129 FloatPoint point = SVGTextQuery(layoutObject()).startPositionOfCharacter(cha rnum);
130 return SVGPointTearOff::create(SVGPoint::create(point), 0, PropertyIsNotAnim Val); 130 return SVGPointTearOff::create(SVGPoint::create(point), 0, PropertyIsNotAnim Val);
131 } 131 }
132 132
133 SVGPointTearOff* SVGTextContentElement::getEndPositionOfChar(unsigned charnum, E xceptionState& exceptionState) 133 SVGPointTearOff* SVGTextContentElement::getEndPositionOfChar(unsigned charnum, E xceptionState& exceptionState)
134 { 134 {
135 document().updateLayoutIgnorePendingStylesheets(); 135 document().updateStyleAndLayoutIgnorePendingStylesheets();
136 136
137 if (charnum >= getNumberOfChars()) { 137 if (charnum >= getNumberOfChars()) {
138 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars())); 138 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
139 return nullptr; 139 return nullptr;
140 } 140 }
141 141
142 FloatPoint point = SVGTextQuery(layoutObject()).endPositionOfCharacter(charn um); 142 FloatPoint point = SVGTextQuery(layoutObject()).endPositionOfCharacter(charn um);
143 return SVGPointTearOff::create(SVGPoint::create(point), 0, PropertyIsNotAnim Val); 143 return SVGPointTearOff::create(SVGPoint::create(point), 0, PropertyIsNotAnim Val);
144 } 144 }
145 145
146 SVGRectTearOff* SVGTextContentElement::getExtentOfChar(unsigned charnum, Excepti onState& exceptionState) 146 SVGRectTearOff* SVGTextContentElement::getExtentOfChar(unsigned charnum, Excepti onState& exceptionState)
147 { 147 {
148 document().updateLayoutIgnorePendingStylesheets(); 148 document().updateStyleAndLayoutIgnorePendingStylesheets();
149 149
150 if (charnum >= getNumberOfChars()) { 150 if (charnum >= getNumberOfChars()) {
151 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars())); 151 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
152 return nullptr; 152 return nullptr;
153 } 153 }
154 154
155 FloatRect rect = SVGTextQuery(layoutObject()).extentOfCharacter(charnum); 155 FloatRect rect = SVGTextQuery(layoutObject()).extentOfCharacter(charnum);
156 return SVGRectTearOff::create(SVGRect::create(rect), 0, PropertyIsNotAnimVal ); 156 return SVGRectTearOff::create(SVGRect::create(rect), 0, PropertyIsNotAnimVal );
157 } 157 }
158 158
159 float SVGTextContentElement::getRotationOfChar(unsigned charnum, ExceptionState& exceptionState) 159 float SVGTextContentElement::getRotationOfChar(unsigned charnum, ExceptionState& exceptionState)
160 { 160 {
161 document().updateLayoutIgnorePendingStylesheets(); 161 document().updateStyleAndLayoutIgnorePendingStylesheets();
162 162
163 if (charnum >= getNumberOfChars()) { 163 if (charnum >= getNumberOfChars()) {
164 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars())); 164 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
165 return 0.0f; 165 return 0.0f;
166 } 166 }
167 167
168 return SVGTextQuery(layoutObject()).rotationOfCharacter(charnum); 168 return SVGTextQuery(layoutObject()).rotationOfCharacter(charnum);
169 } 169 }
170 170
171 int SVGTextContentElement::getCharNumAtPosition(SVGPointTearOff* point, Exceptio nState& exceptionState) 171 int SVGTextContentElement::getCharNumAtPosition(SVGPointTearOff* point, Exceptio nState& exceptionState)
172 { 172 {
173 document().updateLayoutIgnorePendingStylesheets(); 173 document().updateStyleAndLayoutIgnorePendingStylesheets();
174 return SVGTextQuery(layoutObject()).characterNumberAtPosition(point->target( )->value()); 174 return SVGTextQuery(layoutObject()).characterNumberAtPosition(point->target( )->value());
175 } 175 }
176 176
177 void SVGTextContentElement::selectSubString(unsigned charnum, unsigned nchars, E xceptionState& exceptionState) 177 void SVGTextContentElement::selectSubString(unsigned charnum, unsigned nchars, E xceptionState& exceptionState)
178 { 178 {
179 unsigned numberOfChars = getNumberOfChars(); 179 unsigned numberOfChars = getNumberOfChars();
180 if (charnum >= numberOfChars) { 180 if (charnum >= numberOfChars) {
181 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars())); 181 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
182 return; 182 return;
183 } 183 }
(...skipping 71 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
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGSVGElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGUseElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698