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

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

Issue 2737173002: FontCachePurgePreventer is needed when computing MinPreferredWidth (Closed)
Patch Set: fix mac DCHECK 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc b/third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc
index bcfe05417fb3cb2000ac27b23972a769be8b5c16..eb6d1bccd17d2cfb68f4a7fda0363b61da682707 100644
--- a/third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc
+++ b/third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc
@@ -7,6 +7,7 @@
#include "core/layout/LayoutAnalyzer.h"
#include "core/layout/ng/ng_constraint_space.h"
#include "core/layout/ng/ng_fragment.h"
+#include "core/layout/ng/ng_min_max_content_size.h"
namespace blink {
@@ -50,4 +51,20 @@ void LayoutNGBlockFlow::layoutBlock(bool relayoutChildren) {
clearNeedsLayout();
}
+void LayoutNGBlockFlow::computeIntrinsicLogicalWidths(
+ LayoutUnit& minLogicalWidth,
+ LayoutUnit& maxLogicalWidth) const {
+ // TODO(layout-dev): This should be created in the constructor once instead.
+ // See also the comment in layoutBlock().
+ NGBlockNode* node = new NGBlockNode(const_cast<LayoutNGBlockFlow*>(this));
+ if (!node->CanUseNewLayout()) {
+ LayoutBlockFlow::computeIntrinsicLogicalWidths(minLogicalWidth,
+ maxLogicalWidth);
+ return;
+ }
+ MinMaxContentSize sizes = node->ComputeMinMaxContentSize();
+ minLogicalWidth = sizes.min_content;
+ maxLogicalWidth = sizes.max_content;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698