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

Make LayoutBox::ResolvedDirection() to utilize NGInlineCursor

This patch makes |LayoutBox::ResolvedDirection()| to utilize |NGInlineCursor|
for prepration of migrating to |NGFragmentItem|.

Bug: 982194
Change-Id: I4560959b10d83a2c9b2b50815921eaa37301a3b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1909671
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714170}
parent 63f7d15e
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet.h" #include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet.h"
#include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet_global_scope_proxy.h" #include "third_party/blink/renderer/core/layout/ng/custom/layout_worklet_global_scope_proxy.h"
#include "third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut.h" #include "third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut.h"
#include "third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.h"
#include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h"
#include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h"
#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h"
...@@ -6372,14 +6373,14 @@ float LayoutBox::VisualRectOutsetForRasterEffects() const { ...@@ -6372,14 +6373,14 @@ float LayoutBox::VisualRectOutsetForRasterEffects() const {
TextDirection LayoutBox::ResolvedDirection() const { TextDirection LayoutBox::ResolvedDirection() const {
if (IsInline() && IsAtomicInlineLevel()) { if (IsInline() && IsAtomicInlineLevel()) {
const auto fragments = NGPaintFragment::InlineFragmentsFor(this); if (IsInLayoutNGInlineFormattingContext()) {
if (fragments.IsInLayoutNGInlineFormattingContext()) { NGInlineCursor cursor;
if (!fragments.IsEmpty()) { cursor.MoveTo(*this);
return fragments.front().PhysicalFragment().ResolvedDirection(); if (cursor)
} return cursor.CurrentResolvedDirection();
} else if (InlineBoxWrapper()) {
return InlineBoxWrapper()->Direction();
} }
if (InlineBoxWrapper())
return InlineBoxWrapper()->Direction();
} }
return StyleRef().Direction(); return StyleRef().Direction();
} }
......
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