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

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

Issue 2747193002: Fix instances of clang -Wbitfield-enum-conversion in Blink (Closed)
Patch Set: Add comment documenting why this cast is necessary Created 3 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.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) 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 22 matching lines...) Expand all
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 CSSPropertyID cssPropertyId)
42 : m_type(type), 42 : m_type(type),
43 m_cssPropertyId(cssPropertyId), 43 // Explicitly cast cssPropertyId to silence warnings about bitfield
44 // truncation.
Nico 2017/03/14 18:50:00 Maybe also say why this is safe?
Reid Kleckner 2017/03/14 19:37:25 The DCHECK_EQ is already checking that this is saf
Nico 2017/03/14 19:52:24 Which dcheck? The `DCHECK_EQ(this->cssPropertyId()
45 m_cssPropertyId(static_cast<unsigned>(cssPropertyId)),
44 m_contextElement(contextElement), 46 m_contextElement(contextElement),
45 m_attributeName(attributeName) { 47 m_attributeName(attributeName) {
46 DCHECK(m_contextElement); 48 DCHECK(m_contextElement);
47 DCHECK(m_attributeName != QualifiedName::null()); 49 DCHECK(m_attributeName != QualifiedName::null());
48 DCHECK_EQ(this->type(), type); 50 DCHECK_EQ(this->type(), type);
49 DCHECK_EQ(this->cssPropertyId(), cssPropertyId); 51 DCHECK_EQ(this->cssPropertyId(), cssPropertyId);
50 } 52 }
51 53
52 SVGAnimatedPropertyBase::~SVGAnimatedPropertyBase() {} 54 SVGAnimatedPropertyBase::~SVGAnimatedPropertyBase() {}
53 55
54 void SVGAnimatedPropertyBase::animationEnded() { 56 void SVGAnimatedPropertyBase::animationEnded() {
55 synchronizeAttribute(); 57 synchronizeAttribute();
56 } 58 }
57 59
58 void SVGAnimatedPropertyBase::synchronizeAttribute() { 60 void SVGAnimatedPropertyBase::synchronizeAttribute() {
59 AtomicString value(currentValueBase()->valueAsString()); 61 AtomicString value(currentValueBase()->valueAsString());
60 m_contextElement->setSynchronizedLazyAttribute(m_attributeName, value); 62 m_contextElement->setSynchronizedLazyAttribute(m_attributeName, value);
61 } 63 }
62 64
63 bool SVGAnimatedPropertyBase::isSpecified() const { 65 bool SVGAnimatedPropertyBase::isSpecified() const {
64 return isAnimating() || contextElement()->hasAttribute(attributeName()); 66 return isAnimating() || contextElement()->hasAttribute(attributeName());
65 } 67 }
66 68
67 } // namespace blink 69 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698