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

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

Issue 14614007: Remove frame flattening from rendering code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: better. Created 7 years, 7 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
« no previous file with comments | « Source/core/rendering/RenderFrameBase.h ('k') | Source/core/rendering/RenderFrameSet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderFrameBase.cpp
diff --git a/Source/core/rendering/RenderFrameBase.cpp b/Source/core/rendering/RenderFrameBase.cpp
index ca922acc8f26f73e750b2309d3b132cbde0017e4..b23b673199a14828681f97faeb7d052f5f856d2f 100644
--- a/Source/core/rendering/RenderFrameBase.cpp
+++ b/Source/core/rendering/RenderFrameBase.cpp
@@ -32,74 +32,12 @@
#include "core/rendering/RenderView.h"
namespace WebCore {
-
-RenderFrameBase::RenderFrameBase(Element* element)
- : RenderPart(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;
-}
+// FIXME: Remove this file. http://crbug.com/231898
-void RenderFrameBase::layoutWithFlattening(bool hasFixedWidth, bool hasFixedHeight)
+RenderFrameBase::RenderFrameBase(Element* element)
+ : RenderPart(element)
{
- 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);
}
}
« no previous file with comments | « Source/core/rendering/RenderFrameBase.h ('k') | Source/core/rendering/RenderFrameSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698