| OLD | NEW |
| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 if (charnum >= numberOfChars) { | 205 if (charnum >= numberOfChars) { |
| 206 exceptionState.throwDOMException( | 206 exceptionState.throwDOMException( |
| 207 IndexSizeError, ExceptionMessages::indexExceedsMaximumBound( | 207 IndexSizeError, ExceptionMessages::indexExceedsMaximumBound( |
| 208 "charnum", charnum, getNumberOfChars())); | 208 "charnum", charnum, getNumberOfChars())); |
| 209 return; | 209 return; |
| 210 } | 210 } |
| 211 | 211 |
| 212 if (nchars > numberOfChars - charnum) | 212 if (nchars > numberOfChars - charnum) |
| 213 nchars = numberOfChars - charnum; | 213 nchars = numberOfChars - charnum; |
| 214 | 214 |
| 215 ASSERT(document().frame()); | 215 DCHECK(document().frame()); |
| 216 | 216 |
| 217 // Find selection start | 217 // Find selection start |
| 218 VisiblePosition start = VisiblePosition::firstPositionInNode( | 218 VisiblePosition start = VisiblePosition::firstPositionInNode( |
| 219 const_cast<SVGTextContentElement*>(this)); | 219 const_cast<SVGTextContentElement*>(this)); |
| 220 for (unsigned i = 0; i < charnum; ++i) | 220 for (unsigned i = 0; i < charnum; ++i) |
| 221 start = nextPositionOf(start); | 221 start = nextPositionOf(start); |
| 222 | 222 |
| 223 // Find selection end | 223 // Find selection end |
| 224 VisiblePosition end(start); | 224 VisiblePosition end(start); |
| 225 for (unsigned i = 0; i < nchars; ++i) | 225 for (unsigned i = 0; i < nchars; ++i) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 return true; | 289 return true; |
| 290 } | 290 } |
| 291 | 291 |
| 292 SVGTextContentElement* SVGTextContentElement::elementFromLineLayoutItem( | 292 SVGTextContentElement* SVGTextContentElement::elementFromLineLayoutItem( |
| 293 const LineLayoutItem& lineLayoutItem) { | 293 const LineLayoutItem& lineLayoutItem) { |
| 294 if (!lineLayoutItem || | 294 if (!lineLayoutItem || |
| 295 (!lineLayoutItem.isSVGText() && !lineLayoutItem.isSVGInline())) | 295 (!lineLayoutItem.isSVGText() && !lineLayoutItem.isSVGInline())) |
| 296 return nullptr; | 296 return nullptr; |
| 297 | 297 |
| 298 SVGElement* element = toSVGElement(lineLayoutItem.node()); | 298 SVGElement* element = toSVGElement(lineLayoutItem.node()); |
| 299 ASSERT(element); | 299 DCHECK(element); |
| 300 return isSVGTextContentElement(*element) ? toSVGTextContentElement(element) | 300 return isSVGTextContentElement(*element) ? toSVGTextContentElement(element) |
| 301 : 0; | 301 : 0; |
| 302 } | 302 } |
| 303 | 303 |
| 304 } // namespace blink | 304 } // namespace blink |
| OLD | NEW |