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

Get rid of redundant function call from LayoutInline::DirtyLinesFromChangedChild()

This patch gets rid of redundant function call introduces by the patch[1] from
|LayoutInline::DirtyLinesFromChangedChild()| and checking runtime flag before
calling non-cheap function call |EnclosingNGBlockFlow()| to avoid speed
regression.

This patch also removes a TODO comment from |SetAncestorLineBoxDirty()| call
site since the patch[2] explains it.

[1] http://crrev.com/c/768257: [LayoutNG] LayoutInline::DirtyLinesFromChangedChild()
[2] http://crrev.com/c/773455: Add a comment to LineLayoutInlineItem::SetAncestorLineBoxDirty()

Change-Id: I7eedd7753b0c901380c55c8234cc78ae65f82574
Reviewed-on: https://chromium-review.googlesource.com/774339Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517044}
parent 3c4e9c8a
......@@ -1350,12 +1350,8 @@ void LayoutInline::DirtyLinesFromChangedChild(
MarkingBehavior marking_behavior) {
// During layout tree construction, we can't detect whether this node is
// in LayoutNG or not.
if (Parent() && EnclosingNGBlockFlow()) {
// TODO(layout-dev): Once we supports box fragment level dirtiness,
// we should mark box fragments for |child| node only.
SelfNeedsLayout();
// TODO(layout-dev): We are not sure why do we need to tell ancestors
// line dirtiness. See also |LineLayoutItem::SetAncestorLineBoxDirty()|.
if (RuntimeEnabledFeatures::LayoutNGEnabled() && Parent() &&
EnclosingNGBlockFlow()) {
SetAncestorLineBoxDirty();
return;
}
......
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