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

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

Issue 860063002: Initialize GC mixin bases only when leftmost vtable has been initialized. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add comments explaining purpose Created 5 years, 11 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 | « Source/core/svg/SVGFitToViewBox.h ('k') | Source/core/svg/SVGGradientElement.cpp » ('j') | 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, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Rob Buis <buis@kde.org>
4 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 4 * Copyright (C) 2014 Samsung Electronics. All rights reserved.
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 parseError = ParsingAttributeFailedError; 59 parseError = ParsingAttributeFailedError;
60 return; 60 return;
61 } 61 }
62 62
63 if (baseValue()->width() < 0 || baseValue()->height() < 0) { 63 if (baseValue()->width() < 0 || baseValue()->height() < 0) {
64 parseError = NegativeValueForbiddenError; 64 parseError = NegativeValueForbiddenError;
65 baseValue()->setInvalid(); 65 baseValue()->setInvalid();
66 } 66 }
67 } 67 }
68 68
69 SVGFitToViewBox::SVGFitToViewBox(SVGElement* element, PropertyMapPolicy property MapPolicy) 69 SVGFitToViewBox::SVGFitToViewBox()
70 : m_viewBox(SVGAnimatedViewBoxRect::create(element))
71 , m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(element, SVGN ames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create()))
72 { 70 {
71 }
72
73 void SVGFitToViewBox::initialize(SVGElement* element, PropertyMapPolicy property MapPolicy)
74 {
75 ASSERT(!m_viewBox);
76 ASSERT(!m_preserveAspectRatio);
73 ASSERT(element); 77 ASSERT(element);
78
79 m_viewBox = SVGAnimatedViewBoxRect::create(element);
80 m_preserveAspectRatio = SVGAnimatedPreserveAspectRatio::create(element, SVGN ames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create());
81
74 if (propertyMapPolicy == PropertyMapPolicyAdd) { 82 if (propertyMapPolicy == PropertyMapPolicyAdd) {
75 element->addToPropertyMap(m_viewBox); 83 element->addToPropertyMap(m_viewBox);
76 element->addToPropertyMap(m_preserveAspectRatio); 84 element->addToPropertyMap(m_preserveAspectRatio);
77 } 85 }
78 } 86 }
79 87
80 void SVGFitToViewBox::trace(Visitor* visitor) 88 void SVGFitToViewBox::trace(Visitor* visitor)
81 { 89 {
82 visitor->trace(m_viewBox); 90 visitor->trace(m_viewBox);
83 visitor->trace(m_preserveAspectRatio); 91 visitor->trace(m_preserveAspectRatio);
(...skipping 18 matching lines...) Expand all
102 supportedAttributes.add(SVGNames::preserveAspectRatioAttr); 110 supportedAttributes.add(SVGNames::preserveAspectRatioAttr);
103 } 111 }
104 112
105 void SVGFitToViewBox::updateViewBox(const FloatRect& rect) 113 void SVGFitToViewBox::updateViewBox(const FloatRect& rect)
106 { 114 {
107 ASSERT(m_viewBox); 115 ASSERT(m_viewBox);
108 m_viewBox->baseValue()->setValue(rect); 116 m_viewBox->baseValue()->setValue(rect);
109 } 117 }
110 118
111 } 119 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGFitToViewBox.h ('k') | Source/core/svg/SVGGradientElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698