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

Unified Diff: third_party/WebKit/Source/core/layout/ng/NGBlockLayoutAlgorithm.cpp

Issue 2222133002: [layoutng] Initial version of block layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/NGBlockLayoutAlgorithm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/NGBlockLayoutAlgorithm.cpp
diff --git a/third_party/WebKit/Source/core/layout/ng/NGBlockLayoutAlgorithm.cpp b/third_party/WebKit/Source/core/layout/ng/NGBlockLayoutAlgorithm.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b7d4b998524e729517dfe869f1d7154d4d09c63e
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/NGBlockLayoutAlgorithm.cpp
@@ -0,0 +1,40 @@
+// 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/NGBlockLayoutAlgorithm.h"
+
+#include "core/layout/LayoutBox.h"
+#include "core/layout/ng/NGConstraintSpace.h"
+#include "core/style/ComputedStyle.h"
+
+namespace blink {
+
+NGBlockLayoutAlgorithm::NGBlockLayoutAlgorithm()
+{
+}
+
+NGConstraintSpace NGBlockLayoutAlgorithm::createConstraintSpaceFromLayoutObject(const LayoutBox& child)
+{
+ bool fixedInline = false, fixedBlock = false;
+ // XXX for orthogonal writing mode this is not right
+ LayoutUnit containerLogicalWidth = std::max(LayoutUnit(), child.containingBlockLogicalWidthForContent());
+ // XXX Make sure this height is correct
+ LayoutUnit containerLogicalHeight = child.containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding);
+ if (child.hasOverrideLogicalContentWidth()) {
+ containerLogicalWidth = child.overrideLogicalContentWidth();
+ fixedInline = true;
+ }
+ if (child.hasOverrideLogicalContentHeight()) {
+ containerLogicalWidth = child.overrideLogicalContentHeight();
+ fixedBlock = true;
+ }
+ NGConstraintSpace space(containerLogicalWidth, containerLogicalHeight);
+ // XXX vertical writing mode
+ space.setOverflowTriggersScrollbar(child.styleRef().overflowX() == OverflowAuto,
+ child.styleRef().overflowY() == OverflowAuto);
+ space.setFixedSize(fixedInline, fixedBlock);
+ return space;
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/NGBlockLayoutAlgorithm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698