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

Unified Diff: Source/core/page/FrameView.cpp

Issue 14614007: Remove frame flattening from rendering code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Got it. 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/page/FrameView.h ('k') | Source/core/page/Settings.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/FrameView.cpp
diff --git a/Source/core/page/FrameView.cpp b/Source/core/page/FrameView.cpp
index cdea37ee4fcc2c323d2bf891f10230d1c31c7f5b..44d7409098bc444970f706e22740360475197801 100644
--- a/Source/core/page/FrameView.cpp
+++ b/Source/core/page/FrameView.cpp
@@ -480,23 +480,6 @@ void FrameView::setMarginHeight(LayoutUnit h)
m_margins.setHeight(h);
}
-bool FrameView::avoidScrollbarCreation() const
-{
- ASSERT(m_frame);
-
- // with frame flattening no subframe can have scrollbars
- // but we also cannot turn scrollbars off as we determine
- // our flattening policy using that.
-
- if (!m_frame->ownerElement())
- return false;
-
- if (!m_frame->settings() || m_frame->settings()->frameFlatteningEnabled())
- return true;
-
- return false;
-}
-
void FrameView::setCanHaveScrollbars(bool canHaveScrollbars)
{
m_canHaveScrollbars = canHaveScrollbars;
@@ -692,7 +675,7 @@ void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, Scrollbar
RenderObject* rootRenderer = documentElement ? documentElement->renderer() : 0;
Node* body = document->body();
if (body && body->renderer()) {
- if (body->hasTagName(framesetTag) && m_frame->settings() && !m_frame->settings()->frameFlatteningEnabled()) {
+ if (body->hasTagName(framesetTag)) {
vMode = ScrollbarAlwaysOff;
hMode = ScrollbarAlwaysOff;
} else if (body->hasTagName(bodyTag)) {
@@ -898,13 +881,6 @@ void FrameView::layout(bool allowSubtree)
// Every scroll that happens during layout is programmatic.
TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, true);
- bool inChildFrameLayoutWithFrameFlattening = isInChildFrameWithFrameFlattening();
-
- if (inChildFrameLayoutWithFrameFlattening) {
- if (doLayoutWithFrameFlattening(allowSubtree))
- return;
- }
-
m_layoutTimer.stop();
m_delayedLayout = false;
m_setNeedsLayoutWasDeferred = false;
@@ -937,7 +913,7 @@ void FrameView::layout(bool allowSubtree)
{
TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false);
- if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_postLayoutTasksTimer.isActive() && !inChildFrameLayoutWithFrameFlattening) {
+ if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_postLayoutTasksTimer.isActive() && !frame()->document()->shouldDisplaySeamlesslyWithParent()) {
Mike West 2013/05/14 08:33:03 We missed this last time. inChildFrameLayoutWithFr
// This is a new top-level layout. If there are any remaining tasks from the previous
// layout, finish them now.
m_inSynchronousPostLayout = true;
@@ -983,7 +959,7 @@ void FrameView::layout(bool allowSubtree)
Document* document = m_frame->document();
Node* body = document->body();
if (body && body->renderer()) {
- if (body->hasTagName(framesetTag) && m_frame->settings() && !m_frame->settings()->frameFlatteningEnabled()) {
+ if (body->hasTagName(framesetTag)) {
body->renderer()->setChildNeedsLayout(true);
} else if (body->hasTagName(bodyTag)) {
if (!m_firstLayout && m_size.height() != layoutHeight() && body->renderer()->enclosingBox()->stretchesToViewport())
@@ -1117,18 +1093,13 @@ void FrameView::layout(bool allowSubtree)
if (!m_postLayoutTasksTimer.isActive()) {
if (!m_inSynchronousPostLayout) {
- if (inChildFrameLayoutWithFrameFlattening) {
- if (RenderView* renderView = this->renderView())
- renderView->updateWidgetPositions();
- } else {
- m_inSynchronousPostLayout = true;
- // Calls resumeScheduledEvents()
- performPostLayoutTasks();
- m_inSynchronousPostLayout = false;
- }
+ m_inSynchronousPostLayout = true;
+ // Calls resumeScheduledEvents()
+ performPostLayoutTasks();
+ m_inSynchronousPostLayout = false;
}
- if (!m_postLayoutTasksTimer.isActive() && (needsLayout() || m_inSynchronousPostLayout || inChildFrameLayoutWithFrameFlattening)) {
+ if (!m_postLayoutTasksTimer.isActive() && (needsLayout() || m_inSynchronousPostLayout || frame()->document()->shouldDisplaySeamlesslyWithParent())) {
// If we need layout or are already in a synchronous call to postLayoutTasks(),
// defer widget updates and event dispatch until after we return. postLayoutTasks()
// can make us need to update again, and we can get stuck in a nasty cycle unless
@@ -1934,9 +1905,10 @@ void FrameView::scheduleRelayout()
if (!m_frame->document()->shouldScheduleLayout())
return;
InspectorInstrumentation::didInvalidateLayout(m_frame.get());
- // When frame flattening is enabled, the contents of the frame could affect the layout of the parent frames.
+
+ // When frame seamless is enabled, the contents of the frame could affect the layout of the parent frames.
// Also invalidate parent frame starting from the owner element of this frame.
- if (m_frame->ownerRenderer() && isInChildFrameWithFrameFlattening())
+ if (m_frame->ownerRenderer() && frame()->document()->shouldDisplaySeamlesslyWithParent())
m_frame->ownerRenderer()->setNeedsLayout(true, MarkContainingBlockChain);
int delay = m_frame->document()->minimumLayoutDelay();
@@ -2867,55 +2839,6 @@ FrameView* FrameView::parentFrameView() const
return 0;
}
-bool FrameView::isInChildFrameWithFrameFlattening() const
-{
- if (!parent() || !m_frame->ownerElement())
- return false;
-
- // Frame flattening applies when the owner element is either in a frameset or
- // an iframe with flattening parameters.
- if (m_frame->ownerElement()->hasTagName(iframeTag)) {
- RenderIFrame* iframeRenderer = toRenderIFrame(m_frame->ownerElement()->renderPart());
- if (iframeRenderer->flattenFrame() || iframeRenderer->isSeamless())
- return true;
- }
-
- if (!m_frame->settings() || !m_frame->settings()->frameFlatteningEnabled())
- return false;
-
- if (m_frame->ownerElement()->hasTagName(frameTag))
- return true;
-
- return false;
-}
-
-bool FrameView::doLayoutWithFrameFlattening(bool allowSubtree)
-{
- // Try initiating layout from the topmost parent.
- FrameView* parentView = parentFrameView();
-
- if (!parentView)
- return false;
-
- // In the middle of parent layout, no need to restart from topmost.
- if (parentView->m_nestedLayoutCount)
- return false;
-
- // Parent tree is clean. Starting layout from it would have no effect.
- if (!parentView->needsLayout())
- return false;
-
- while (parentView->parentFrameView())
- parentView = parentView->parentFrameView();
-
- parentView->layout(allowSubtree);
-
- RenderObject* root = m_layoutRoot ? m_layoutRoot : m_frame->document()->renderer();
- ASSERT_UNUSED(root, !root->needsLayout());
-
- return true;
-}
-
void FrameView::updateControlTints()
{
// This is called when control tints are changed from aqua/graphite to clear and vice versa.
@@ -3110,7 +3033,7 @@ void FrameView::updateLayoutAndStyleIfNeededRecursive()
// painting, so we need to flush out any deferred repaints too.
flushDeferredRepaints();
- // When frame flattening is on, child frame can mark parent frame dirty. In such case, child frame
+ // When seamless is on, child frame can mark parent frame dirty. In such case, child frame
// needs to call layout on parent frame recursively.
// This assert ensures that parent frames are clean, when child frames finished updating layout and style.
ASSERT(!needsLayout());
« no previous file with comments | « Source/core/page/FrameView.h ('k') | Source/core/page/Settings.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698