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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/geometry/ng_logical_rect.cc

Issue 2721613003: [LayoutNG] Move remaining ng_units structs to their own files (Closed)
Patch Set: Don't export NGBoxStrut for now 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 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/layout/ng/geometry/ng_logical_rect.h"
6
7 #include "wtf/text/WTFString.h"
8
9 namespace blink {
10
11 bool NGLogicalRect::IsEmpty() const {
12 return size.IsEmpty();
13 }
14
15 bool NGLogicalRect::IsContained(const NGLogicalRect& other) const {
16 return !(InlineEndOffset() <= other.InlineStartOffset() ||
17 BlockEndOffset() <= other.BlockStartOffset() ||
18 InlineStartOffset() >= other.InlineEndOffset() ||
19 BlockStartOffset() >= other.BlockEndOffset());
20 }
21
22 bool NGLogicalRect::operator==(const NGLogicalRect& other) const {
23 return std::tie(other.offset, other.size) == std::tie(offset, size);
24 }
25
26 String NGLogicalRect::ToString() const {
27 return String::format("%s,%s %sx%s",
28 offset.inline_offset.toString().ascii().data(),
29 offset.block_offset.toString().ascii().data(),
30 size.inline_size.toString().ascii().data(),
31 size.block_size.toString().ascii().data());
32 }
33
34 std::ostream& operator<<(std::ostream& os, const NGLogicalRect& value) {
35 return os << value.ToString();
36 }
37
38 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698