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

Side by Side Diff: third_party/WebKit/Source/core/style/StyleNonInheritedVariables.cpp

Issue 2366313006: CSS Properties and Values API: Support non-inherited custom properties (Closed)
Patch Set: use de morgan's law 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/style/StyleNonInheritedVariables.h"
6
7 #include "core/style/DataEquivalency.h"
8
9 namespace blink {
10
11 bool StyleNonInheritedVariables::operator==(const StyleNonInheritedVariables& ot her) const
12 {
13 if (m_data.size() != other.m_data.size())
14 return false;
15
16 for (const auto& iter : m_data) {
17 RefPtr<CSSVariableData> otherData = other.m_data.get(iter.key);
18 if (!dataEquivalent(iter.value, otherData))
19 return false;
20 }
21
22 return true;
23 }
24
25 CSSVariableData* StyleNonInheritedVariables::getVariable(const AtomicString& nam e) const
26 {
27 return m_data.get(name);
28 }
29
30 void StyleNonInheritedVariables::setRegisteredVariable(const AtomicString& name, const CSSValue* parsedValue)
31 {
32 m_registeredData.set(name, const_cast<CSSValue*>(parsedValue));
33 }
34
35 void StyleNonInheritedVariables::removeVariable(const AtomicString& name)
36 {
37 m_data.set(name, nullptr);
38 m_registeredData.set(name, nullptr);
39 }
40
41 StyleNonInheritedVariables::StyleNonInheritedVariables(StyleNonInheritedVariable s& other)
42 {
43 m_data = other.m_data;
44 m_registeredData = other.m_registeredData;
45 }
46
47 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698