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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_units.h

Issue 2489953006: Utility routines for ng_units (Closed)
Patch Set: Added missing CORE_EXPORT Created 4 years, 1 month 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_units.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_units.h b/third_party/WebKit/Source/core/layout/ng/ng_units.h
index 8ea43bdcf50770ac4797cbb2cf439f2712889127..a6cad5b5cec036eec190539f6c3e434eade6659e 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_units.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_units.h
@@ -16,10 +16,12 @@ namespace blink {
class LayoutUnit;
struct NGPhysicalOffset;
struct NGPhysicalSize;
+struct NGBoxStrut;
struct MinAndMaxContentSizes {
LayoutUnit min_content;
LayoutUnit max_content;
+ LayoutUnit ShrinkToFit(LayoutUnit available_size) const;
};
struct NGLogicalSize {
@@ -38,6 +40,11 @@ struct NGLogicalSize {
}
};
+inline std::ostream& operator<<(std::ostream& stream,
+ const NGLogicalSize& value) {
+ return stream << value.inline_size << "x" << value.block_size;
+}
+
// NGLogicalOffset is the position of a rect (typically a fragment) relative to
// its parent rect in the logical coordinate system.
struct NGLogicalOffset {
@@ -167,16 +174,17 @@ struct NGPixelSnappedPhysicalRect {
// Struct to store physical dimensions, independent of writing mode and
// direction.
// See https://drafts.csswg.org/css-writing-modes-3/#abstract-box
-struct NGPhysicalBoxStrut {
+struct CORE_EXPORT NGPhysicalBoxStrut {
LayoutUnit left;
LayoutUnit right;
LayoutUnit top;
LayoutUnit bottom;
+ NGBoxStrut ConvertToLogical(NGWritingMode, TextDirection) const;
};
// This struct is used for storing margins, borders or padding of a box on all
// four edges.
-struct NGBoxStrut {
+struct CORE_EXPORT NGBoxStrut {
LayoutUnit inline_start;
LayoutUnit inline_end;
LayoutUnit block_start;
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc ('k') | third_party/WebKit/Source/core/layout/ng/ng_units.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698