Commit 8e2a2ede authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

[NGFagmentItem] Make LinkHighlightImpl::Paint() to use NGInlineCursor only for LayoutNG

This patch changes |LinkHighlightImpl::Paint()| to use |NGInlineCursor| only
for LayoutNG tree to avoid hitting |DCHECK()| when runtime enabled feature
LayoutNG disabled but LayoutNGFragmentItem enabled, e.g.
linux_layout_tests_layout_ng_disabled bot.

This is follow-up of the CL[1] which makes |LinkHighlightImpl::Paint()| to
use |NGInlineCursor|.

[1] http://crrev.com/c/2097777 [NGFragmentItem] Stop using rounded rect for
link highlight when <a> has nested inline

Bug: 707656
Change-Id: If1b4c052510a76f58bb8016cb9110479709bd82e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2286090
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786168}
parent 676dbbef
......@@ -295,7 +295,8 @@ void LinkHighlightImpl::Paint(GraphicsContext& context) {
// <a>ABC<b>DEF</b>GHI</a>.
// See gesture-tapHighlight-simple-nested.html
if (RuntimeEnabledFeatures::LayoutNGFragmentItemEnabled() &&
use_rounded_rects && object->IsLayoutInline()) {
use_rounded_rects && object->IsLayoutInline() &&
object->IsInLayoutNGInlineFormattingContext()) {
NGInlineCursor cursor;
cursor.MoveTo(*object);
// When |LayoutInline| has more than one children, we render square
......
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