예제 #1
0
void LineWidth::fitBelowFloats(bool isFirstLine) {
  ASSERT(!m_committedWidth);
  ASSERT(!fitsOnLine());
  m_block.positionNewFloats(m_block.logicalHeight(), this);

  LayoutUnit floatLogicalBottom;
  LayoutUnit lastFloatLogicalBottom = m_block.logicalHeight();
  LayoutUnit newLineWidth = m_availableWidth;
  LayoutUnit newLineLeft = m_left;
  LayoutUnit newLineRight = m_right;

  FloatingObject* lastFloatFromPreviousLine =
      m_block.lastFloatFromPreviousLine();
  if (lastFloatFromPreviousLine &&
      lastFloatFromPreviousLine->layoutObject()->shapeOutsideInfo())
    return wrapNextToShapeOutside(isFirstLine);

  while (true) {
    floatLogicalBottom =
        m_block.nextFloatLogicalBottomBelow(lastFloatLogicalBottom);
    if (floatLogicalBottom <= lastFloatLogicalBottom)
      break;

    newLineWidth = availableWidthAtOffset(
        m_block, floatLogicalBottom, indentText(), newLineLeft, newLineRight);
    lastFloatLogicalBottom = floatLogicalBottom;

    if (newLineWidth >= m_uncommittedWidth)
      break;
  }
  updateLineDimension(lastFloatLogicalBottom, LayoutUnit(newLineWidth),
                      newLineLeft, newLineRight);
}
예제 #2
0
void LineWidth::fitBelowFloats(bool isFirstLine)
{
    ASSERT(!m_committedWidth);
    ASSERT(!fitsOnLine());

    LayoutUnit floatLogicalBottom;
    LayoutUnit lastFloatLogicalBottom = m_block.logicalHeight();
    float newLineWidth = m_availableWidth;
    float newLineLeft = m_left;
    float newLineRight = m_right;

    FloatingObject* lastFloatFromPreviousLine = (m_block.containsFloats() ? m_block.m_floatingObjects->set().last().get() : 0);
        if (lastFloatFromPreviousLine && lastFloatFromPreviousLine->renderer()->shapeOutsideInfo())
            return wrapNextToShapeOutside(isFirstLine);

    while (true) {
        floatLogicalBottom = m_block.nextFloatLogicalBottomBelow(lastFloatLogicalBottom, ShapeOutsideFloatShapeOffset);
        if (floatLogicalBottom <= lastFloatLogicalBottom)
            break;

        newLineWidth = availableWidthAtOffset(m_block, floatLogicalBottom, shouldIndentText(), newLineLeft, newLineRight);
        lastFloatLogicalBottom = floatLogicalBottom;

        if (newLineWidth >= m_uncommittedWidth)
            break;
    }
    updateLineDimension(lastFloatLogicalBottom, newLineWidth, newLineLeft, newLineRight);
}