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

Side by Side Diff: third_party/WebKit/Source/core/svg/properties/SVGAnimatedProperty.cpp

Issue 2485663002: Store CSSPropertyID in SVGAnimatedPropertyBase (Closed)
Patch Set: Add missing case Created 4 years, 1 month 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 19 matching lines...) Expand all
30 30
31 #include "core/svg/properties/SVGAnimatedProperty.h" 31 #include "core/svg/properties/SVGAnimatedProperty.h"
32 32
33 #include "core/svg/SVGElement.h" 33 #include "core/svg/SVGElement.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 SVGAnimatedPropertyBase::SVGAnimatedPropertyBase( 37 SVGAnimatedPropertyBase::SVGAnimatedPropertyBase(
38 AnimatedPropertyType type, 38 AnimatedPropertyType type,
39 SVGElement* contextElement, 39 SVGElement* contextElement,
40 const QualifiedName& attributeName) 40 const QualifiedName& attributeName,
41 CSSPropertyID cssPropertyId)
41 : m_type(type), 42 : m_type(type),
43 m_cssPropertyId(cssPropertyId),
42 m_isReadOnly(false), 44 m_isReadOnly(false),
43 m_contextElement(contextElement), 45 m_contextElement(contextElement),
44 m_attributeName(attributeName) { 46 m_attributeName(attributeName) {
45 ASSERT(m_contextElement); 47 DCHECK(m_contextElement);
46 ASSERT(m_attributeName != QualifiedName::null()); 48 DCHECK(m_attributeName != QualifiedName::null());
49 DCHECK_EQ(this->type(), type);
50 DCHECK_EQ(this->cssPropertyId(), cssPropertyId);
47 } 51 }
48 52
49 SVGAnimatedPropertyBase::~SVGAnimatedPropertyBase() {} 53 SVGAnimatedPropertyBase::~SVGAnimatedPropertyBase() {}
50 54
51 void SVGAnimatedPropertyBase::animationEnded() { 55 void SVGAnimatedPropertyBase::animationEnded() {
52 synchronizeAttribute(); 56 synchronizeAttribute();
53 } 57 }
54 58
55 void SVGAnimatedPropertyBase::synchronizeAttribute() { 59 void SVGAnimatedPropertyBase::synchronizeAttribute() {
56 AtomicString value(currentValueBase()->valueAsString()); 60 AtomicString value(currentValueBase()->valueAsString());
57 m_contextElement->setSynchronizedLazyAttribute(m_attributeName, value); 61 m_contextElement->setSynchronizedLazyAttribute(m_attributeName, value);
58 } 62 }
59 63
60 bool SVGAnimatedPropertyBase::isSpecified() const { 64 bool SVGAnimatedPropertyBase::isSpecified() const {
61 return isAnimating() || contextElement()->hasAttribute(attributeName()); 65 return isAnimating() || contextElement()->hasAttribute(attributeName());
62 } 66 }
63 67
64 } // namespace blink 68 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698