Example #1
0
LayoutRect unionRectEvenIfEmpty(const Vector<LayoutRect>& rects) {
  size_t count = rects.size();
  if (!count)
    return LayoutRect();

  LayoutRect result = rects[0];
  for (size_t i = 1; i < count; ++i)
    result.uniteEvenIfEmpty(rects[i]);

  return result;
}
LayoutRect MultiColumnFragmentainerGroup::calculateOverflow() const {
  // Note that we just return the bounding rectangle of the column boxes here.
  // We currently don't examine overflow caused by the actual content that ends
  // up in each column.
  LayoutRect overflowRect;
  if (unsigned columnCount = actualColumnCount()) {
    overflowRect = columnRectAt(0);
    if (columnCount > 1)
      overflowRect.uniteEvenIfEmpty(columnRectAt(columnCount - 1));
  }
  return overflowRect;
}