bool RenderFrameSet::userResize(MouseEvent* evt) { if (flattenFrameSet()) return false; if (!m_isResizing) { if (needsLayout()) return false; if (evt->type() == eventNames().mousedownEvent && evt->button() == LeftButton) { FloatPoint localPos = absoluteToLocal(evt->absoluteLocation(), UseTransforms); startResizing(m_cols, localPos.x()); startResizing(m_rows, localPos.y()); if (m_cols.m_splitBeingResized != noSplit || m_rows.m_splitBeingResized != noSplit) { setIsResizing(true); return true; } } } else { if (evt->type() == eventNames().mousemoveEvent || (evt->type() == eventNames().mouseupEvent && evt->button() == LeftButton)) { FloatPoint localPos = absoluteToLocal(evt->absoluteLocation(), UseTransforms); continueResizing(m_cols, localPos.x()); continueResizing(m_rows, localPos.y()); if (evt->type() == eventNames().mouseupEvent && evt->button() == LeftButton) { setIsResizing(false); return true; } } } return false; }
void RenderFrameSet::layout() { StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); bool doFullRepaint = selfNeedsLayout() && checkForRepaintDuringLayout(); LayoutRect oldBounds; RenderLayerModelObject* repaintContainer = 0; if (doFullRepaint) { repaintContainer = containerForRepaint(); oldBounds = clippedOverflowRectForRepaint(repaintContainer); } if (!parent()->isFrameSet() && !document().printing()) { setWidth(view().viewWidth()); setHeight(view().viewHeight()); } unsigned cols = frameSetElement().totalCols(); unsigned rows = frameSetElement().totalRows(); if (m_rows.m_sizes.size() != rows || m_cols.m_sizes.size() != cols) { m_rows.resize(rows); m_cols.resize(cols); } LayoutUnit borderThickness = frameSetElement().border(); layOutAxis(m_rows, frameSetElement().rowLengths(), height() - (rows - 1) * borderThickness); layOutAxis(m_cols, frameSetElement().colLengths(), width() - (cols - 1) * borderThickness); if (flattenFrameSet()) positionFramesWithFlattening(); else positionFrames(); RenderBox::layout(); computeEdgeInfo(); updateLayerTransform(); if (doFullRepaint) { repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds)); LayoutRect newBounds = clippedOverflowRectForRepaint(repaintContainer); if (newBounds != oldBounds) repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds)); } clearNeedsLayout(); }
void RenderFrameSet::layout() { ASSERT(needsLayout()); bool doFullRepaint = selfNeedsLayout() && checkForRepaintDuringLayout(); IntRect oldBounds; if (doFullRepaint) oldBounds = absoluteClippedOverflowRect(); if (!parent()->isFrameSet() && !document()->printing()) { setWidth(view()->viewWidth()); setHeight(view()->viewHeight()); } size_t cols = frameSet()->totalCols(); size_t rows = frameSet()->totalRows(); if (m_rows.m_sizes.size() != rows || m_cols.m_sizes.size() != cols) { m_rows.resize(rows); m_cols.resize(cols); } int borderThickness = frameSet()->border(); layOutAxis(m_rows, frameSet()->rowLengths(), height() - (rows - 1) * borderThickness); layOutAxis(m_cols, frameSet()->colLengths(), width() - (cols - 1) * borderThickness); if (flattenFrameSet()) positionFramesWithFlattening(); else positionFrames(); RenderBox::layout(); computeEdgeInfo(); if (doFullRepaint) { view()->repaintViewRectangle(oldBounds); IntRect newBounds = absoluteClippedOverflowRect(); if (newBounds != oldBounds) view()->repaintViewRectangle(newBounds); } setNeedsLayout(false); }