computeInlineDirectionPositionsForSegment(lineBox, lineInfo, textAlign, lineLogicalLeft, availableLogicalWidth, firstRun, trailingSpaceRun, textBoxDataMap, verticalPositionCache, wordMeasurements);
// The widths of all runs are now known. We can now place every inline box (and
// compute accurate widths for the inline flow boxes).
- needsWordSpacing = false;
+ needsWordSpacing = lineBox->isLeftToRightDirection() ? false: true;
lineBox->placeBoxesInInlineDirection(lineLogicalLeft, needsWordSpacing);
}
{
RootInlineBox* boxToDelete = startLine;
while (boxToDelete && boxToDelete != stopLine) {
- layoutState.updateRepaintRangeFromBox(boxToDelete);
+ layoutState.updatePaintInvalidationRangeFromBox(boxToDelete);
// Note: deleteLineRange(firstRootBox()) is not identical to deleteLineBoxTree().
// deleteLineBoxTree uses nextLineBox() instead of nextRootBox() when traversing.
RootInlineBox* next = boxToDelete->nextRootBox();
determineEndPosition(layoutState, startLine, cleanLineStart, cleanLineBidiStatus);
if (startLine) {
- if (!layoutState.usesRepaintBounds())
- layoutState.setRepaintRange(logicalHeight());
+ if (!layoutState.usesPaintInvalidationBounds())
+ layoutState.setPaintInvalidationRange(logicalHeight());
deleteLineRange(layoutState, startLine);
}
layoutRunsAndFloatsInRange(layoutState, resolver, cleanLineStart, cleanLineBidiStatus);
linkToEndLineIfNeeded(layoutState);
- repaintDirtyFloats(layoutState.floats());
+ markDirtyFloatsForPaintInvalidation(layoutState.floats());
}
// Before restarting the layout loop with a new logicalHeight, remove all floats that were added and reset the resolver.
if (lineBox) {
lineBox->setLineBreakInfo(endOfLine.object(), endOfLine.offset(), resolver.status());
- if (layoutState.usesRepaintBounds())
- layoutState.updateRepaintRangeFromBox(lineBox);
+ if (layoutState.usesPaintInvalidationBounds())
+ layoutState.updatePaintInvalidationRangeFromBox(lineBox);
if (paginated) {
LayoutUnit adjustment = 0;
if (adjustment) {
LayoutUnit oldLineWidth = availableLogicalWidthForLine(oldLogicalHeight, layoutState.lineInfo().isFirstLine());
lineBox->adjustBlockDirectionPosition(adjustment.toFloat());
- if (layoutState.usesRepaintBounds())
- layoutState.updateRepaintRangeFromBox(lineBox);
+ if (layoutState.usesPaintInvalidationBounds())
+ layoutState.updatePaintInvalidationRangeFromBox(lineBox);
if (availableLogicalWidthForLine(oldLogicalHeight + adjustment, layoutState.lineInfo().isFirstLine()) != oldLineWidth) {
// We have to delete this line, remove all floats that got added, and let line layout re-run.
adjustLinePositionForPagination(line, delta, layoutState.flowThread());
}
if (delta) {
- layoutState.updateRepaintRangeFromBox(line, delta);
+ layoutState.updatePaintInvalidationRangeFromBox(line, delta);
line->adjustBlockDirectionPosition(delta.toFloat());
}
if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr()) {
// In case we have a float on the last line, it might not be positioned up to now.
// This has to be done before adding in the bottom border/padding, or the float will
// include the padding incorrectly. -dwh
+ const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
+ FloatingObjectSetIterator it = floatingObjectSet.begin();
+ FloatingObjectSetIterator end = floatingObjectSet.end();
+ if (layoutState.lastFloat()) {
+ FloatingObjectSetIterator lastFloatIterator = floatingObjectSet.find(layoutState.lastFloat());
+ ASSERT(lastFloatIterator != end);
+ ++lastFloatIterator;
+ it = lastFloatIterator;
+ }
+ layoutState.setLastFloat(!floatingObjectSet.isEmpty() ? floatingObjectSet.last().get() : 0);
+
+ if (it == end)
+ return;
+
if (layoutState.checkForFloatsFromLastLine()) {
LayoutUnit bottomVisualOverflow = lastRootBox()->logicalBottomVisualOverflow();
LayoutUnit bottomLayoutOverflow = lastRootBox()->logicalBottomLayoutOverflow();
trailingFloatsLineBox->setOverflowFromLogicalRects(logicalLayoutOverflow, logicalVisualOverflow, trailingFloatsLineBox->lineTop(), trailingFloatsLineBox->lineBottom());
}
- const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
- FloatingObjectSetIterator it = floatingObjectSet.begin();
- FloatingObjectSetIterator end = floatingObjectSet.end();
- if (layoutState.lastFloat()) {
- FloatingObjectSetIterator lastFloatIterator = floatingObjectSet.find(layoutState.lastFloat());
- ASSERT(lastFloatIterator != end);
- ++lastFloatIterator;
- it = lastFloatIterator;
- }
for (; it != end; ++it)
appendFloatingObjectToLastLine(it->get());
- layoutState.setLastFloat(!floatingObjectSet.isEmpty() ? floatingObjectSet.last().get() : 0);
}
}
-void RenderBlockFlow::repaintDirtyFloats(Vector<FloatWithRect>& floats)
+void RenderBlockFlow::markDirtyFloatsForPaintInvalidation(Vector<FloatWithRect>& floats)
{
size_t floatCount = floats.size();
// Floats that did not have layout did not paint invalidations when we laid them out. They would have
updatePreferredWidth(maxLogicalWidth, inlineMax);
}
-void RenderBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom, LayoutUnit afterEdge)
+void RenderBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidationLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge)
{
RenderFlowThread* flowThread = flowThreadContainingBlock();
bool clearLinesForPagination = firstLineBox() && flowThread && !flowThread->hasRegions();
// Figure out if we should clear out our line boxes.
// FIXME: Handle resize eventually!
bool isFullLayout = !firstLineBox() || selfNeedsLayout() || relayoutChildren || clearLinesForPagination;
- LineLayoutState layoutState(isFullLayout, repaintLogicalTop, repaintLogicalBottom, flowThread);
+ LineLayoutState layoutState(isFullLayout, paintInvalidationLogicalTop, paintInvalidationLogicalBottom, flowThread);
if (isFullLayout) {
// Ensure the old line boxes will be erased.
break;
}
- layoutState.updateRepaintRangeFromBox(curr, paginationDelta);
+ layoutState.updatePaintInvalidationRangeFromBox(curr, paginationDelta);
curr->adjustBlockDirectionPosition(paginationDelta.toFloat());
}
}