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

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

Issue 2298783002: Resolve percentage in <use> against the instance's viewport element (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/use-nested-symbol-viewport-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
4 * Copyright (C) 2009 Google, Inc. 4 * Copyright (C) 2009 Google, Inc.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 SVGUseElement* useElement = nullptr; 83 SVGUseElement* useElement = nullptr;
84 if (isSVGUseElement(*element)) { 84 if (isSVGUseElement(*element)) {
85 useElement = toSVGUseElement(element); 85 useElement = toSVGUseElement(element);
86 } else if (isSVGGElement(*element) && toSVGGElement(element)->inUseShadowTre e()) { 86 } else if (isSVGGElement(*element) && toSVGGElement(element)->inUseShadowTre e()) {
87 SVGElement* correspondingElement = element->correspondingElement(); 87 SVGElement* correspondingElement = element->correspondingElement();
88 if (isSVGUseElement(correspondingElement)) 88 if (isSVGUseElement(correspondingElement))
89 useElement = toSVGUseElement(correspondingElement); 89 useElement = toSVGUseElement(correspondingElement);
90 } 90 }
91 91
92 if (useElement) { 92 if (useElement) {
93 SVGLengthContext lengthContext(useElement); 93 SVGLengthContext lengthContext(element);
94 FloatSize translation( 94 FloatSize translation(
95 useElement->x()->currentValue()->value(lengthContext), 95 useElement->x()->currentValue()->value(lengthContext),
96 useElement->y()->currentValue()->value(lengthContext)); 96 useElement->y()->currentValue()->value(lengthContext));
97 // TODO(fs): Signal this on style update instead. (Since these are 97 // TODO(fs): Signal this on style update instead. (Since these are
98 // suppose to be presentation attributes now, this does feel a bit 98 // suppose to be presentation attributes now, this does feel a bit
99 // broken...) 99 // broken...)
100 if (translation != m_additionalTranslation) 100 if (translation != m_additionalTranslation)
101 setNeedsTransformUpdate(); 101 setNeedsTransformUpdate();
102 m_additionalTranslation = translation; 102 m_additionalTranslation = translation;
103 } 103 }
104 104
105 if (!m_needsTransformUpdate) 105 if (!m_needsTransformUpdate)
106 return SVGTransformChange::None; 106 return SVGTransformChange::None;
107 107
108 SVGTransformChangeDetector changeDetector(m_localTransform); 108 SVGTransformChangeDetector changeDetector(m_localTransform);
109 m_localTransform = element->calculateAnimatedLocalTransform(); 109 m_localTransform = element->calculateAnimatedLocalTransform();
110 m_localTransform.translate(m_additionalTranslation.width(), m_additionalTran slation.height()); 110 m_localTransform.translate(m_additionalTranslation.width(), m_additionalTran slation.height());
111 m_needsTransformUpdate = false; 111 m_needsTransformUpdate = false;
112 return changeDetector.computeChange(m_localTransform); 112 return changeDetector.computeChange(m_localTransform);
113 } 113 }
114 114
115 } // namespace blink 115 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/use-nested-symbol-viewport-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698