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

Side by Side Diff: Source/core/svg/SVGSVGElement.cpp

Issue 986603002: Move "zoomAndPan enabled" logic from SVGDocumentExtensions to SVGSVGElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGSVGElement.h ('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, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2014 Google, Inc. 5 * Copyright (C) 2014 Google, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 m_translation->setValue(point); 202 m_translation->setValue(point);
203 updateCurrentTranslate(); 203 updateCurrentTranslate();
204 } 204 }
205 205
206 void SVGSVGElement::updateCurrentTranslate() 206 void SVGSVGElement::updateCurrentTranslate()
207 { 207 {
208 if (LayoutObject* object = renderer()) 208 if (LayoutObject* object = renderer())
209 object->setNeedsLayoutAndFullPaintInvalidation(); 209 object->setNeedsLayoutAndFullPaintInvalidation();
210 } 210 }
211 211
212 bool SVGSVGElement::zoomAndPanEnabled() const
213 {
214 const SVGZoomAndPan* currentViewSpec = this;
215 if (m_useCurrentView)
216 currentViewSpec = m_viewSpec.get();
217 return currentViewSpec && currentViewSpec->zoomAndPan() == SVGZoomAndPanMagn ify;
218 }
219
212 void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString & value) 220 void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString & value)
213 { 221 {
214 if (!nearestViewportElement()) { 222 if (!nearestViewportElement()) {
215 bool setListener = true; 223 bool setListener = true;
216 224
217 // Only handle events if we're the outermost <svg> element 225 // Only handle events if we're the outermost <svg> element
218 if (name == HTMLNames::onunloadAttr) 226 if (name == HTMLNames::onunloadAttr)
219 document().setWindowAttributeEventListener(EventTypeNames::unload, c reateAttributeEventListener(document().frame(), name, value, eventParameterName( ))); 227 document().setWindowAttributeEventListener(EventTypeNames::unload, c reateAttributeEventListener(document().frame(), name, value, eventParameterName( )));
220 else if (name == HTMLNames::onresizeAttr) 228 else if (name == HTMLNames::onresizeAttr)
221 document().setWindowAttributeEventListener(EventTypeNames::resize, c reateAttributeEventListener(document().frame(), name, value, eventParameterName( ))); 229 document().setWindowAttributeEventListener(EventTypeNames::resize, c reateAttributeEventListener(document().frame(), name, value, eventParameterName( )));
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 visitor->trace(m_width); 793 visitor->trace(m_width);
786 visitor->trace(m_height); 794 visitor->trace(m_height);
787 visitor->trace(m_translation); 795 visitor->trace(m_translation);
788 visitor->trace(m_timeContainer); 796 visitor->trace(m_timeContainer);
789 visitor->trace(m_viewSpec); 797 visitor->trace(m_viewSpec);
790 SVGGraphicsElement::trace(visitor); 798 SVGGraphicsElement::trace(visitor);
791 SVGFitToViewBox::trace(visitor); 799 SVGFitToViewBox::trace(visitor);
792 } 800 }
793 801
794 } // namespace blink 802 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/svg/SVGSVGElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698