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

Unified Diff: third_party/WebKit/Source/core/style/StyleVariableData.cpp

Issue 1537523003: Add correct equality testing for ComputedStyle's StyleVariableData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleVariableData.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/StyleVariableData.cpp
diff --git a/third_party/WebKit/Source/core/style/StyleVariableData.cpp b/third_party/WebKit/Source/core/style/StyleVariableData.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6f01a277e921feb7f033c03aa4dd20ad8ae36f19
--- /dev/null
+++ b/third_party/WebKit/Source/core/style/StyleVariableData.cpp
@@ -0,0 +1,27 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/style/StyleVariableData.h"
+
+#include "core/style/DataEquivalency.h"
+
+namespace blink {
+
+bool StyleVariableData::operator==(const StyleVariableData& other) const
+{
+ if (m_data.size() != other.m_data.size()) {
+ return false;
+ }
+
+ for (const auto& iter : m_data) {
+ RefPtr<CSSVariableData> otherData = other.m_data.get(iter.key);
+ if (!dataEquivalent(iter.value, otherData))
+ return false;
+ }
+
+ return true;
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleVariableData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698