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

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

Issue 2399963002: [layoutng] margin: auto support (Closed)
Patch Set: one more test now passes! Created 4 years, 2 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_length_utils.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.h b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.h
index f5285dc6f2af80089773d9116f80a1167eb9c148..2a08e928c5546666b3d008978f9709fadf79d3d6 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.h
@@ -15,6 +15,7 @@ class LayoutUnit;
class Length;
class NGConstraintSpace;
struct NGBoxStrut;
+class NGFragment;
enum class LengthResolveType {
MinSize,
@@ -63,6 +64,15 @@ CORE_EXPORT NGBoxStrut computeBorders(const ComputedStyle&);
CORE_EXPORT NGBoxStrut computePadding(const NGConstraintSpace&,
const ComputedStyle&);
+// Resolves margin: auto in the inline direction after a box has been laid out.
+// This uses the container size from the constraint space and the box size from
+// the fragment to compute the margins that are auto, if any, and adjusts
+// the given NGBoxStrut accordingly.
+CORE_EXPORT void ApplyAutoMargins(const NGConstraintSpace&,
+ const ComputedStyle&,
+ const NGFragment&,
+ NGBoxStrut& margins);
+
} // namespace blink
#endif // NGLengthUtils_h

Powered by Google App Engine
This is Rietveld 408576698