Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / frame / FrameView.h
1 /*
2    Copyright (C) 1997 Martin Jones (mjones@kde.org)
3              (C) 1998 Waldo Bastian (bastian@kde.org)
4              (C) 1998, 1999 Torben Weis (weis@kde.org)
5              (C) 1999 Lars Knoll (knoll@kde.org)
6              (C) 1999 Antti Koivisto (koivisto@kde.org)
7    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
8
9    This library is free software; you can redistribute it and/or
10    modify it under the terms of the GNU Library General Public
11    License as published by the Free Software Foundation; either
12    version 2 of the License, or (at your option) any later version.
13
14    This library is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17    Library General Public License for more details.
18
19    You should have received a copy of the GNU Library General Public License
20    along with this library; see the file COPYING.LIB.  If not, write to
21    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22    Boston, MA 02110-1301, USA.
23 */
24
25 #ifndef FrameView_h
26 #define FrameView_h
27
28 #include "core/frame/FrameViewAutoSizeInfo.h"
29 #include "core/rendering/PaintPhase.h"
30 #include "platform/RuntimeEnabledFeatures.h"
31 #include "platform/geometry/LayoutRect.h"
32 #include "platform/graphics/Color.h"
33 #include "platform/scroll/ScrollView.h"
34 #include "wtf/Forward.h"
35 #include "wtf/OwnPtr.h"
36 #include "wtf/text/WTFString.h"
37
38 namespace blink {
39
40 class AXObjectCache;
41 class DocumentLifecycle;
42 class Cursor;
43 class Element;
44 class FloatSize;
45 class HTMLFrameOwnerElement;
46 class LocalFrame;
47 class KURL;
48 class Node;
49 class Page;
50 class RenderBox;
51 class RenderEmbeddedObject;
52 class RenderObject;
53 class RenderScrollbarPart;
54 class RenderView;
55 class RenderWidget;
56 struct CompositedSelectionBound;
57
58 typedef unsigned long long DOMTimeStamp;
59
60 // FIXME: Oilpan: move Widget (and thereby FrameView) to the heap.
61 class FrameView FINAL : public ScrollView {
62 public:
63     friend class RenderView;
64     friend class Internals;
65
66     static PassRefPtr<FrameView> create(LocalFrame*);
67     static PassRefPtr<FrameView> create(LocalFrame*, const IntSize& initialSize);
68
69     virtual ~FrameView();
70
71     virtual HostWindow* hostWindow() const OVERRIDE;
72
73     virtual void invalidateRect(const IntRect&) OVERRIDE;
74     virtual void setFrameRect(const IntRect&) OVERRIDE;
75
76     LocalFrame& frame() const
77     {
78         ASSERT(m_frame);
79         return *m_frame;
80     }
81
82     Page* page() const;
83
84     RenderView* renderView() const;
85
86     virtual void setCanHaveScrollbars(bool) OVERRIDE;
87
88     virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation) OVERRIDE;
89
90     virtual void setContentsSize(const IntSize&) OVERRIDE;
91     IntPoint clampOffsetAtScale(const IntPoint& offset, float scale) const;
92
93     void layout(bool allowSubtree = true);
94     bool didFirstLayout() const;
95     void scheduleRelayout();
96     void scheduleRelayoutOfSubtree(RenderObject*);
97     bool layoutPending() const;
98     bool isInPerformLayout() const;
99
100     void setCanInvalidatePaintDuringPerformLayout(bool b) { m_canInvalidatePaintDuringPerformLayout = b; }
101     bool canInvalidatePaintDuringPerformLayout() const { return m_canInvalidatePaintDuringPerformLayout; }
102
103     RenderObject* layoutRoot(bool onlyDuringLayout = false) const;
104     void clearLayoutSubtreeRoot() { m_layoutSubtreeRoot = 0; }
105     int layoutCount() const { return m_layoutCount; }
106
107     bool needsLayout() const;
108     void setNeedsLayout();
109
110     void setNeedsUpdateWidgetPositions() { m_needsUpdateWidgetPositions = true; }
111
112     // Methods for getting/setting the size Blink should use to layout the contents.
113     IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const;
114     void setLayoutSize(const IntSize&);
115
116     // If this is set to false, the layout size will need to be explicitly set by the owner.
117     // E.g. WebViewImpl sets its mainFrame's layout size manually
118     void setLayoutSizeFixedToFrameSize(bool isFixed) { m_layoutSizeFixedToFrameSize = isFixed; }
119     bool layoutSizeFixedToFrameSize() { return m_layoutSizeFixedToFrameSize; }
120
121     bool needsFullPaintInvalidation() const { return m_doFullPaintInvalidation; }
122
123     void updateAcceleratedCompositingSettings();
124
125     void recalcOverflowAfterStyleChange();
126
127     bool isEnclosedInCompositingLayer() const;
128
129     void resetScrollbars();
130     void prepareForDetach();
131     void detachCustomScrollbars();
132     virtual void recalculateScrollbarOverlayStyle();
133
134     void clear();
135
136     bool isTransparent() const;
137     void setTransparent(bool isTransparent);
138
139     // True if the FrameView is not transparent, and the base background color is opaque.
140     bool hasOpaqueBackground() const;
141
142     Color baseBackgroundColor() const;
143     void setBaseBackgroundColor(const Color&);
144     void updateBackgroundRecursively(const Color&, bool);
145
146     void adjustViewSize();
147
148     virtual IntRect windowClipRect(IncludeScrollbarsInRect = ExcludeScrollbars) const OVERRIDE;
149     IntRect windowClipRectForFrameOwner(const HTMLFrameOwnerElement*) const;
150
151     virtual IntRect windowResizerRect() const OVERRIDE;
152
153     virtual float visibleContentScaleFactor() const OVERRIDE { return m_visibleContentScaleFactor; }
154     void setVisibleContentScaleFactor(float);
155
156     virtual float inputEventsScaleFactor() const OVERRIDE;
157     virtual IntSize inputEventsOffsetForEmulation() const OVERRIDE;
158     void setInputEventsTransformForEmulation(const IntSize&, float);
159
160     virtual void setScrollPosition(const IntPoint&, ScrollBehavior = ScrollBehaviorInstant) OVERRIDE;
161     virtual bool isRubberBandInProgress() const OVERRIDE;
162     void setScrollPositionNonProgrammatically(const IntPoint&);
163
164     // This is different than visibleContentRect() in that it ignores negative (or overly positive)
165     // offsets from rubber-banding, and it takes zooming into account.
166     LayoutRect viewportConstrainedVisibleContentRect() const;
167     void viewportConstrainedVisibleContentSizeChanged(bool widthChanged, bool heightChanged);
168
169     AtomicString mediaType() const;
170     void setMediaType(const AtomicString&);
171     void adjustMediaTypeForPrinting(bool printing);
172
173     void addSlowRepaintObject();
174     void removeSlowRepaintObject();
175     bool hasSlowRepaintObjects() const { return m_slowRepaintObjectCount; }
176
177     // Fixed-position objects.
178     typedef HashSet<RenderObject*> ViewportConstrainedObjectSet;
179     void addViewportConstrainedObject(RenderObject*);
180     void removeViewportConstrainedObject(RenderObject*);
181     const ViewportConstrainedObjectSet* viewportConstrainedObjects() const { return m_viewportConstrainedObjects.get(); }
182     bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObjects && m_viewportConstrainedObjects->size() > 0; }
183
184     void handleLoadCompleted();
185
186     void updateAnnotatedRegions();
187
188     void restoreScrollbar();
189
190     void postLayoutTimerFired(Timer<FrameView>*);
191
192     bool wasScrolledByUser() const;
193     void setWasScrolledByUser(bool);
194
195     bool safeToPropagateScrollToParent() const { return m_safeToPropagateScrollToParent; }
196     void setSafeToPropagateScrollToParent(bool isSafe) { m_safeToPropagateScrollToParent = isSafe; }
197
198     void addWidget(RenderWidget*);
199     void removeWidget(RenderWidget*);
200     void updateWidgetPositions();
201
202     void addWidgetToUpdate(RenderEmbeddedObject&);
203
204     virtual void paintContents(GraphicsContext*, const IntRect& damageRect) OVERRIDE;
205     void setPaintBehavior(PaintBehavior);
206     PaintBehavior paintBehavior() const;
207     bool isPainting() const;
208     bool hasEverPainted() const { return m_lastPaintTime; }
209     void setNodeToDraw(Node*);
210
211     virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) OVERRIDE;
212     virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect) OVERRIDE;
213     virtual void paintScrollbar(GraphicsContext*, Scrollbar*, const IntRect&) OVERRIDE;
214
215     Color documentBackgroundColor() const;
216
217     static double currentFrameTimeStamp() { return s_currentFrameTimeStamp; }
218
219     void updateLayoutAndStyleForPainting();
220     void updateLayoutAndStyleIfNeededRecursive();
221
222     void invalidateTreeIfNeededRecursive();
223
224     void incrementVisuallyNonEmptyCharacterCount(unsigned);
225     void incrementVisuallyNonEmptyPixelCount(const IntSize&);
226     void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; }
227     void enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSize);
228     void disableAutoSizeMode() { m_autoSizeInfo.clear(); }
229
230     void forceLayout(bool allowSubtree = false);
231     void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkFactor);
232
233     bool scrollToFragment(const KURL&);
234     bool scrollToAnchor(const String&);
235     void maintainScrollPositionAtAnchor(Node*);
236     void scrollElementToRect(Element*, const IntRect&);
237     void scrollContentsIfNeededRecursive();
238
239     // Methods to convert points and rects between the coordinate space of the renderer, and this view.
240     IntRect convertFromRenderer(const RenderObject&, const IntRect&) const;
241     IntRect convertToRenderer(const RenderObject&, const IntRect&) const;
242     IntPoint convertFromRenderer(const RenderObject&, const IntPoint&) const;
243     IntPoint convertToRenderer(const RenderObject&, const IntPoint&) const;
244
245     bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { return m_scrollCorner == scrollCorner; }
246
247     bool isScrollable();
248
249     enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule };
250     void calculateScrollbarModesForLayoutAndSetViewportRenderer(ScrollbarMode& hMode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy = AnyRule);
251
252     virtual IntPoint lastKnownMousePosition() const OVERRIDE;
253     bool shouldSetCursor() const;
254
255     void setCursor(const Cursor&);
256
257     virtual bool scrollbarsCanBeActive() const OVERRIDE;
258
259     // FIXME: Remove this method once plugin loading is decoupled from layout.
260     void flushAnyPendingPostLayoutTasks();
261
262     virtual bool shouldSuspendScrollAnimations() const OVERRIDE;
263     virtual void scrollbarStyleChanged() OVERRIDE;
264
265     RenderBox* embeddedContentBox() const;
266
267     void setTracksPaintInvalidations(bool);
268     bool isTrackingPaintInvalidations() const { return m_isTrackingPaintInvalidations; }
269     void resetTrackedPaintInvalidations();
270
271     String trackedPaintInvalidationRectsAsText() const;
272
273     typedef HashSet<ScrollableArea*> ScrollableAreaSet;
274     void addScrollableArea(ScrollableArea*);
275     void removeScrollableArea(ScrollableArea*);
276     const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.get(); }
277
278     // With CSS style "resize:" enabled, a little resizer handle will appear at the bottom
279     // right of the object. We keep track of these resizer areas for checking if touches
280     // (implemented using Scroll gesture) are targeting the resizer.
281     typedef HashSet<RenderBox*> ResizerAreaSet;
282     void addResizerArea(RenderBox&);
283     void removeResizerArea(RenderBox&);
284     const ResizerAreaSet* resizerAreas() const { return m_resizerAreas.get(); }
285
286     virtual void setParent(Widget*) OVERRIDE;
287     virtual void removeChild(Widget*) OVERRIDE;
288
289     // This function exists for ports that need to handle wheel events manually.
290     // On Mac WebKit1 the underlying NSScrollView just does the scrolling, but on most other platforms
291     // we need this function in order to do the scroll ourselves.
292     bool wheelEvent(const PlatformWheelEvent&);
293
294     bool inProgrammaticScroll() const { return m_inProgrammaticScroll; }
295     void setInProgrammaticScroll(bool programmaticScroll) { m_inProgrammaticScroll = programmaticScroll; }
296
297     virtual bool isActive() const OVERRIDE;
298
299     // DEPRECATED: Use viewportConstrainedVisibleContentRect() instead.
300     IntSize scrollOffsetForFixedPosition() const;
301
302     // Override scrollbar notifications to update the AXObject cache.
303     virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation) OVERRIDE;
304     virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) OVERRIDE;
305
306     // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter
307     // passed around the FrameView layout methods can be true while this returns
308     // false.
309     bool isSubtreeLayout() const { return !!m_layoutSubtreeRoot; }
310
311     // Sets the tickmarks for the FrameView, overriding the default behavior
312     // which is to display the tickmarks corresponding to find results.
313     // If |m_tickmarks| is empty, the default behavior is restored.
314     void setTickmarks(const Vector<IntRect>& tickmarks) { m_tickmarks = tickmarks; }
315
316     // Since the compositor can resize the viewport due to top controls and
317     // commit scroll offsets before a WebView::resize occurs, we need to adjust
318     // our scroll extents to prevent clamping the scroll offsets.
319     void setTopControlsViewportAdjustment(float);
320
321     virtual IntPoint maximumScrollPosition() const OVERRIDE;
322
323     // ScrollableArea interface
324     virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE;
325     virtual void getTickmarks(Vector<IntRect>&) const OVERRIDE;
326     virtual void scrollTo(const IntSize&) OVERRIDE;
327     virtual IntRect scrollableAreaBoundingBox() const OVERRIDE;
328     virtual bool scrollAnimatorEnabled() const OVERRIDE;
329     virtual bool usesCompositedScrolling() const OVERRIDE;
330     virtual GraphicsLayer* layerForScrolling() const OVERRIDE;
331     virtual GraphicsLayer* layerForHorizontalScrollbar() const OVERRIDE;
332     virtual GraphicsLayer* layerForVerticalScrollbar() const OVERRIDE;
333     virtual GraphicsLayer* layerForScrollCorner() const OVERRIDE;
334
335 protected:
336     virtual bool scrollContentsFastPath(const IntSize& scrollDelta) OVERRIDE;
337     virtual void scrollContentsSlowPath(const IntRect& updateRect) OVERRIDE;
338
339     virtual bool isVerticalDocument() const OVERRIDE;
340     virtual bool isFlippedDocument() const OVERRIDE;
341
342     // Prevents creation of scrollbars. Used to prevent drawing two sets of
343     // overlay scrollbars in the case of the pinch viewport.
344     virtual bool scrollbarsDisabled() const OVERRIDE;
345
346 private:
347     explicit FrameView(LocalFrame*);
348
349     void reset();
350     void init();
351
352     virtual void frameRectsChanged() OVERRIDE;
353     virtual bool isFrameView() const OVERRIDE { return true; }
354
355     friend class RenderWidget;
356
357     bool contentsInCompositedLayer() const;
358
359     void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMode, ScrollbarMode& vMode);
360     void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
361
362     void updateCounters();
363     void forceLayoutParentViewIfNeeded();
364     void performPreLayoutTasks();
365     void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout);
366     void scheduleOrPerformPostLayoutTasks();
367     void performPostLayoutTasks();
368
369     void invalidateTreeIfNeeded();
370
371     void gatherDebugLayoutRects(RenderObject* layoutRoot);
372
373     DocumentLifecycle& lifecycle() const;
374
375     virtual void contentRectangleForPaintInvalidation(const IntRect&) OVERRIDE;
376     virtual void contentsResized() OVERRIDE;
377     virtual void scrollbarExistenceDidChange() OVERRIDE;
378
379     // Override ScrollView methods to do point conversion via renderers, in order to
380     // take transforms into account.
381     virtual IntRect convertToContainingView(const IntRect&) const OVERRIDE;
382     virtual IntRect convertFromContainingView(const IntRect&) const OVERRIDE;
383     virtual IntPoint convertToContainingView(const IntPoint&) const OVERRIDE;
384     virtual IntPoint convertFromContainingView(const IntPoint&) const OVERRIDE;
385
386     void updateWidgetPositionsIfNeeded();
387
388     bool wasViewportResized();
389     void sendResizeEventIfNeeded();
390
391     void updateScrollableAreaSet();
392
393     virtual void notifyPageThatContentAreaWillPaint() const OVERRIDE;
394
395     void scheduleUpdateWidgetsIfNecessary();
396     void updateWidgetsTimerFired(Timer<FrameView>*);
397     bool updateWidgets();
398
399     void scrollToAnchor();
400     void scrollPositionChanged();
401     void didScrollTimerFired(Timer<FrameView>*);
402
403     void updateLayersAndCompositingAfterScrollIfNeeded();
404
405     static bool computeCompositedSelectionBounds(LocalFrame&, CompositedSelectionBound& start, CompositedSelectionBound& end);
406     void updateCompositedSelectionBoundsIfNeeded();
407
408     bool hasCustomScrollbars() const;
409     bool shouldUseCustomScrollbars(Element*& customScrollbarElement, LocalFrame*& customScrollbarFrame);
410
411     virtual void updateScrollCorner() OVERRIDE;
412
413     FrameView* parentFrameView() const;
414
415     AXObjectCache* axObjectCache() const;
416     void removeFromAXObjectCache();
417
418     void setLayoutSizeInternal(const IntSize&);
419
420     bool paintInvalidationIsAllowed() const
421     {
422         return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout();
423     }
424
425     static double s_currentFrameTimeStamp; // used for detecting decoded resource thrash in the cache
426     static bool s_inPaintContents;
427
428     LayoutSize m_size;
429
430     typedef WillBeHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > EmbeddedObjectSet;
431     WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > m_widgetUpdateSet;
432
433     // FIXME: These are just "children" of the FrameView and should be RefPtr<Widget> instead.
434     WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderWidget> > m_widgets;
435
436     // Oilpan: the use of a persistent back reference 'emulates' the
437     // RefPtr-cycle that is kept between the two objects non-Oilpan.
438     //
439     // That cycle is broken when a LocalFrame is detached by
440     // FrameLoader::detachFromParent(), it then clears its
441     // FrameView's m_frame reference by calling setView(nullptr).
442     RefPtrWillBePersistent<LocalFrame> m_frame;
443
444     bool m_doFullPaintInvalidation;
445
446     bool m_canHaveScrollbars;
447     unsigned m_slowRepaintObjectCount;
448
449     bool m_hasPendingLayout;
450     RenderObject* m_layoutSubtreeRoot;
451
452     bool m_layoutSchedulingEnabled;
453     bool m_inPerformLayout;
454     bool m_canInvalidatePaintDuringPerformLayout;
455     bool m_inSynchronousPostLayout;
456     int m_layoutCount;
457     unsigned m_nestedLayoutCount;
458     Timer<FrameView> m_postLayoutTasksTimer;
459     Timer<FrameView> m_updateWidgetsTimer;
460     bool m_firstLayoutCallbackPending;
461
462     bool m_firstLayout;
463     bool m_isTransparent;
464     Color m_baseBackgroundColor;
465     IntSize m_lastViewportSize;
466     float m_lastZoomFactor;
467
468     AtomicString m_mediaType;
469     AtomicString m_mediaTypeWhenNotPrinting;
470
471     bool m_overflowStatusDirty;
472     bool m_horizontalOverflow;
473     bool m_verticalOverflow;
474     RenderObject* m_viewportRenderer;
475
476     bool m_wasScrolledByUser;
477     bool m_inProgrammaticScroll;
478     bool m_safeToPropagateScrollToParent;
479
480     double m_lastPaintTime;
481
482     bool m_isTrackingPaintInvalidations; // Used for testing.
483     Vector<IntRect> m_trackedPaintInvalidationRects;
484
485     RefPtrWillBePersistent<Node> m_nodeToDraw;
486     PaintBehavior m_paintBehavior;
487     bool m_isPainting;
488
489     unsigned m_visuallyNonEmptyCharacterCount;
490     unsigned m_visuallyNonEmptyPixelCount;
491     bool m_isVisuallyNonEmpty;
492     bool m_firstVisuallyNonEmptyLayoutCallbackPending;
493
494     RefPtrWillBePersistent<Node> m_maintainScrollPositionAnchor;
495
496     // Renderer to hold our custom scroll corner.
497     RawPtrWillBePersistent<RenderScrollbarPart> m_scrollCorner;
498
499     OwnPtr<ScrollableAreaSet> m_scrollableAreas;
500     OwnPtr<ResizerAreaSet> m_resizerAreas;
501     OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects;
502     OwnPtr<FrameViewAutoSizeInfo> m_autoSizeInfo;
503
504     float m_visibleContentScaleFactor;
505     IntSize m_inputEventsOffsetForEmulation;
506     float m_inputEventsScaleFactorForEmulation;
507
508     IntSize m_layoutSize;
509     bool m_layoutSizeFixedToFrameSize;
510
511     Timer<FrameView> m_didScrollTimer;
512
513     Vector<IntRect> m_tickmarks;
514
515     bool m_needsUpdateWidgetPositions;
516     float m_topControlsViewportAdjustment;
517 };
518
519 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count)
520 {
521     if (m_isVisuallyNonEmpty)
522         return;
523     m_visuallyNonEmptyCharacterCount += count;
524     // Use a threshold value to prevent very small amounts of visible content from triggering didFirstVisuallyNonEmptyLayout.
525     // The first few hundred characters rarely contain the interesting content of the page.
526     static const unsigned visualCharacterThreshold = 200;
527     if (m_visuallyNonEmptyCharacterCount > visualCharacterThreshold)
528         setIsVisuallyNonEmpty();
529 }
530
531 inline void FrameView::incrementVisuallyNonEmptyPixelCount(const IntSize& size)
532 {
533     if (m_isVisuallyNonEmpty)
534         return;
535     m_visuallyNonEmptyPixelCount += size.width() * size.height();
536     // Use a threshold value to prevent very small amounts of visible content from triggering didFirstVisuallyNonEmptyLayout
537     static const unsigned visualPixelThreshold = 32 * 32;
538     if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
539         setIsVisuallyNonEmpty();
540 }
541
542 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFrameView());
543
544 class AllowPaintInvalidationScope {
545 public:
546     explicit AllowPaintInvalidationScope(FrameView* view)
547         : m_view(view)
548         , m_originalValue(view ? view->canInvalidatePaintDuringPerformLayout() : false)
549     {
550         if (!m_view)
551             return;
552
553         m_view->setCanInvalidatePaintDuringPerformLayout(true);
554     }
555
556     ~AllowPaintInvalidationScope()
557     {
558         if (!m_view)
559             return;
560
561         m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue);
562     }
563 private:
564     FrameView* m_view;
565     bool m_originalValue;
566 };
567
568 } // namespace blink
569
570 #endif // FrameView_h