We want to break calls of ComputeInlineBoxPosition as follows:
Before breaking:
box_position = ComputeInlineBoxPosition(position);
After breaking:
adjusted = ComputeInlineAdjustedPosition(position);
// Alternative implementation for LayoutNG
box_position = ComputeInlineBoxPositionForInlineAdjustedPosition(adjusted);
However, to ensure no behavior change in the above refactoring, |position| and |adjusted| must have the same primary direction because ComputeInlineBoxPosition() passes the primary direction of |position| into ComputeInlineBoxPositionForInlineAdjustedPosition().
We should identify all callers of ComputeInlineBoxPositionForInlineAdjustedPosition using a wrong primary direction, do investigation and try to eliminate them.
Two known callers are SelectionModifier's LeftPositionOf() and RightPositionOf().
Comment 1 by xiaoche...@chromium.org
, Dec 7 2017