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

Unified Diff: third_party/WebKit/Source/platform/LayoutUnit.cpp

Issue 2191233002: Add platform/geometry pretty printers for logging and testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fewer redundant spaces, more toString tests Created 4 years, 4 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/platform/LayoutUnit.cpp
diff --git a/third_party/WebKit/Source/platform/LayoutUnit.cpp b/third_party/WebKit/Source/platform/LayoutUnit.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..53f301424f83d9923b2482f236ee9e6d1e1acb77
--- /dev/null
+++ b/third_party/WebKit/Source/platform/LayoutUnit.cpp
@@ -0,0 +1,24 @@
+// Copyright 2016 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 "platform/LayoutUnit.h"
+
+#include "wtf/text/WTFString.h"
+
+namespace blink {
+
+String LayoutUnit::toString() const
+{
+ if (m_value == LayoutUnit::max().rawValue())
+ return "LayoutUnit::max(" + String::number(toDouble()) + ")";
+ if (m_value == LayoutUnit::min().rawValue())
+ return "LayoutUnit::min(" + String::number(toDouble()) + ")";
+ if (m_value == LayoutUnit::nearlyMax().rawValue())
+ return "LayoutUnit::nearlyMax(" + String::number(toDouble()) + ")";
+ if (m_value == LayoutUnit::nearlyMin().rawValue())
+ return "LayoutUnit::nearlyMin(" + String::number(toDouble()) + ")";
+ return String::number(toDouble());
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/LayoutUnit.h ('k') | third_party/WebKit/Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698