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

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

Issue 1856393002: Simplify layout attribute invalidation in LayoutSVGText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 8 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) 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 : LayoutText(n, applySVGWhitespaceRules(string, false)) 62 : LayoutText(n, applySVGWhitespaceRules(string, false))
63 , m_scalingFactor(1) 63 , m_scalingFactor(1)
64 , m_layoutAttributes(this) 64 , m_layoutAttributes(this)
65 { 65 {
66 } 66 }
67 67
68 void LayoutSVGInlineText::setTextInternal(PassRefPtr<StringImpl> text) 68 void LayoutSVGInlineText::setTextInternal(PassRefPtr<StringImpl> text)
69 { 69 {
70 LayoutText::setTextInternal(text); 70 LayoutText::setTextInternal(text);
71 if (LayoutSVGText* textLayoutObject = LayoutSVGText::locateLayoutSVGTextAnce stor(this)) 71 if (LayoutSVGText* textLayoutObject = LayoutSVGText::locateLayoutSVGTextAnce stor(this))
72 textLayoutObject->subtreeTextDidChange(this); 72 textLayoutObject->subtreeTextDidChange();
73 } 73 }
74 74
75 void LayoutSVGInlineText::styleDidChange(StyleDifference diff, const ComputedSty le* oldStyle) 75 void LayoutSVGInlineText::styleDidChange(StyleDifference diff, const ComputedSty le* oldStyle)
76 { 76 {
77 LayoutText::styleDidChange(diff, oldStyle); 77 LayoutText::styleDidChange(diff, oldStyle);
78 updateScaledFont(); 78 updateScaledFont();
79 79
80 bool newPreserves = style() ? style()->whiteSpace() == PRE : false; 80 bool newPreserves = style() ? style()->whiteSpace() == PRE : false;
81 bool oldPreserves = oldStyle ? oldStyle->whiteSpace() == PRE : false; 81 bool oldPreserves = oldStyle ? oldStyle->whiteSpace() == PRE : false;
82 if (oldPreserves != newPreserves) { 82 if (oldPreserves != newPreserves) {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 243
244 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const 244 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const
245 { 245 {
246 RefPtr<StringImpl> result = LayoutText::originalText(); 246 RefPtr<StringImpl> result = LayoutText::originalText();
247 if (!result) 247 if (!result)
248 return nullptr; 248 return nullptr;
249 return applySVGWhitespaceRules(result, style() && style()->whiteSpace() == P RE); 249 return applySVGWhitespaceRules(result, style() && style()->whiteSpace() == P RE);
250 } 250 }
251 251
252 } // namespace blink 252 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698