Refactor RenderVTTCue/SnapToLinesLayouter

Simplify RenderVTTCue::findFirstLineBox, and have it return the flow box
instead of using an out parameter.

Stop mutating the 'switched' bool in the helper methods, getting the
logic more out "in the open" (in the step loop). For the same reason
remove the switchDirection method to expose the interaction with the
'switched' flag.

Split SnapToLinesLayouter::initializeLayoutParameters into one part that
determines the 'step' and one that computes the initial position
adjustment. Move the first part into SnapToLinesLayouter::layout, and
the second into the new method
SnapToLinesLayouter::computeInitialPositionAdjustment.

Generalize moveBoxesByStep to moveBoxesBy and use it for computing the
default/initial position as well. Hoist the call for the latter into
SnapToLinesLayouter::layout and rename placeBoxInDefaultPosition to
initializeFallbackPositioningState.

BUG=301580

Review URL: https://codereview.chromium.org/882023003

git-svn-id: svn://svn.chromium.org/blink/trunk@189128 bbb929c8-8fbe-4397-9dbb-9b2b20218538
1 file changed
tree: f8b241acaeb7b1be155fc05db466a81fcf8aa075
  1. third_party/