Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Unified Diff: Source/WebCore/rendering/RenderFrameBase.cpp

Issue 13877010: Remove frame flattening from rendering code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Less overzealousness. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/rendering/RenderFrameBase.cpp
diff --git a/Source/WebCore/rendering/RenderFrameBase.cpp b/Source/WebCore/rendering/RenderFrameBase.cpp
index f2be9f647a233fc7072daf33557780e3fd11929a..6637de0324badde1e7ddbb27f33546d0f85165ae 100644
--- a/Source/WebCore/rendering/RenderFrameBase.cpp
+++ b/Source/WebCore/rendering/RenderFrameBase.cpp
@@ -38,68 +38,4 @@ RenderFrameBase::RenderFrameBase(Element* element)
{
}
-inline bool shouldExpandFrame(LayoutUnit width, LayoutUnit height, bool hasFixedWidth, bool hasFixedHeight)
-{
- // If the size computed to zero never expand.
- if (!width || !height)
- return false;
- // Really small fixed size frames can't be meant to be scrolled and are there probably by mistake. Avoid expanding.
- static unsigned smallestUsefullyScrollableDimension = 8;
- if (hasFixedWidth && width < LayoutUnit(smallestUsefullyScrollableDimension))
- return false;
- if (hasFixedHeight && height < LayoutUnit(smallestUsefullyScrollableDimension))
- return false;
- return true;
-}
-
-void RenderFrameBase::layoutWithFlattening(bool hasFixedWidth, bool hasFixedHeight)
-{
- FrameView* childFrameView = toFrameView(widget());
- RenderView* childRoot = childFrameView ? childFrameView->frame()->contentRenderer() : 0;
-
- if (!childRoot || !shouldExpandFrame(width(), height(), hasFixedWidth, hasFixedHeight)) {
- updateWidgetPosition();
- if (childFrameView)
- childFrameView->layout();
- setNeedsLayout(false);
- return;
- }
-
- // need to update to calculate min/max correctly
- updateWidgetPosition();
-
- // if scrollbars are off, and the width or height are fixed
- // we obey them and do not expand. With frame flattening
- // no subframe much ever become scrollable.
-
- HTMLFrameElementBase* element = static_cast<HTMLFrameElementBase*>(node());
- bool isScrollable = element->scrollingMode() != ScrollbarAlwaysOff;
-
- // consider iframe inset border
- int hBorder = borderLeft() + borderRight();
- int vBorder = borderTop() + borderBottom();
-
- // make sure minimum preferred width is enforced
- if (isScrollable || !hasFixedWidth) {
- setWidth(max(width(), childRoot->minPreferredLogicalWidth() + hBorder));
- // update again to pass the new width to the child frame
- updateWidgetPosition();
- childFrameView->layout();
- }
-
- // expand the frame by setting frame height = content height
- if (isScrollable || !hasFixedHeight || childRoot->isFrameSet())
- setHeight(max<LayoutUnit>(height(), childFrameView->contentsHeight() + vBorder));
- if (isScrollable || !hasFixedWidth || childRoot->isFrameSet())
- setWidth(max<LayoutUnit>(width(), childFrameView->contentsWidth() + hBorder));
-
- updateWidgetPosition();
-
- ASSERT(!childFrameView->layoutPending());
- ASSERT(!childRoot->needsLayout());
- ASSERT(!childRoot->firstChild() || !childRoot->firstChild()->firstChild() || !childRoot->firstChild()->firstChild()->needsLayout());
-
- setNeedsLayout(false);
-}
-
}

Powered by Google App Engine
This is Rietveld 408576698