From cd44dc59cdfc39534aef4d417e9f3c412e3be139 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 3 Feb 2012 09:55:33 +0100 Subject: Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560) --- Source/WebCore/page/FrameView.cpp | 100 +++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 56 deletions(-) (limited to 'Source/WebCore/page/FrameView.cpp') diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp index 56f6c60c2..9fc1cc605 100644 --- a/Source/WebCore/page/FrameView.cpp +++ b/Source/WebCore/page/FrameView.cpp @@ -131,10 +131,6 @@ FrameView::FrameView(Frame* frame) , m_fixedObjectCount(0) , m_layoutTimer(this, &FrameView::layoutTimerFired) , m_layoutRoot(0) -#if ENABLE(SVG) - , m_inLayoutParentView(false) -#endif - , m_hasPendingPostLayoutTasks(false) , m_inSynchronousPostLayout(false) , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) , m_isTransparent(false) @@ -186,7 +182,7 @@ PassRefPtr FrameView::create(Frame* frame, const IntSize& initialSize FrameView::~FrameView() { - if (m_hasPendingPostLayoutTasks) { + if (m_postLayoutTasksTimer.isActive()) { m_postLayoutTasksTimer.stop(); m_actionScheduler->clear(); } @@ -222,7 +218,6 @@ void FrameView::reset() m_cannotBlitToWindow = false; m_isOverlapped = false; m_contentIsOpaque = false; - m_shouldLayoutFixedElementsRelativeToFrame = false; m_borderX = 30; m_borderY = 30; m_layoutTimer.stop(); @@ -232,7 +227,6 @@ void FrameView::reset() m_layoutSchedulingEnabled = true; m_inLayout = false; m_inSynchronousPostLayout = false; - m_hasPendingPostLayoutTasks = false; m_layoutCount = 0; m_nestedLayoutCount = 0; m_postLayoutTasksTimer.stop(); @@ -648,14 +642,15 @@ void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, Scrollbar } } -#if ENABLE(FULLSCREEN_API) && USE(ACCELERATED_COMPOSITING) +#if USE(ACCELERATED_COMPOSITING) + +#if ENABLE(FULLSCREEN_API) static bool isDocumentRunningFullScreenAnimation(Document* document) { return document->webkitIsFullScreen() && document->fullScreenRenderer() && document->isAnimatingFullScreen(); } #endif - -#if USE(ACCELERATED_COMPOSITING) + void FrameView::updateCompositingLayers() { RenderView* root = rootRenderer(this); @@ -720,7 +715,7 @@ GraphicsLayer* FrameView::layerForScrollCorner() const return root->compositor()->layerForScrollCorner(); } -#if PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING) +#if ENABLE(RUBBER_BANDING) GraphicsLayer* FrameView::layerForOverhangAreas() const { RenderView* root = rootRenderer(this); @@ -746,7 +741,7 @@ bool FrameView::syncCompositingStateForThisFrame(Frame* rootFrameForSync) root->compositor()->flushPendingLayerChanges(rootFrameForSync == m_frame); #if ENABLE(FULLSCREEN_API) - // The fullScreenRenderer's graphicsLayer has been re-parented, and the above recursive syncCompositingState + // The fullScreenRenderer's graphicsLayer has been re-parented, and the above recursive syncCompositingState // call will not cause the subtree under it to repaint. Explicitly call the syncCompositingState on // the fullScreenRenderer's graphicsLayer here: Document* document = m_frame->document(); @@ -901,9 +896,6 @@ static inline void collectFrameViewChildren(FrameView* frameView, VectorownerRenderer(); if (!ownerRenderer || !ownerRenderer->frame()) return; @@ -913,28 +905,22 @@ inline void FrameView::forceLayoutParentViewIfNeeded() return; RenderSVGRoot* svgRoot = toRenderSVGRoot(contentBox); - if (!svgRoot->needsSizeNegotiationWithHostDocument()) + if (svgRoot->everHadLayout() && !svgRoot->needsLayout()) return; - ASSERT(!m_inLayoutParentView); - TemporaryChange resetInLayoutParentView(m_inLayoutParentView, true); - - // Clear needs-size-negotiation flag in RenderSVGRoot, so the next call to our - // layout() method won't fire the size negotiation logic again. - svgRoot->scheduledSizeNegotiationWithHostDocument(); - ASSERT(!svgRoot->needsSizeNegotiationWithHostDocument()); + // If the embedded SVG document appears the first time, the ownerRenderer has already finished + // layout without knowing about the existence of the embedded SVG document, because RenderReplaced + // embeddedContentBox() returns 0, as long as the embedded document isn't loaded yet. Before + // bothering to lay out the SVG document, mark the ownerRenderer needing layout and ask its + // FrameView for a layout. After that the RenderEmbeddedObject (ownerRenderer) carries the + // correct size, which RenderSVGRoot::computeReplacedLogicalWidth/Height rely on, when laying + // out for the first time, or when the RenderSVGRoot size has changed dynamically (eg. via