diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-15 16:08:57 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-15 16:08:57 +0200 |
commit | 5466563f4b5b6b86523e3f89bb7f77e5b5270c78 (patch) | |
tree | 8caccf7cd03a15207cde3ba282c88bf132482a91 /Source/WebCore/page/FrameView.cpp | |
parent | 33b26980cb24288b5a9f2590ccf32a949281bb79 (diff) | |
download | qtwebkit-5466563f4b5b6b86523e3f89bb7f77e5b5270c78.tar.gz |
Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)
WebKit update which introduces the QtWebKitWidgets module that contains the WK1
widgets based API. (In fact it renames QtWebKit to QtWebKitWidgets while we're
working on completing the entire split as part of
https://bugs.webkit.org/show_bug.cgi?id=99314
Diffstat (limited to 'Source/WebCore/page/FrameView.cpp')
-rw-r--r-- | Source/WebCore/page/FrameView.cpp | 80 |
1 files changed, 48 insertions, 32 deletions
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp index 9f7274627..5006b95a1 100644 --- a/Source/WebCore/page/FrameView.cpp +++ b/Source/WebCore/page/FrameView.cpp @@ -97,6 +97,7 @@ using namespace HTMLNames; double FrameView::sCurrentPaintTimeStamp = 0.0; + // REPAINT_THROTTLING now chooses default values for throttling parameters. // Should be removed when applications start using runtime configuration. #if ENABLE(REPAINT_THROTTLING) @@ -334,7 +335,7 @@ void FrameView::init() // Propagate the marginwidth/height and scrolling modes to the view. Element* ownerElement = m_frame ? m_frame->ownerElement() : 0; if (ownerElement && (ownerElement->hasTagName(frameTag) || ownerElement->hasTagName(iframeTag))) { - HTMLFrameElement* frameElt = static_cast<HTMLFrameElement*>(ownerElement); + HTMLFrameElementBase* frameElt = static_cast<HTMLFrameElementBase*>(ownerElement); if (frameElt->scrollingMode() == ScrollbarAlwaysOff) setCanHaveScrollbars(false); LayoutUnit marginWidth = frameElt->marginWidth(); @@ -781,6 +782,19 @@ TiledBacking* FrameView::tiledBacking() return backing->graphicsLayer()->tiledBacking(); } +uint64_t FrameView::scrollLayerID() const +{ + RenderView* root = rootRenderer(this); + if (!root) + return 0; + + RenderLayerBacking* backing = root->layer()->backing(); + if (!backing) + return 0; + + return backing->scrollLayerID(); +} + #if ENABLE(RUBBER_BANDING) GraphicsLayer* FrameView::layerForOverhangAreas() const { @@ -791,7 +805,7 @@ GraphicsLayer* FrameView::layerForOverhangAreas() const } #endif -bool FrameView::syncCompositingStateForThisFrame(Frame* rootFrameForSync) +bool FrameView::flushCompositingStateForThisFrame(Frame* rootFrameForFlush) { RenderView* root = rootRenderer(this); if (!root) @@ -808,7 +822,7 @@ bool FrameView::syncCompositingStateForThisFrame(Frame* rootFrameForSync) // visible flash to occur. Instead, stop the deferred repaint timer and repaint immediately. flushDeferredRepaints(); - root->compositor()->flushPendingLayerChanges(rootFrameForSync == m_frame); + root->compositor()->flushPendingLayerChanges(rootFrameForFlush == m_frame); return true; } @@ -887,16 +901,16 @@ bool FrameView::isEnclosedInCompositingLayer() const return false; } -bool FrameView::syncCompositingStateIncludingSubframes() +bool FrameView::flushCompositingStateIncludingSubframes() { #if USE(ACCELERATED_COMPOSITING) - bool allFramesSynced = syncCompositingStateForThisFrame(m_frame.get()); + bool allFramesFlushed = flushCompositingStateForThisFrame(m_frame.get()); for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->traverseNext(m_frame.get())) { - bool synced = child->view()->syncCompositingStateForThisFrame(m_frame.get()); - allFramesSynced &= synced; + bool flushed = child->view()->flushCompositingStateForThisFrame(m_frame.get()); + allFramesFlushed &= flushed; } - return allFramesSynced; + return allFramesFlushed; #else // USE(ACCELERATED_COMPOSITING) return true; #endif @@ -1031,6 +1045,7 @@ void FrameView::layout(bool allowSubtree) ASSERT(m_frame->view() == this); Document* document = m_frame->document(); + ASSERT(!document->inPageCache()); bool subtree; RenderObject* root; @@ -1213,7 +1228,7 @@ void FrameView::layout(bool allowSubtree) root->document()->axObjectCache()->postNotification(root, AXObjectCache::AXLayoutComplete, true); #endif #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION) - updateDashboardRegions(); + updateAnnotatedRegions(); #endif ASSERT(!root->needsLayout()); @@ -2183,19 +2198,21 @@ void FrameView::scheduleRelayoutOfSubtree(RenderObject* relayoutRoot) m_layoutRoot->markContainingBlocksForLayout(false, relayoutRoot); m_layoutRoot = relayoutRoot; ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout()); + InspectorInstrumentation::didInvalidateLayout(m_frame.get()); } else { // Just do a full relayout if (m_layoutRoot) m_layoutRoot->markContainingBlocksForLayout(false); m_layoutRoot = 0; relayoutRoot->markContainingBlocksForLayout(false); + InspectorInstrumentation::didInvalidateLayout(m_frame.get()); } } } else if (m_layoutSchedulingEnabled) { - InspectorInstrumentation::didInvalidateLayout(m_frame.get()); int delay = m_frame->document()->minimumLayoutDelay(); m_layoutRoot = relayoutRoot; ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout()); + InspectorInstrumentation::didInvalidateLayout(m_frame.get()); m_delayedLayout = delay != 0; m_layoutTimer.startOneShot(delay * 0.001); } @@ -2247,7 +2264,7 @@ void FrameView::unscheduleRelayout() } #if ENABLE(REQUEST_ANIMATION_FRAME) -void FrameView::serviceScriptedAnimations(DOMTimeStamp time) +void FrameView::serviceScriptedAnimations(double monotonicAnimationStartTime) { for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext()) { frame->view()->serviceScrollAnimations(); @@ -2259,7 +2276,7 @@ void FrameView::serviceScriptedAnimations(DOMTimeStamp time) documents.append(frame->document()); for (size_t i = 0; i < documents.size(); ++i) - documents[i]->serviceScriptedAnimations(time); + documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime); } #endif @@ -2484,7 +2501,7 @@ void FrameView::performPostLayoutTasks() #if USE(ACCELERATED_COMPOSITING) if (TiledBacking* tiledBacking = this->tiledBacking()) - tiledBacking->setCanHaveScrollbars(canHaveScrollbars()); + tiledBacking->setTileCoverage(canHaveScrollbars() ? TiledBacking::CoverageForScrolling : TiledBacking::CoverageForVisibleArea); #endif scrollToAnchor(); @@ -2896,20 +2913,20 @@ bool FrameView::scrollAnimatorEnabled() const } #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION) -void FrameView::updateDashboardRegions() +void FrameView::updateAnnotatedRegions() { Document* document = m_frame->document(); - if (!document->hasDashboardRegions()) + if (!document->hasAnnotatedRegions()) return; - Vector<DashboardRegionValue> newRegions; - document->renderBox()->collectDashboardRegions(newRegions); - if (newRegions == document->dashboardRegions()) + Vector<AnnotatedRegionValue> newRegions; + document->renderBox()->collectAnnotatedRegions(newRegions); + if (newRegions == document->annotatedRegions()) return; - document->setDashboardRegions(newRegions); + document->setAnnotatedRegions(newRegions); Page* page = m_frame->page(); if (!page) return; - page->chrome()->client()->dashboardRegionsChanged(); + page->chrome()->client()->annotatedRegionsChanged(); } #endif @@ -3048,10 +3065,9 @@ bool FrameView::hasCustomScrollbars() const FrameView* FrameView::parentFrameView() const { - if (Widget* parentView = parent()) { - if (parentView->isFrameView()) - return static_cast<FrameView*>(parentView); - } + if (Frame* parentFrame = m_frame->tree()->parent()) + return parentFrame->view(); + return 0; } @@ -3192,7 +3208,7 @@ void FrameView::paintContents(GraphicsContext* p, const IntRect& rect) #if USE(ACCELERATED_COMPOSITING) if (!p->paintingDisabled() && !document->printing()) - syncCompositingStateForThisFrame(m_frame.get()); + flushCompositingStateForThisFrame(m_frame.get()); #endif PaintBehavior oldPaintBehavior = m_paintBehavior; @@ -3233,10 +3249,10 @@ void FrameView::paintContents(GraphicsContext* p, const IntRect& rect) m_paintBehavior = oldPaintBehavior; m_lastPaintTime = currentTime(); -#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION) // Regions may have changed as a result of the visibility/z-index of element changing. - if (document->dashboardRegionsDirty()) - updateDashboardRegions(); +#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION) + if (document->annotatedRegionsDirty()) + updateAnnotatedRegions(); #endif if (isTopLevelPainter) @@ -3459,7 +3475,7 @@ void FrameView::adjustPageHeightDeprecated(float *newBottom, float oldTop, float IntRect FrameView::convertFromRenderer(const RenderObject* renderer, const IntRect& rendererRect) const { - IntRect rect = renderer->localToAbsoluteQuad(FloatRect(rendererRect)).enclosingBoundingBox(); + IntRect rect = renderer->localToAbsoluteQuad(FloatRect(rendererRect), SnapOffsetForTransforms).enclosingBoundingBox(); // Convert from page ("absolute") to FrameView coordinates. if (!delegatesScrolling()) @@ -3478,13 +3494,13 @@ IntRect FrameView::convertToRenderer(const RenderObject* renderer, const IntRect // FIXME: we don't have a way to map an absolute rect down to a local quad, so just // move the rect for now. - rect.setLocation(roundedIntPoint(renderer->absoluteToLocal(rect.location(), false, true /* use transforms */))); + rect.setLocation(roundedIntPoint(renderer->absoluteToLocal(rect.location(), UseTransforms | SnapOffsetForTransforms))); return rect; } IntPoint FrameView::convertFromRenderer(const RenderObject* renderer, const IntPoint& rendererPoint) const { - IntPoint point = roundedIntPoint(renderer->localToAbsolute(rendererPoint, false, true /* use transforms */)); + IntPoint point = roundedIntPoint(renderer->localToAbsolute(rendererPoint, UseTransforms | SnapOffsetForTransforms)); // Convert from page ("absolute") to FrameView coordinates. if (!delegatesScrolling()) @@ -3500,7 +3516,7 @@ IntPoint FrameView::convertToRenderer(const RenderObject* renderer, const IntPoi if (!delegatesScrolling()) point += IntSize(scrollX(), scrollY()); - return roundedIntPoint(renderer->absoluteToLocal(point, false, true /* use transforms */)); + return roundedIntPoint(renderer->absoluteToLocal(point, UseTransforms | SnapOffsetForTransforms)); } IntRect FrameView::convertToContainingView(const IntRect& localRect) const |