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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 textRenderer->subtreeTextDidChange(this); | 73 textRenderer->subtreeTextDidChange(this); |
74 } | 74 } |
75 | 75 |
76 void RenderSVGInlineText::styleDidChange(StyleDifference diff, const RenderStyle * oldStyle) | 76 void RenderSVGInlineText::styleDidChange(StyleDifference diff, const RenderStyle * oldStyle) |
77 { | 77 { |
78 RenderText::styleDidChange(diff, oldStyle); | 78 RenderText::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(applySVGWhitespaceRules(originalText(), false), true); | 84 setText(originalText(), true); |
85 return; | 85 return; |
86 } | 86 } |
87 | 87 |
88 if (!oldPreserves && newPreserves) { | |
89 setText(applySVGWhitespaceRules(originalText(), true), true); | |
90 return; | |
91 } | |
92 | |
93 if (!diff.needsFullLayout()) | 88 if (!diff.needsFullLayout()) |
94 return; | 89 return; |
95 | 90 |
96 // The text metrics may be influenced by style changes. | 91 // The text metrics may be influenced by style changes. |
97 if (RenderSVGText* textRenderer = RenderSVGText::locateRenderSVGTextAncestor (this)) | 92 if (RenderSVGText* textRenderer = RenderSVGText::locateRenderSVGTextAncestor (this)) |
98 textRenderer->setNeedsLayoutAndFullPaintInvalidation(); | 93 textRenderer->setNeedsLayoutAndFullPaintInvalidation(); |
99 } | 94 } |
100 | 95 |
101 InlineTextBox* RenderSVGInlineText::createTextBox(int start, unsigned short leng th) | 96 InlineTextBox* RenderSVGInlineText::createTextBox(int start, unsigned short leng th) |
102 { | 97 { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 } | 235 } |
241 | 236 |
242 LayoutRect RenderSVGInlineText::clippedOverflowRectForPaintInvalidation(const Re nderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) const | 237 LayoutRect RenderSVGInlineText::clippedOverflowRectForPaintInvalidation(const Re nderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) const |
243 { | 238 { |
244 // FIXME: The following works because RenderSVGBlock has forced slow rect ma pping of the paintInvalidationState. | 239 // FIXME: The following works because RenderSVGBlock has forced slow rect ma pping of the paintInvalidationState. |
245 // 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. |
246 ASSERT(!paintInvalidationState || !paintInvalidationState->canMapToContainer (paintInvalidationContainer)); | 241 ASSERT(!paintInvalidationState || !paintInvalidationState->canMapToContainer (paintInvalidationContainer)); |
247 return parent()->clippedOverflowRectForPaintInvalidation(paintInvalidationCo ntainer, paintInvalidationState); | 242 return parent()->clippedOverflowRectForPaintInvalidation(paintInvalidationCo ntainer, paintInvalidationState); |
248 } | 243 } |
249 | 244 |
245 PassRefPtr<StringImpl> RenderSVGInlineText::originalText() const | |
246 { | |
247 RefPtr<StringImpl> result = RenderText::originalText(); | |
248 if (!result) | |
249 return nullptr; | |
250 return applySVGWhitespaceRules(result, style() ? (style()->whiteSpace() == P RE) : false); | |
fs
2014/10/30 12:31:38
Nit: "style() && style()->whiteSpace() == PRE" fee
| |
250 } | 251 } |
252 | |
253 } | |
OLD | NEW |