Commit d301cfc6 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

[LayoutNG] Introduce CanUseInlineBox() for tracking project progress

This patch introduces |CanUseInlineBox()| as a preparation to add
|DCHECK(CanUseInlineBox())| to functions using |InlineBox| for marker of
progress of LayoutNG project. To release LayoutNG, we should not hit
these |DCHECK()|.

Following patch will utilize |CanUseInlineBox()| into layout/ and editing/.

The patch[1] is a sample of utilization.

[1] http://crrev.com/c/763188 [LayoutNG] Utilize DCHECK(CanUseInlineBox()) in
core/layout/


Bug: 591099, 707656
Change-Id: Id71c39ae8520ab18fd1b8b8f3e18a66e8a7d567c
Reviewed-on: https://chromium-review.googlesource.com/768572Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516239}
parent 543efda2
......@@ -372,6 +372,13 @@ void InlineBox::SetLineLayoutItemShouldDoFullPaintInvalidationIfNeeded() {
line_layout_item_.SetShouldDoFullPaintInvalidation();
}
bool CanUseInlineBox(const LayoutObject& node) {
DCHECK(node.IsText() || node.IsInline() || node.IsLayoutBlockFlow());
return !RuntimeEnabledFeatures::LayoutNGEnabled() ||
!RuntimeEnabledFeatures::LayoutNGPaintFragmentsEnabled() ||
!node.EnclosingNGBlockFlow();
}
} // namespace blink
#ifndef NDEBUG
......
......@@ -539,6 +539,10 @@ inline void InlineBox::SetHasBadParent() {
// interchangeably.
DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(InlineBox)
// TODO(layout-dev): Once LayoutNG supports inline layout, we should remove
// |CanUseInlineBox()|.
bool CanUseInlineBox(const LayoutObject&);
} // namespace blink
#ifndef NDEBUG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment