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

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

Issue 2779353002: Add operator<< to StyleDifference for debug logging. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/style/StyleDifference.cpp
diff --git a/third_party/WebKit/Source/core/style/StyleDifference.cpp b/third_party/WebKit/Source/core/style/StyleDifference.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..cd085be9ad8e42bde4008f4c8d5b1a2beb20d8ca
--- /dev/null
+++ b/third_party/WebKit/Source/core/style/StyleDifference.cpp
@@ -0,0 +1,87 @@
+// Copyright 2017 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 "core/style/StyleDifference.h"
+
+namespace blink {
+
+std::ostream& operator<<(std::ostream& out, const StyleDifference& diff) {
+ out << "StyleDifference{layoutType=";
+
+ switch (diff.m_layoutType) {
+ case StyleDifference::NoLayout:
+ out << "NoLayout";
+ break;
+ case StyleDifference::PositionedMovement:
+ out << "PositionedMovement";
+ break;
+ case StyleDifference::FullLayout:
+ out << "FullLayout";
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
+
+ out << ", paintInvalidationType=";
+ switch (diff.m_paintInvalidationType) {
+ case StyleDifference::NoPaintInvalidation:
+ out << "NoPaintInvalidation";
+ break;
+ case StyleDifference::PaintInvalidationObject:
+ out << "PaintInvalidationObject";
+ break;
+ case StyleDifference::PaintInvalidationSubtree:
+ out << "PaintInvalidationSubtree";
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
+
+ out << ", recomputeOverflow=" << diff.m_recomputeOverflow;
+
+ out << ", propertySpecificDifferences=";
+ int diffCount = 0;
+ for (int i = 0; i < StyleDifference::kPropertyDifferenceCount; i++) {
+ unsigned bitTest = 1 << i;
+ if (diff.m_propertySpecificDifferences & bitTest) {
+ if (diffCount++ > 0)
+ out << "|";
+ switch (bitTest) {
+ case StyleDifference::TransformChanged:
+ out << "TransformChanged";
+ break;
+ case StyleDifference::OpacityChanged:
+ out << "OpacityChanged";
+ break;
+ case StyleDifference::ZIndexChanged:
+ out << "ZIndexChanged";
+ break;
+ case StyleDifference::FilterChanged:
+ out << "FilterChanged";
+ break;
+ case StyleDifference::BackdropFilterChanged:
+ out << "BackdropFilterChanged";
+ break;
+ case StyleDifference::CSSClipChanged:
+ out << "CSSClipChanged";
+ break;
+ case StyleDifference::TextDecorationOrColorChanged:
+ out << "TextDecorationOrColorChanged";
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
+ }
+ }
+
+ out << ", scrollAnchorDisablingPropertyChanged="
+ << diff.m_scrollAnchorDisablingPropertyChanged;
+
+ return out << "}";
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleDifference.h ('k') | third_party/WebKit/Source/core/style/StyleDifferenceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698