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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_min_max_content_size.cc

Issue 2721613003: [LayoutNG] Move remaining ng_units structs to their own files (Closed)
Patch Set: Rebase w/HEAD Created 3 years, 10 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/layout/ng/ng_min_max_content_size.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_min_max_content_size.cc b/third_party/WebKit/Source/core/layout/ng/ng_min_max_content_size.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d64eaa58b45af17df0b3d71d09ed9c44011d507c
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_min_max_content_size.cc
@@ -0,0 +1,19 @@
+// 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 "core/layout/ng/ng_min_max_content_size.h"
+
+namespace blink {
+
+LayoutUnit MinAndMaxContentSizes::ShrinkToFit(LayoutUnit available_size) const {
+ DCHECK_GE(max_content, min_content);
+ return std::min(max_content, std::max(min_content, available_size));
+}
+
+bool MinAndMaxContentSizes::operator==(
+ const MinAndMaxContentSizes& other) const {
+ return min_content == other.min_content && max_content == other.max_content;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698