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: third_party/WebKit/Source/core/animation/PropertyHandle.cpp

Issue 2309873003: Extend PropertyHandle to include custom property identifiers (Closed)
Patch Set: Add unit tests Created 4 years, 2 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/animation/PropertyHandle.h" 5 #include "core/animation/PropertyHandle.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 bool PropertyHandle::operator==(const PropertyHandle& other) const 9 bool PropertyHandle::operator==(const PropertyHandle& other) const
10 { 10 {
11 if (m_handleType != other.m_handleType) 11 if (m_handleType != other.m_handleType)
12 return false; 12 return false;
13 13
14 switch (m_handleType) { 14 switch (m_handleType) {
15 case HandleCSSProperty: 15 case HandleCSSProperty:
16 case HandlePresentationAttribute: 16 case HandlePresentationAttribute:
17 return m_cssProperty == other.m_cssProperty; 17 return m_cssProperty == other.m_cssProperty;
18 case HandleCSSCustomProperty:
19 return m_propertyName == other.m_propertyName;
18 case HandleSVGAttribute: 20 case HandleSVGAttribute:
19 return m_svgAttribute == other.m_svgAttribute; 21 return m_svgAttribute == other.m_svgAttribute;
20 default: 22 default:
21 return true; 23 return true;
22 } 24 }
23 } 25 }
24 26
25 unsigned PropertyHandle::hash() const 27 unsigned PropertyHandle::hash() const
26 { 28 {
27 switch (m_handleType) { 29 switch (m_handleType) {
28 case HandleCSSProperty: 30 case HandleCSSProperty:
29 return m_cssProperty; 31 return m_cssProperty;
32 case HandleCSSCustomProperty:
33 return m_propertyName->existingHash();
30 case HandlePresentationAttribute: 34 case HandlePresentationAttribute:
31 return -m_cssProperty; 35 return -m_cssProperty;
32 case HandleSVGAttribute: 36 case HandleSVGAttribute:
33 return QualifiedNameHash::hash(*m_svgAttribute); 37 return QualifiedNameHash::hash(*m_svgAttribute);
34 default: 38 default:
35 NOTREACHED(); 39 NOTREACHED();
36 return 0; 40 return 0;
37 } 41 }
38 } 42 }
39 43
40 } // namespace blink 44 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698