Lines Matching refs:step

69 bool RenderVTTCue::initializeLayoutParameters(InlineFlowBox* firstLineBox, LayoutUnit& step, LayoutUnit& position)
75 // 1. Horizontal: Let step be the height of the first line box in boxes.
76 // Vertical: Let step be the width of the first line box in boxes.
77 step = m_cue->getWritingDirection() == VTTCue::Horizontal ? firstLineBox->height() : firstLineBox->width();
79 // 2. If step is zero, then jump to the step labeled done positioning below.
80 if (!step)
90 // 5. Let position be the result of multiplying step and line position.
91 position = step * linePosition;
94 // bounding box of the boxes in boxes, then increase position by step.
97 position += step;
106 // ... and negate step.
107 step = -step;
150 bool RenderVTTCue::shouldSwitchDirection(InlineFlowBox* firstLineBox, LayoutUnit step) const
157 // 12. Horizontal: If step is negative and the top of the first line
159 // or if step is positive and the bottom of the first line box in
161 // to the step labeled switch direction.
163 if (m_cue->getWritingDirection() == VTTCue::Horizontal && ((step < 0 && top < 0) || (step > 0 && bottom > parentHeight)))
166 // 12. Vertical: If step is negative and the left edge of the first line
168 // rendering area, or if step is positive and the right edge of the
170 // the video's rendering area, jump to the step labeled switch direction.
172 if (m_cue->getWritingDirection() != VTTCue::Horizontal && ((step < 0 && left < 0) || (step > 0 && right > parentWidth)))
178 void RenderVTTCue::moveBoxesByStep(LayoutUnit step)
181 // given by step. (If step is negative, then this will actually
184 setY(y() + step);
187 // given by step. (If step is negative, then this will actually
190 setX(x() + step);
193 bool RenderVTTCue::switchDirection(bool& switched, LayoutUnit& step)
196 // default position as determined in the step above labeled default.
200 // 16. If switched is true, jump to the step labeled done
205 // 17. Negate step.
206 step = -step;
216 LayoutUnit step;
222 if (!initializeLayoutParameters(firstLineBox, step, position))
230 // then jump to the step labeled done positioning.
232 if (!shouldSwitchDirection(firstLineBox, step)) {
234 // 14. Jump back to the step labeled step loop.
235 moveBoxesByStep(step);
236 } else if (!switchDirection(switched, step)) {
240 // 19. Jump back to the step labeled step loop.