OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> | 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
3 * Copyright (C) 2006 Apple Computer Inc. | 3 * Copyright (C) 2006 Apple Computer Inc. |
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
5 * Copyright (C) 2008 Rob Buis <buis@kde.org> | 5 * Copyright (C) 2008 Rob Buis <buis@kde.org> |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // characters. Then it will convert all tab characters into space characters
. | 53 // characters. Then it will convert all tab characters into space characters
. |
54 // Then, it will strip off all leading and trailing space characters. | 54 // Then, it will strip off all leading and trailing space characters. |
55 // Then, all contiguous space characters will be consolidated. | 55 // Then, all contiguous space characters will be consolidated. |
56 RefPtr<StringImpl> newString = string->replace('\n', StringImpl::empty()); | 56 RefPtr<StringImpl> newString = string->replace('\n', StringImpl::empty()); |
57 newString = newString->replace('\r', StringImpl::empty()); | 57 newString = newString->replace('\r', StringImpl::empty()); |
58 newString = newString->replace('\t', ' '); | 58 newString = newString->replace('\t', ' '); |
59 return newString.release(); | 59 return newString.release(); |
60 } | 60 } |
61 | 61 |
62 LayoutSVGInlineText::LayoutSVGInlineText(Node* n, PassRefPtr<StringImpl> string) | 62 LayoutSVGInlineText::LayoutSVGInlineText(Node* n, PassRefPtr<StringImpl> string) |
63 : RenderText(n, applySVGWhitespaceRules(string, false)) | 63 : LayoutText(n, applySVGWhitespaceRules(string, false)) |
64 , m_scalingFactor(1) | 64 , m_scalingFactor(1) |
65 , m_layoutAttributes(this) | 65 , m_layoutAttributes(this) |
66 { | 66 { |
67 } | 67 } |
68 | 68 |
69 void LayoutSVGInlineText::setTextInternal(PassRefPtr<StringImpl> text) | 69 void LayoutSVGInlineText::setTextInternal(PassRefPtr<StringImpl> text) |
70 { | 70 { |
71 RenderText::setTextInternal(text); | 71 LayoutText::setTextInternal(text); |
72 if (LayoutSVGText* textRenderer = LayoutSVGText::locateLayoutSVGTextAncestor
(this)) | 72 if (LayoutSVGText* textRenderer = LayoutSVGText::locateLayoutSVGTextAncestor
(this)) |
73 textRenderer->subtreeTextDidChange(this); | 73 textRenderer->subtreeTextDidChange(this); |
74 } | 74 } |
75 | 75 |
76 void LayoutSVGInlineText::styleDidChange(StyleDifference diff, const LayoutStyle
* oldStyle) | 76 void LayoutSVGInlineText::styleDidChange(StyleDifference diff, const LayoutStyle
* oldStyle) |
77 { | 77 { |
78 RenderText::styleDidChange(diff, oldStyle); | 78 LayoutText::styleDidChange(diff, oldStyle); |
79 updateScaledFont(); | 79 updateScaledFont(); |
80 | 80 |
81 bool newPreserves = style() ? style()->whiteSpace() == PRE : false; | 81 bool newPreserves = style() ? style()->whiteSpace() == PRE : false; |
82 bool oldPreserves = oldStyle ? oldStyle->whiteSpace() == PRE : false; | 82 bool oldPreserves = oldStyle ? oldStyle->whiteSpace() == PRE : false; |
83 if (oldPreserves != newPreserves) { | 83 if (oldPreserves != newPreserves) { |
84 setText(originalText(), true); | 84 setText(originalText(), true); |
85 return; | 85 return; |
86 } | 86 } |
87 | 87 |
88 if (!diff.needsFullLayout()) | 88 if (!diff.needsFullLayout()) |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 LayoutRect LayoutSVGInlineText::clippedOverflowRectForPaintInvalidation(const La
youtBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* pa
intInvalidationState) const | 237 LayoutRect LayoutSVGInlineText::clippedOverflowRectForPaintInvalidation(const La
youtBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* pa
intInvalidationState) const |
238 { | 238 { |
239 // FIXME: The following works because LayoutSVGBlock has forced slow rect ma
pping of the paintInvalidationState. | 239 // FIXME: The following works because LayoutSVGBlock has forced slow rect ma
pping of the paintInvalidationState. |
240 // Should let this really work with paintInvalidationState's fast mapping an
d remove the assert. | 240 // Should let this really work with paintInvalidationState's fast mapping an
d remove the assert. |
241 ASSERT(!paintInvalidationState || !paintInvalidationState->canMapToContainer
(paintInvalidationContainer)); | 241 ASSERT(!paintInvalidationState || !paintInvalidationState->canMapToContainer
(paintInvalidationContainer)); |
242 return parent()->clippedOverflowRectForPaintInvalidation(paintInvalidationCo
ntainer, paintInvalidationState); | 242 return parent()->clippedOverflowRectForPaintInvalidation(paintInvalidationCo
ntainer, paintInvalidationState); |
243 } | 243 } |
244 | 244 |
245 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const | 245 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const |
246 { | 246 { |
247 RefPtr<StringImpl> result = RenderText::originalText(); | 247 RefPtr<StringImpl> result = LayoutText::originalText(); |
248 if (!result) | 248 if (!result) |
249 return nullptr; | 249 return nullptr; |
250 return applySVGWhitespaceRules(result, style() && style()->whiteSpace() == P
RE); | 250 return applySVGWhitespaceRules(result, style() && style()->whiteSpace() == P
RE); |
251 } | 251 } |
252 | 252 |
253 } | 253 } |
OLD | NEW |