15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/* 25c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) Copyright (C) 1997 Martin Jones (mjones@kde.org) 35c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) (C) 1998 Waldo Bastian (bastian@kde.org) 45c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) (C) 1998, 1999 Torben Weis (weis@kde.org) 55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) (C) 1999 Lars Knoll (knoll@kde.org) 65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) (C) 1999 Antti Koivisto (koivisto@kde.org) 75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 85c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) This library is free software; you can redistribute it and/or 105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) modify it under the terms of the GNU Library General Public 115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) License as published by the Free Software Foundation; either 125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) version 2 of the License, or (at your option) any later version. 135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) This library is distributed in the hope that it will be useful, 155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) but WITHOUT ANY WARRANTY; without even the implied warranty of 165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) Library General Public License for more details. 185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) You should have received a copy of the GNU Library General Public License 205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) along with this library; see the file COPYING.LIB. If not, write to 215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) Boston, MA 02110-1301, USA. 235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)*/ 245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#ifndef FrameView_h 265c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#define FrameView_h 275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 289e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles)#include "core/frame/FrameViewAutoSizeInfo.h" 2953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/rendering/PaintPhase.h" 305d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)#include "platform/RuntimeEnabledFeatures.h" 311e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)#include "platform/geometry/LayoutRect.h" 32f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)#include "platform/graphics/Color.h" 33a854de003a23bf3c7f95ec0f8154ada64092ff5cTorne (Richard Coles)#include "platform/scroll/ScrollView.h" 340019e4eead4d990e4304c54a9028aca9122fb256Ben Murdoch#include "wtf/Forward.h" 350019e4eead4d990e4304c54a9028aca9122fb256Ben Murdoch#include "wtf/OwnPtr.h" 360019e4eead4d990e4304c54a9028aca9122fb256Ben Murdoch#include "wtf/text/WTFString.h" 375c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 38c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink { 395c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 4051b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)class AXObjectCache; 41d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)class DocumentLifecycle; 42d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)class Cursor; 435c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class Element; 445c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class FloatSize; 45d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)class HTMLFrameOwnerElement; 46d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)class LocalFrame; 475c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class KURL; 485c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class Node; 495c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class Page; 505c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class RenderBox; 515c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class RenderEmbeddedObject; 525c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class RenderObject; 535c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class RenderScrollbarPart; 54d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)class RenderView; 5509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)class RenderWidget; 567242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tuccistruct CompositedSelectionBound; 575c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 585c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)typedef unsigned long long DOMTimeStamp; 595c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 607242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci// FIXME: Oilpan: move Widget (and thereby FrameView) to the heap. 6109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)class FrameView FINAL : public ScrollView { 625c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)public: 635c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) friend class RenderView; 645c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) friend class Internals; 655c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 66d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) static PassRefPtr<FrameView> create(LocalFrame*); 67d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) static PassRefPtr<FrameView> create(LocalFrame*, const IntSize& initialSize); 685c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 695c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual ~FrameView(); 705c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 7109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual HostWindow* hostWindow() const OVERRIDE; 72591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 7309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual void invalidateRect(const IntRect&) OVERRIDE; 7409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual void setFrameRect(const IntRect&) OVERRIDE; 755c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 767242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci LocalFrame& frame() const 777242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci { 787242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci ASSERT(m_frame); 797242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci return *m_frame; 807242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci } 817242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci 82d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) Page* page() const; 835c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 848abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles) RenderView* renderView() const; 85926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 8609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual void setCanHaveScrollbars(bool) OVERRIDE; 875c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 8809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation) OVERRIDE; 895c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 9009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual void setContentsSize(const IntSize&) OVERRIDE; 91d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) IntPoint clampOffsetAtScale(const IntPoint& offset, float scale) const; 925c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 935c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void layout(bool allowSubtree = true); 945c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool didFirstLayout() const; 955c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void scheduleRelayout(); 965c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void scheduleRelayoutOfSubtree(RenderObject*); 975c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool layoutPending() const; 9809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) bool isInPerformLayout() const; 9909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 100f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) void setCanInvalidatePaintDuringPerformLayout(bool b) { m_canInvalidatePaintDuringPerformLayout = b; } 101f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) bool canInvalidatePaintDuringPerformLayout() const { return m_canInvalidatePaintDuringPerformLayout; } 1025c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1035c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) RenderObject* layoutRoot(bool onlyDuringLayout = false) const; 10409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void clearLayoutSubtreeRoot() { m_layoutSubtreeRoot = 0; } 1055c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) int layoutCount() const { return m_layoutCount; } 1065c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1075c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool needsLayout() const; 1085c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void setNeedsLayout(); 1095c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1109e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) void setNeedsUpdateWidgetPositions() { m_needsUpdateWidgetPositions = true; } 1119e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) 112bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) // Methods for getting/setting the size Blink should use to layout the contents. 113bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const; 114bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) void setLayoutSize(const IntSize&); 115bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) 116bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) // If this is set to false, the layout size will need to be explicitly set by the owner. 117bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) // E.g. WebViewImpl sets its mainFrame's layout size manually 118bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) void setLayoutSizeFixedToFrameSize(bool isFixed) { m_layoutSizeFixedToFrameSize = isFixed; } 119bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) bool layoutSizeFixedToFrameSize() { return m_layoutSizeFixedToFrameSize; } 120bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) 121f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) bool needsFullPaintInvalidation() const { return m_doFullPaintInvalidation; } 122a372c30a9dc26aa32e51fa7b85e0c47b55479f89Ben Murdoch void setNeedsFullPaintInvalidation() { m_doFullPaintInvalidation = true; } 1235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1246f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch void updateAcceleratedCompositingSettings(); 125f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu 126f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu void recalcOverflowAfterStyleChange(); 1275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1285c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool isEnclosedInCompositingLayer() const; 1295c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1305c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void resetScrollbars(); 131926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) void prepareForDetach(); 1325c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void detachCustomScrollbars(); 1335c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual void recalculateScrollbarOverlayStyle(); 1345c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1355c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void clear(); 1365c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1375c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool isTransparent() const; 1385c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void setTransparent(bool isTransparent); 139591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 140926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) // True if the FrameView is not transparent, and the base background color is opaque. 141926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) bool hasOpaqueBackground() const; 1425c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1435c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) Color baseBackgroundColor() const; 1448abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles) void setBaseBackgroundColor(const Color&); 1458abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles) void updateBackgroundRecursively(const Color&, bool); 1465c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1475c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void adjustViewSize(); 148591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 149d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) virtual IntRect windowClipRect(IncludeScrollbarsInRect = ExcludeScrollbars) const OVERRIDE; 150d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) IntRect windowClipRectForFrameOwner(const HTMLFrameOwnerElement*) const; 1515c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 15209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual IntRect windowResizerRect() const OVERRIDE; 1535c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 15453e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) virtual float visibleContentScaleFactor() const OVERRIDE { return m_visibleContentScaleFactor; } 15553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) void setVisibleContentScaleFactor(float); 156926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 1571e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles) virtual float inputEventsScaleFactor() const OVERRIDE; 15819cde67944066db31e633d9e386f2aa9bf9fadb3Torne (Richard Coles) virtual IntSize inputEventsOffsetForEmulation() const OVERRIDE; 15919cde67944066db31e633d9e386f2aa9bf9fadb3Torne (Richard Coles) void setInputEventsTransformForEmulation(const IntSize&, float); 1601e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles) 161c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) virtual void setScrollPosition(const IntPoint&, ScrollBehavior = ScrollBehaviorInstant) OVERRIDE; 162926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) virtual bool isRubberBandInProgress() const OVERRIDE; 1635267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) void setScrollPositionNonProgrammatically(const IntPoint&); 164926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 165926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) // This is different than visibleContentRect() in that it ignores negative (or overly positive) 166591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch // offsets from rubber-banding, and it takes zooming into account. 167926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) LayoutRect viewportConstrainedVisibleContentRect() const; 168d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) void viewportConstrainedVisibleContentSizeChanged(bool widthChanged, bool heightChanged); 1695c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 170591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch AtomicString mediaType() const; 171591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch void setMediaType(const AtomicString&); 1725c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void adjustMediaTypeForPrinting(bool printing); 1735c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1745c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void addSlowRepaintObject(); 1755c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void removeSlowRepaintObject(); 1765c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool hasSlowRepaintObjects() const { return m_slowRepaintObjectCount; } 1775c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 178197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch // Fixed-position objects. 1795c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) typedef HashSet<RenderObject*> ViewportConstrainedObjectSet; 1805c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void addViewportConstrainedObject(RenderObject*); 1815c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void removeViewportConstrainedObject(RenderObject*); 1825c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) const ViewportConstrainedObjectSet* viewportConstrainedObjects() const { return m_viewportConstrainedObjects.get(); } 1835c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObjects && m_viewportConstrainedObjects->size() > 0; } 1845c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1855c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void handleLoadCompleted(); 1865c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1875c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void updateAnnotatedRegions(); 1885c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1895c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void restoreScrollbar(); 1905c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1915c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void postLayoutTimerFired(Timer<FrameView>*); 1925c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1935c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool wasScrolledByUser() const; 1945c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void setWasScrolledByUser(bool); 1955c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 1965c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool safeToPropagateScrollToParent() const { return m_safeToPropagateScrollToParent; } 1975c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void setSafeToPropagateScrollToParent(bool isSafe) { m_safeToPropagateScrollToParent = isSafe; } 1985c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 19909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void addWidget(RenderWidget*); 20009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void removeWidget(RenderWidget*); 20109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void updateWidgetPositions(); 20209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 203a854de003a23bf3c7f95ec0f8154ada64092ff5cTorne (Richard Coles) void addWidgetToUpdate(RenderEmbeddedObject&); 2045c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 20509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual void paintContents(GraphicsContext*, const IntRect& damageRect) OVERRIDE; 2065c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void setPaintBehavior(PaintBehavior); 2075c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) PaintBehavior paintBehavior() const; 2085c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool isPainting() const; 2095c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool hasEverPainted() const { return m_lastPaintTime; } 2105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void setNodeToDraw(Node*); 2115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 21209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) OVERRIDE; 21309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect) OVERRIDE; 2145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual void paintScrollbar(GraphicsContext*, Scrollbar*, const IntRect&) OVERRIDE; 2155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 2168abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles) Color documentBackgroundColor() const; 2175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 218e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) static double currentFrameTimeStamp() { return s_currentFrameTimeStamp; } 219591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 220d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) void updateLayoutAndStyleForPainting(); 2215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void updateLayoutAndStyleIfNeededRecursive(); 2225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 223197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch void invalidateTreeIfNeededRecursive(); 224197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch 2255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void incrementVisuallyNonEmptyCharacterCount(unsigned); 2265c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void incrementVisuallyNonEmptyPixelCount(const IntSize&); 2275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; } 2289e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) void enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSize); 2297242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci void disableAutoSizeMode() { m_autoSizeInfo.clear(); } 2305c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 2315c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void forceLayout(bool allowSubtree = false); 23209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkFactor); 2335c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 2345c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool scrollToFragment(const KURL&); 2355c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool scrollToAnchor(const String&); 2365c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void maintainScrollPositionAtAnchor(Node*); 2375c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void scrollElementToRect(Element*, const IntRect&); 23807a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch void scrollContentsIfNeededRecursive(); 2395c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 2405c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) // Methods to convert points and rects between the coordinate space of the renderer, and this view. 241f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu IntRect convertFromRenderer(const RenderObject&, const IntRect&) const; 242f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu IntRect convertToRenderer(const RenderObject&, const IntRect&) const; 243f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu IntPoint convertFromRenderer(const RenderObject&, const IntPoint&) const; 244f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu IntPoint convertToRenderer(const RenderObject&, const IntPoint&) const; 2455c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 2465c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { return m_scrollCorner == scrollCorner; } 2475c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 248a372c30a9dc26aa32e51fa7b85e0c47b55479f89Ben Murdoch enum ScrollingReasons { 249a372c30a9dc26aa32e51fa7b85e0c47b55479f89Ben Murdoch Scrollable, 250a372c30a9dc26aa32e51fa7b85e0c47b55479f89Ben Murdoch NotScrollableNoOverflow, 251a372c30a9dc26aa32e51fa7b85e0c47b55479f89Ben Murdoch NotScrollableNotVisible, 252a372c30a9dc26aa32e51fa7b85e0c47b55479f89Ben Murdoch NotScrollableExplicitlyDisabled 253a372c30a9dc26aa32e51fa7b85e0c47b55479f89Ben Murdoch }; 254a372c30a9dc26aa32e51fa7b85e0c47b55479f89Ben Murdoch 255a372c30a9dc26aa32e51fa7b85e0c47b55479f89Ben Murdoch ScrollingReasons scrollingReasons(); 256926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) bool isScrollable(); 257926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 2585c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule }; 25909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void calculateScrollbarModesForLayoutAndSetViewportRenderer(ScrollbarMode& hMode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy = AnyRule); 26009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 26109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual IntPoint lastKnownMousePosition() const OVERRIDE; 2621e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles) bool shouldSetCursor() const; 2635c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 264f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) void setCursor(const Cursor&); 265f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) 2665c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual bool scrollbarsCanBeActive() const OVERRIDE; 2675c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 2685c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) // FIXME: Remove this method once plugin loading is decoupled from layout. 2695c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void flushAnyPendingPostLayoutTasks(); 2705c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 27109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual bool shouldSuspendScrollAnimations() const OVERRIDE; 27210f88d5669dbd969c059d61ba09fa37dd72ac559Ben Murdoch virtual void scrollbarStyleChanged() OVERRIDE; 2735c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 2745c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) RenderBox* embeddedContentBox() const; 275591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 276f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) void setTracksPaintInvalidations(bool); 277f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) bool isTrackingPaintInvalidations() const { return m_isTrackingPaintInvalidations; } 278f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) void resetTrackedPaintInvalidations(); 279197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch 280f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) String trackedPaintInvalidationRectsAsText() const; 2815c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 2825c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) typedef HashSet<ScrollableArea*> ScrollableAreaSet; 283d6cdb82654e8f3343a693ca752d5c4cee0324e17Torne (Richard Coles) void addScrollableArea(ScrollableArea*); 284d6cdb82654e8f3343a693ca752d5c4cee0324e17Torne (Richard Coles) void removeScrollableArea(ScrollableArea*); 2855c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.get(); } 2865c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 28781a5157921f1d2a7ff6aae115bfe3c139b38a5c8Torne (Richard Coles) // With CSS style "resize:" enabled, a little resizer handle will appear at the bottom 28881a5157921f1d2a7ff6aae115bfe3c139b38a5c8Torne (Richard Coles) // right of the object. We keep track of these resizer areas for checking if touches 28981a5157921f1d2a7ff6aae115bfe3c139b38a5c8Torne (Richard Coles) // (implemented using Scroll gesture) are targeting the resizer. 2901e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles) typedef HashSet<RenderBox*> ResizerAreaSet; 291f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu void addResizerArea(RenderBox&); 292f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu void removeResizerArea(RenderBox&); 29381a5157921f1d2a7ff6aae115bfe3c139b38a5c8Torne (Richard Coles) const ResizerAreaSet* resizerAreas() const { return m_resizerAreas.get(); } 29481a5157921f1d2a7ff6aae115bfe3c139b38a5c8Torne (Richard Coles) 295197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch virtual void setParent(Widget*) OVERRIDE; 2965c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual void removeChild(Widget*) OVERRIDE; 2975c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 2985c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) // This function exists for ports that need to handle wheel events manually. 2995c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) // On Mac WebKit1 the underlying NSScrollView just does the scrolling, but on most other platforms 3005c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) // we need this function in order to do the scroll ourselves. 3015c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool wheelEvent(const PlatformWheelEvent&); 3025c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 3035c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool inProgrammaticScroll() const { return m_inProgrammaticScroll; } 3045c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void setInProgrammaticScroll(bool programmaticScroll) { m_inProgrammaticScroll = programmaticScroll; } 3055c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 306926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) virtual bool isActive() const OVERRIDE; 307926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 30853e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) // DEPRECATED: Use viewportConstrainedVisibleContentRect() instead. 30953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) IntSize scrollOffsetForFixedPosition() const; 31053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) 31151b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles) // Override scrollbar notifications to update the AXObject cache. 31251b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles) virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation) OVERRIDE; 31351b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles) virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) OVERRIDE; 31451b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles) 315d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter 316d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) // passed around the FrameView layout methods can be true while this returns 317d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) // false. 318d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) bool isSubtreeLayout() const { return !!m_layoutSubtreeRoot; } 319d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) 32043e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles) // Sets the tickmarks for the FrameView, overriding the default behavior 32143e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles) // which is to display the tickmarks corresponding to find results. 32243e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles) // If |m_tickmarks| is empty, the default behavior is restored. 32343e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles) void setTickmarks(const Vector<IntRect>& tickmarks) { m_tickmarks = tickmarks; } 32443e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles) 3257242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci // Since the compositor can resize the viewport due to top controls and 3267242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci // commit scroll offsets before a WebView::resize occurs, we need to adjust 3277242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci // our scroll extents to prevent clamping the scroll offsets. 3287242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci void setTopControlsViewportAdjustment(float); 3297242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci 3307242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci virtual IntPoint maximumScrollPosition() const OVERRIDE; 3317242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci 332d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) // ScrollableArea interface 333d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE; 334d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) virtual void getTickmarks(Vector<IntRect>&) const OVERRIDE; 335d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) virtual void scrollTo(const IntSize&) OVERRIDE; 336d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) virtual IntRect scrollableAreaBoundingBox() const OVERRIDE; 337d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) virtual bool scrollAnimatorEnabled() const OVERRIDE; 338d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) virtual bool usesCompositedScrolling() const OVERRIDE; 339d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) virtual GraphicsLayer* layerForScrolling() const OVERRIDE; 340d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) virtual GraphicsLayer* layerForHorizontalScrollbar() const OVERRIDE; 341d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) virtual GraphicsLayer* layerForVerticalScrollbar() const OVERRIDE; 342d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) virtual GraphicsLayer* layerForScrollCorner() const OVERRIDE; 343d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) 3445c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)protected: 345018c2aa55614eda57c6617f8d0747eacefc389a3Ben Murdoch virtual void scrollContentsIfNeeded(); 3469e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) virtual bool scrollContentsFastPath(const IntSize& scrollDelta) OVERRIDE; 34709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual void scrollContentsSlowPath(const IntRect& updateRect) OVERRIDE; 3485c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 34909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual bool isVerticalDocument() const OVERRIDE; 35009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual bool isFlippedDocument() const OVERRIDE; 3515c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 3527242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci // Prevents creation of scrollbars. Used to prevent drawing two sets of 3537242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci // overlay scrollbars in the case of the pinch viewport. 3547242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci virtual bool scrollbarsDisabled() const OVERRIDE; 3557242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci 3565c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)private: 357d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) explicit FrameView(LocalFrame*); 3585c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 3595c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void reset(); 3605c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void init(); 3615c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 36209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual void frameRectsChanged() OVERRIDE; 363926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) virtual bool isFrameView() const OVERRIDE { return true; } 3645c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 3655c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) friend class RenderWidget; 366d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) 3675c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool contentsInCompositedLayer() const; 3685c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 36909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMode, ScrollbarMode& vMode); 3705c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); 3715c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 3728abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles) void updateCounters(); 3735c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void forceLayoutParentViewIfNeeded(); 374e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) void performPreLayoutTasks(); 375e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); 376e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) void scheduleOrPerformPostLayoutTasks(); 3775c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void performPostLayoutTasks(); 3785c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 379197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch void invalidateTreeIfNeeded(); 38051b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles) 38109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void gatherDebugLayoutRects(RenderObject* layoutRoot); 38209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 38309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) DocumentLifecycle& lifecycle() const; 384a854de003a23bf3c7f95ec0f8154ada64092ff5cTorne (Richard Coles) 385f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) virtual void contentRectangleForPaintInvalidation(const IntRect&) OVERRIDE; 3865c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual void contentsResized() OVERRIDE; 38709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual void scrollbarExistenceDidChange() OVERRIDE; 3885c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 3895c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) // Override ScrollView methods to do point conversion via renderers, in order to 3905c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) // take transforms into account. 3915c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual IntRect convertToContainingView(const IntRect&) const OVERRIDE; 3925c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual IntRect convertFromContainingView(const IntRect&) const OVERRIDE; 3935c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual IntPoint convertToContainingView(const IntPoint&) const OVERRIDE; 3945c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) virtual IntPoint convertFromContainingView(const IntPoint&) const OVERRIDE; 3955c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 3969e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) void updateWidgetPositionsIfNeeded(); 3979e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) 3987242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci bool wasViewportResized(); 399e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) void sendResizeEventIfNeeded(); 400e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) 4015c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void updateScrollableAreaSet(); 4025c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 40309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual void notifyPageThatContentAreaWillPaint() const OVERRIDE; 4045c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 405d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) void scheduleUpdateWidgetsIfNecessary(); 40651b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles) void updateWidgetsTimerFired(Timer<FrameView>*); 4075c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool updateWidgets(); 408a854de003a23bf3c7f95ec0f8154ada64092ff5cTorne (Richard Coles) 4095c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void scrollToAnchor(); 4105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void scrollPositionChanged(); 41109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) void didScrollTimerFired(Timer<FrameView>*); 4125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 41307a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch void updateLayersAndCompositingAfterScrollIfNeeded(); 4147242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci 4157242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci static bool computeCompositedSelectionBounds(LocalFrame&, CompositedSelectionBound& start, CompositedSelectionBound& end); 416018c2aa55614eda57c6617f8d0747eacefc389a3Ben Murdoch void updateFixedElementPaintInvalidationRectsAfterScroll(); 417197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch void updateCompositedSelectionBoundsIfNeeded(); 41807a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch 4195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool hasCustomScrollbars() const; 420d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles) bool shouldUseCustomScrollbars(Element*& customScrollbarElement, LocalFrame*& customScrollbarFrame); 4215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 42209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) virtual void updateScrollCorner() OVERRIDE; 4235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 4245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) FrameView* parentFrameView() const; 4255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 42609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) AXObjectCache* axObjectCache() const; 427926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) void removeFromAXObjectCache(); 428591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 429bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) void setLayoutSizeInternal(const IntSize&); 430bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) 431f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) bool paintInvalidationIsAllowed() const 43209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) { 433f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout(); 43409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) } 43509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 436e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) static double s_currentFrameTimeStamp; // used for detecting decoded resource thrash in the cache 437e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles) static bool s_inPaintContents; 4385c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 4395c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) LayoutSize m_size; 440591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 441e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles) typedef WillBeHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > EmbeddedObjectSet; 442e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles) WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > m_widgetUpdateSet; 443a854de003a23bf3c7f95ec0f8154ada64092ff5cTorne (Richard Coles) 44409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) // FIXME: These are just "children" of the FrameView and should be RefPtr<Widget> instead. 445e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles) WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderWidget> > m_widgets; 44609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 4477242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci // Oilpan: the use of a persistent back reference 'emulates' the 4487242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci // RefPtr-cycle that is kept between the two objects non-Oilpan. 4497242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci // 4507242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci // That cycle is broken when a LocalFrame is detached by 4517242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci // FrameLoader::detachFromParent(), it then clears its 4527242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci // FrameView's m_frame reference by calling setView(nullptr). 4537242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci RefPtrWillBePersistent<LocalFrame> m_frame; 4545c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 455f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) bool m_doFullPaintInvalidation; 456591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 4575c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_canHaveScrollbars; 4585c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) unsigned m_slowRepaintObjectCount; 4595c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 46009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) bool m_hasPendingLayout; 46109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) RenderObject* m_layoutSubtreeRoot; 462591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch 4635c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_layoutSchedulingEnabled; 46409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) bool m_inPerformLayout; 465f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) bool m_canInvalidatePaintDuringPerformLayout; 4665c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_inSynchronousPostLayout; 4675c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) int m_layoutCount; 4685c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) unsigned m_nestedLayoutCount; 4695c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) Timer<FrameView> m_postLayoutTasksTimer; 47051b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles) Timer<FrameView> m_updateWidgetsTimer; 4715c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_firstLayoutCallbackPending; 4725c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 4735c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_firstLayout; 4745c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_isTransparent; 4755c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) Color m_baseBackgroundColor; 4765c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) IntSize m_lastViewportSize; 4775c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) float m_lastZoomFactor; 4785c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 479591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch AtomicString m_mediaType; 480591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch AtomicString m_mediaTypeWhenNotPrinting; 4815c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 4825c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_overflowStatusDirty; 4835c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_horizontalOverflow; 484591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch bool m_verticalOverflow; 4855c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) RenderObject* m_viewportRenderer; 4865c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 4875c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_wasScrolledByUser; 4885c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_inProgrammaticScroll; 4895c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_safeToPropagateScrollToParent; 4905c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 4915c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) double m_lastPaintTime; 4925c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 493f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) bool m_isTrackingPaintInvalidations; // Used for testing. 494f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) Vector<IntRect> m_trackedPaintInvalidationRects; 4955c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 496f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) RefPtrWillBePersistent<Node> m_nodeToDraw; 4975c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) PaintBehavior m_paintBehavior; 4985c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_isPainting; 4995c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 5005c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) unsigned m_visuallyNonEmptyCharacterCount; 5015c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) unsigned m_visuallyNonEmptyPixelCount; 5025c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_isVisuallyNonEmpty; 5035c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) bool m_firstVisuallyNonEmptyLayoutCallbackPending; 5045c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 505f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) RefPtrWillBePersistent<Node> m_maintainScrollPositionAnchor; 5065c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 5075c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) // Renderer to hold our custom scroll corner. 508e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles) RawPtrWillBePersistent<RenderScrollbarPart> m_scrollCorner; 5095c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 5105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) OwnPtr<ScrollableAreaSet> m_scrollableAreas; 51181a5157921f1d2a7ff6aae115bfe3c139b38a5c8Torne (Richard Coles) OwnPtr<ResizerAreaSet> m_resizerAreas; 5125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; 5139e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) OwnPtr<FrameViewAutoSizeInfo> m_autoSizeInfo; 5145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 51553e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles) float m_visibleContentScaleFactor; 51619cde67944066db31e633d9e386f2aa9bf9fadb3Torne (Richard Coles) IntSize m_inputEventsOffsetForEmulation; 5171e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles) float m_inputEventsScaleFactorForEmulation; 5188abfc5808a4e34d6e03867af8bc440dee641886fTorne (Richard Coles) 519bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) IntSize m_layoutSize; 520bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) bool m_layoutSizeFixedToFrameSize; 52109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 52209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) Timer<FrameView> m_didScrollTimer; 52343e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles) 52443e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles) Vector<IntRect> m_tickmarks; 5259e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) 5269e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) bool m_needsUpdateWidgetPositions; 5277242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci float m_topControlsViewportAdjustment; 5285c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)}; 5295c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 5305c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) 5315c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles){ 5325c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) if (m_isVisuallyNonEmpty) 5335c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) return; 5345c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) m_visuallyNonEmptyCharacterCount += count; 5355c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) // Use a threshold value to prevent very small amounts of visible content from triggering didFirstVisuallyNonEmptyLayout. 5365c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) // The first few hundred characters rarely contain the interesting content of the page. 5375c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) static const unsigned visualCharacterThreshold = 200; 5385c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) if (m_visuallyNonEmptyCharacterCount > visualCharacterThreshold) 5395c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) setIsVisuallyNonEmpty(); 5405c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)} 5415c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 5425c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)inline void FrameView::incrementVisuallyNonEmptyPixelCount(const IntSize& size) 5435c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles){ 5445c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) if (m_isVisuallyNonEmpty) 5455c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) return; 5465c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) m_visuallyNonEmptyPixelCount += size.width() * size.height(); 5475c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) // Use a threshold value to prevent very small amounts of visible content from triggering didFirstVisuallyNonEmptyLayout 5485c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) static const unsigned visualPixelThreshold = 32 * 32; 5495c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) 5505c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) setIsVisuallyNonEmpty(); 5515c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)} 5525c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 55309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFrameView()); 554926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 555f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles)class AllowPaintInvalidationScope { 55609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)public: 557f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) explicit AllowPaintInvalidationScope(FrameView* view) 55809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) : m_view(view) 559f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) , m_originalValue(view ? view->canInvalidatePaintDuringPerformLayout() : false) 56009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) { 56109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) if (!m_view) 56209380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) return; 56309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 564f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) m_view->setCanInvalidatePaintDuringPerformLayout(true); 56509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) } 56609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 567f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) ~AllowPaintInvalidationScope() 56809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) { 56909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) if (!m_view) 57009380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) return; 57109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) 572f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles) m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); 57309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) } 57409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)private: 57509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) FrameView* m_view; 57609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles) bool m_originalValue; 57709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)}; 578926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 579c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)} // namespace blink 5805c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 5815c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#endif // FrameView_h 582