| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of the WebKit project. | 2 * This file is part of the WebKit project. |
| 3 * | 3 * |
| 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> | 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
| 5 * (C) 2006 Apple Computer Inc. | 5 * (C) 2006 Apple Computer Inc. |
| 6 * (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 6 * (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 7 * (C) 2008 Rob Buis <buis@kde.org> | 7 * (C) 2008 Rob Buis <buis@kde.org> |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 RenderSVGInlineText::RenderSVGInlineText(Node* n, PassRefPtr<StringImpl> str) | 51 RenderSVGInlineText::RenderSVGInlineText(Node* n, PassRefPtr<StringImpl> str) |
| 52 : RenderText(n, str) | 52 : RenderText(n, str) |
| 53 { | 53 { |
| 54 } | 54 } |
| 55 | 55 |
| 56 void RenderSVGInlineText::absoluteRects(Vector<IntRect>& rects, int, int, bool) | 56 void RenderSVGInlineText::absoluteRects(Vector<IntRect>& rects, int, int, bool) |
| 57 { | 57 { |
| 58 rects.append(computeAbsoluteRectForRange(0, textLength())); | 58 rects.append(computeAbsoluteRectForRange(0, textLength())); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void RenderSVGInlineText::absoluteQuads(Vector<FloatQuad>& quads, bool topLevel) |
| 62 { |
| 63 quads.append(FloatRect(computeAbsoluteRectForRange(0, textLength()))); |
| 64 } |
| 65 |
| 61 IntRect RenderSVGInlineText::selectionRect(bool) | 66 IntRect RenderSVGInlineText::selectionRect(bool) |
| 62 { | 67 { |
| 63 ASSERT(!needsLayout()); | 68 ASSERT(!needsLayout()); |
| 64 | 69 |
| 65 IntRect rect; | 70 IntRect rect; |
| 66 if (selectionState() == SelectionNone) | 71 if (selectionState() == SelectionNone) |
| 67 return rect; | 72 return rect; |
| 68 | 73 |
| 69 // Early exit if we're ie. a <text> within a <defs> section. | 74 // Early exit if we're ie. a <text> within a <defs> section. |
| 70 if (isChildOfHiddenContainer(this)) | 75 if (isChildOfHiddenContainer(this)) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 113 |
| 109 // Mimic RenderBox::computeAbsoluteRepaintRect() functionality. But only the
subset needed for SVG and respecting SVG transformations. | 114 // Mimic RenderBox::computeAbsoluteRepaintRect() functionality. But only the
subset needed for SVG and respecting SVG transformations. |
| 110 FloatPoint absPos = cb->container()->localToAbsolute(); | 115 FloatPoint absPos = cb->container()->localToAbsolute(); |
| 111 | 116 |
| 112 // Remove HTML parent translation offsets here! These need to be retrieved f
rom the RenderSVGRoot object. | 117 // Remove HTML parent translation offsets here! These need to be retrieved f
rom the RenderSVGRoot object. |
| 113 // But do take the containingBlocks's container position into account, ie. S
VG text in scrollable <div>. | 118 // But do take the containingBlocks's container position into account, ie. S
VG text in scrollable <div>. |
| 114 AffineTransform htmlParentCtm = root->RenderContainer::absoluteTransform(); | 119 AffineTransform htmlParentCtm = root->RenderContainer::absoluteTransform(); |
| 115 | 120 |
| 116 FloatRect fixedRect(narrowPrecisionToFloat(rect.x() + absPos.x() - xPos() -
htmlParentCtm.e()), | 121 FloatRect fixedRect(narrowPrecisionToFloat(rect.x() + absPos.x() - xPos() -
htmlParentCtm.e()), |
| 117 narrowPrecisionToFloat(rect.y() + absPos.y() - yPos() -
htmlParentCtm.f()), rect.width(), rect.height()); | 122 narrowPrecisionToFloat(rect.y() + absPos.y() - yPos() -
htmlParentCtm.f()), rect.width(), rect.height()); |
| 123 // FIXME: broken with CSS transforms |
| 118 return enclosingIntRect(absoluteTransform().mapRect(fixedRect)); | 124 return enclosingIntRect(absoluteTransform().mapRect(fixedRect)); |
| 119 } | 125 } |
| 120 | 126 |
| 121 InlineTextBox* RenderSVGInlineText::createInlineTextBox() | 127 InlineTextBox* RenderSVGInlineText::createInlineTextBox() |
| 122 { | 128 { |
| 123 return new (renderArena()) SVGInlineTextBox(this); | 129 return new (renderArena()) SVGInlineTextBox(this); |
| 124 } | 130 } |
| 125 | 131 |
| 126 IntRect RenderSVGInlineText::caretRect(InlineBox* inlineBox, int caretOffset, in
t* extraWidthToEndOfLine) | 132 IntRect RenderSVGInlineText::caretRect(InlineBox* inlineBox, int caretOffset, in
t* extraWidthToEndOfLine) |
| 127 { | 133 { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if (!documentBeingDestroyed()) { | 171 if (!documentBeingDestroyed()) { |
| 166 setNeedsLayoutAndPrefWidthsRecalc(); | 172 setNeedsLayoutAndPrefWidthsRecalc(); |
| 167 repaint(); | 173 repaint(); |
| 168 } | 174 } |
| 169 RenderText::destroy(); | 175 RenderText::destroy(); |
| 170 } | 176 } |
| 171 | 177 |
| 172 } | 178 } |
| 173 | 179 |
| 174 #endif // ENABLE(SVG) | 180 #endif // ENABLE(SVG) |
| OLD | NEW |