8f0d21a4dbf330997f6b51b59573564216140802
[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 "RuntimeEnabledFeatures.h"
29 #include "core/rendering/PaintPhase.h"
30 #include "platform/geometry/LayoutRect.h"
31 #include "platform/graphics/Color.h"
32 #include "platform/scroll/ScrollView.h"
33 #include "wtf/Forward.h"
34 #include "wtf/OwnPtr.h"
35 #include "wtf/text/WTFString.h"
36
37 namespace WebCore {
38
39 class AXObjectCache;
40 class DocumentLifecycle;
41 class Cursor;
42 class Element;
43 class FloatSize;
44 class HTMLFrameOwnerElement;
45 class LocalFrame;
46 class KURL;
47 class Node;
48 class Page;
49 class RenderBox;
50 class RenderEmbeddedObject;
51 class RenderObject;
52 class RenderScrollbarPart;
53 class RenderStyle;
54 class RenderView;
55 class RenderWidget;
56
57 typedef unsigned long long DOMTimeStamp;
58
59 class FrameView FINAL : public ScrollView {
60 public:
61     friend class RenderView;
62     friend class Internals;
63
64     static PassRefPtr<FrameView> create(LocalFrame*);
65     static PassRefPtr<FrameView> create(LocalFrame*, const IntSize& initialSize);
66
67     virtual ~FrameView();
68
69     virtual HostWindow* hostWindow() const OVERRIDE;
70
71     virtual void invalidateRect(const IntRect&) OVERRIDE;
72     virtual void setFrameRect(const IntRect&) OVERRIDE;
73
74     virtual bool scheduleAnimation() OVERRIDE;
75
76     LocalFrame& frame() const { return *m_frame; }
77     Page* page() const;
78
79     RenderView* renderView() const;
80
81     virtual void setCanHaveScrollbars(bool) OVERRIDE;
82
83     virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation) OVERRIDE;
84
85     virtual void setContentsSize(const IntSize&) OVERRIDE;
86     IntPoint clampOffsetAtScale(const IntPoint& offset, float scale) const;
87
88     void layout(bool allowSubtree = true);
89     bool didFirstLayout() const;
90     void scheduleRelayout();
91     void scheduleRelayoutOfSubtree(RenderObject*);
92     bool layoutPending() const;
93     bool isInPerformLayout() const;
94
95     void setCanRepaintDuringPerformLayout(bool b) { m_canRepaintDuringPerformLayout = b; }
96     bool canRepaintDuringPerformLayout() const { return m_canRepaintDuringPerformLayout; }
97
98     RenderObject* layoutRoot(bool onlyDuringLayout = false) const;
99     void clearLayoutSubtreeRoot() { m_layoutSubtreeRoot = 0; }
100     int layoutCount() const { return m_layoutCount; }
101
102     bool needsLayout() const;
103     void setNeedsLayout();
104
105     // Methods for getting/setting the size Blink should use to layout the contents.
106     IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const;
107     void setLayoutSize(const IntSize&);
108
109     // If this is set to false, the layout size will need to be explicitly set by the owner.
110     // E.g. WebViewImpl sets its mainFrame's layout size manually
111     void setLayoutSizeFixedToFrameSize(bool isFixed) { m_layoutSizeFixedToFrameSize = isFixed; }
112     bool layoutSizeFixedToFrameSize() { return m_layoutSizeFixedToFrameSize; }
113
114     bool needsFullRepaint() const { return m_doFullRepaint; }
115
116     void updateCompositingLayersAfterStyleChange();
117     void updateCompositingLayersAfterLayout();
118
119     bool hasCompositedContent() const;
120     bool isEnclosedInCompositingLayer() const;
121
122     void resetScrollbars();
123     void prepareForDetach();
124     void detachCustomScrollbars();
125     virtual void recalculateScrollbarOverlayStyle();
126
127     void clear();
128
129     bool isTransparent() const;
130     void setTransparent(bool isTransparent);
131
132     // True if the FrameView is not transparent, and the base background color is opaque.
133     bool hasOpaqueBackground() const;
134
135     Color baseBackgroundColor() const;
136     void setBaseBackgroundColor(const Color&);
137     void updateBackgroundRecursively(const Color&, bool);
138
139     void adjustViewSize();
140
141     virtual IntRect windowClipRect(IncludeScrollbarsInRect = ExcludeScrollbars) const OVERRIDE;
142     IntRect windowClipRectForFrameOwner(const HTMLFrameOwnerElement*) const;
143
144     virtual IntRect windowResizerRect() const OVERRIDE;
145
146     virtual float visibleContentScaleFactor() const OVERRIDE { return m_visibleContentScaleFactor; }
147     void setVisibleContentScaleFactor(float);
148
149     virtual float inputEventsScaleFactor() const OVERRIDE;
150     virtual IntSize inputEventsOffsetForEmulation() const OVERRIDE;
151     void setInputEventsTransformForEmulation(const IntSize&, float);
152
153     virtual void setScrollPosition(const IntPoint&) OVERRIDE;
154     virtual bool shouldRubberBandInDirection(ScrollDirection) const OVERRIDE;
155     virtual bool isRubberBandInProgress() const OVERRIDE;
156     void setScrollPositionNonProgrammatically(const IntPoint&);
157
158     // This is different than visibleContentRect() in that it ignores negative (or overly positive)
159     // offsets from rubber-banding, and it takes zooming into account.
160     LayoutRect viewportConstrainedVisibleContentRect() const;
161     void viewportConstrainedVisibleContentSizeChanged(bool widthChanged, bool heightChanged);
162
163     AtomicString mediaType() const;
164     void setMediaType(const AtomicString&);
165     void adjustMediaTypeForPrinting(bool printing);
166
167     void setCannotBlitToWindow();
168     void setIsOverlapped(bool);
169     bool isOverlapped() const { return m_isOverlapped; }
170     void setContentIsOpaque(bool);
171
172     void addSlowRepaintObject();
173     void removeSlowRepaintObject();
174     bool hasSlowRepaintObjects() const { return m_slowRepaintObjectCount; }
175
176     // Includes fixed- and sticky-position objects.
177     typedef HashSet<RenderObject*> ViewportConstrainedObjectSet;
178     void addViewportConstrainedObject(RenderObject*);
179     void removeViewportConstrainedObject(RenderObject*);
180     const ViewportConstrainedObjectSet* viewportConstrainedObjects() const { return m_viewportConstrainedObjects.get(); }
181     bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObjects && m_viewportConstrainedObjects->size() > 0; }
182
183     void handleLoadCompleted();
184
185     void updateAnnotatedRegions();
186     void updateControlTints();
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 incrementVisuallyNonEmptyCharacterCount(unsigned);
223     void incrementVisuallyNonEmptyPixelCount(const IntSize&);
224     void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; }
225     void enableAutoSizeMode(bool enable, const IntSize& minSize, const IntSize& maxSize);
226
227     void forceLayout(bool allowSubtree = false);
228     void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkFactor);
229
230     bool scrollToFragment(const KURL&);
231     bool scrollToAnchor(const String&);
232     void maintainScrollPositionAtAnchor(Node*);
233     void scrollElementToRect(Element*, const IntRect&);
234     void scrollContentsIfNeededRecursive();
235
236     // Methods to convert points and rects between the coordinate space of the renderer, and this view.
237     IntRect convertFromRenderer(const RenderObject*, const IntRect&) const;
238     IntRect convertToRenderer(const RenderObject*, const IntRect&) const;
239     IntPoint convertFromRenderer(const RenderObject*, const IntPoint&) const;
240     IntPoint convertToRenderer(const RenderObject*, const IntPoint&) const;
241
242     bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { return m_scrollCorner == scrollCorner; }
243
244     bool isScrollable();
245
246     enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule };
247     void calculateScrollbarModesForLayoutAndSetViewportRenderer(ScrollbarMode& hMode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy = AnyRule);
248
249     virtual IntPoint lastKnownMousePosition() const OVERRIDE;
250     bool shouldSetCursor() const;
251
252     void setCursor(const Cursor&);
253
254     virtual bool scrollbarsCanBeActive() const OVERRIDE;
255
256     // FIXME: Remove this method once plugin loading is decoupled from layout.
257     void flushAnyPendingPostLayoutTasks();
258
259     virtual bool shouldSuspendScrollAnimations() const OVERRIDE;
260     virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate) OVERRIDE;
261
262     RenderBox* embeddedContentBox() const;
263
264     void setTracksRepaints(bool);
265     bool isTrackingRepaints() const { return m_isTrackingRepaints; }
266     void resetTrackedRepaints();
267     String trackedRepaintRectsAsText() const;
268
269     typedef HashSet<ScrollableArea*> ScrollableAreaSet;
270     // Returns whether the scrollable area has just been newly added.
271     bool addScrollableArea(ScrollableArea*);
272     // Returns whether the scrollable area has just been removed.
273     bool removeScrollableArea(ScrollableArea*);
274     bool containsScrollableArea(const ScrollableArea*) const;
275     const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.get(); }
276
277     // With CSS style "resize:" enabled, a little resizer handle will appear at the bottom
278     // right of the object. We keep track of these resizer areas for checking if touches
279     // (implemented using Scroll gesture) are targeting the resizer.
280     typedef HashSet<RenderBox*> ResizerAreaSet;
281     void addResizerArea(RenderBox*);
282     void removeResizerArea(RenderBox*);
283     const ResizerAreaSet* resizerAreas() const { return m_resizerAreas.get(); }
284
285     virtual void removeChild(Widget*) OVERRIDE;
286
287     // This function exists for ports that need to handle wheel events manually.
288     // On Mac WebKit1 the underlying NSScrollView just does the scrolling, but on most other platforms
289     // we need this function in order to do the scroll ourselves.
290     bool wheelEvent(const PlatformWheelEvent&);
291
292     bool inProgrammaticScroll() const { return m_inProgrammaticScroll; }
293     void setInProgrammaticScroll(bool programmaticScroll) { m_inProgrammaticScroll = programmaticScroll; }
294
295     void setHasSoftwareFilters(bool hasSoftwareFilters) { m_hasSoftwareFilters = hasSoftwareFilters; }
296     bool hasSoftwareFilters() const { return m_hasSoftwareFilters; }
297
298     virtual bool isActive() const OVERRIDE;
299
300     // DEPRECATED: Use viewportConstrainedVisibleContentRect() instead.
301     IntSize scrollOffsetForFixedPosition() const;
302
303     virtual bool shouldPlaceVerticalScrollbarOnLeft() const OVERRIDE;
304
305     // Override scrollbar notifications to update the AXObject cache.
306     virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation) OVERRIDE;
307     virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) OVERRIDE;
308
309     virtual bool shouldAttemptToScrollUsingFastPath() const OVERRIDE;
310     // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter
311     // passed around the FrameView layout methods can be true while this returns
312     // false.
313     bool isSubtreeLayout() const { return !!m_layoutSubtreeRoot; }
314
315     // Sets the tickmarks for the FrameView, overriding the default behavior
316     // which is to display the tickmarks corresponding to find results.
317     // If |m_tickmarks| is empty, the default behavior is restored.
318     void setTickmarks(const Vector<IntRect>& tickmarks) { m_tickmarks = tickmarks; }
319
320     // ScrollableArea interface
321     virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE;
322     virtual void getTickmarks(Vector<IntRect>&) const OVERRIDE;
323     virtual void scrollTo(const IntSize&) OVERRIDE;
324     virtual IntRect scrollableAreaBoundingBox() const OVERRIDE;
325     virtual bool scrollAnimatorEnabled() const OVERRIDE;
326     virtual bool usesCompositedScrolling() const OVERRIDE;
327     virtual GraphicsLayer* layerForScrolling() const OVERRIDE;
328     virtual GraphicsLayer* layerForHorizontalScrollbar() const OVERRIDE;
329     virtual GraphicsLayer* layerForVerticalScrollbar() const OVERRIDE;
330     virtual GraphicsLayer* layerForScrollCorner() const OVERRIDE;
331
332 protected:
333     virtual void scrollContentsIfNeeded();
334     virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) OVERRIDE;
335     virtual void scrollContentsSlowPath(const IntRect& updateRect) OVERRIDE;
336
337     virtual bool isVerticalDocument() const OVERRIDE;
338     virtual bool isFlippedDocument() const OVERRIDE;
339
340 private:
341     explicit FrameView(LocalFrame*);
342
343     void reset();
344     void init();
345
346     virtual void frameRectsChanged() OVERRIDE;
347     virtual bool isFrameView() const OVERRIDE { return true; }
348
349     friend class RenderWidget;
350     bool useSlowRepaints(bool considerOverlap = true) const;
351     bool useSlowRepaintsIfNotOverlapped() const;
352
353     bool contentsInCompositedLayer() const;
354
355     void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMode, ScrollbarMode& vMode);
356     void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
357
358     void updateCounters();
359     void autoSizeIfEnabled();
360     void forceLayoutParentViewIfNeeded();
361     void performPreLayoutTasks();
362     void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout);
363     void scheduleOrPerformPostLayoutTasks();
364     void performPostLayoutTasks();
365
366     void repaintTree(RenderObject* root);
367
368     void gatherDebugLayoutRects(RenderObject* layoutRoot);
369
370     DocumentLifecycle& lifecycle() const;
371
372     virtual void repaintContentRectangle(const IntRect&) OVERRIDE;
373     virtual void contentsResized() OVERRIDE;
374     virtual void scrollbarExistenceDidChange() OVERRIDE;
375
376     // Override ScrollView methods to do point conversion via renderers, in order to
377     // take transforms into account.
378     virtual IntRect convertToContainingView(const IntRect&) const OVERRIDE;
379     virtual IntRect convertFromContainingView(const IntRect&) const OVERRIDE;
380     virtual IntPoint convertToContainingView(const IntPoint&) const OVERRIDE;
381     virtual IntPoint convertFromContainingView(const IntPoint&) const OVERRIDE;
382
383     void sendResizeEventIfNeeded();
384
385     void updateScrollableAreaSet();
386
387     virtual void notifyPageThatContentAreaWillPaint() const OVERRIDE;
388
389     void scheduleUpdateWidgetsIfNecessary();
390     void updateWidgetsTimerFired(Timer<FrameView>*);
391     bool updateWidgets();
392
393     void scrollToAnchor();
394     void scrollPositionChanged();
395     void didScrollTimerFired(Timer<FrameView>*);
396
397     void updateLayersAndCompositingAfterScrollIfNeeded();
398     void updateFixedElementRepaintRectsAfterScroll();
399
400     bool hasCustomScrollbars() const;
401     bool shouldUseCustomScrollbars(Element*& customScrollbarElement, LocalFrame*& customScrollbarFrame);
402
403     virtual void updateScrollCorner() OVERRIDE;
404
405     FrameView* parentFrameView() const;
406
407     AXObjectCache* axObjectCache() const;
408     void removeFromAXObjectCache();
409
410     bool isMainFrame() const;
411
412     void setLayoutSizeInternal(const IntSize&);
413
414     bool repaintAllowed() const
415     {
416         if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
417             return true;
418
419         return !isInPerformLayout() || canRepaintDuringPerformLayout();
420     }
421
422     static double s_currentFrameTimeStamp; // used for detecting decoded resource thrash in the cache
423     static bool s_inPaintContents;
424
425     LayoutSize m_size;
426
427     typedef HashSet<RefPtr<RenderEmbeddedObject> > EmbeddedObjectSet;
428     EmbeddedObjectSet m_widgetUpdateSet;
429
430     // FIXME: These are just "children" of the FrameView and should be RefPtr<Widget> instead.
431     HashSet<RefPtr<RenderWidget> > m_widgets;
432
433     RefPtr<LocalFrame> m_frame;
434
435     bool m_doFullRepaint;
436
437     bool m_canHaveScrollbars;
438     bool m_cannotBlitToWindow;
439     bool m_isOverlapped;
440     bool m_contentIsOpaque;
441     unsigned m_slowRepaintObjectCount;
442
443     bool m_hasPendingLayout;
444     RenderObject* m_layoutSubtreeRoot;
445
446     bool m_layoutSchedulingEnabled;
447     bool m_inPerformLayout;
448     bool m_canRepaintDuringPerformLayout;
449     bool m_doingPreLayoutStyleUpdate;
450     bool m_inSynchronousPostLayout;
451     int m_layoutCount;
452     unsigned m_nestedLayoutCount;
453     Timer<FrameView> m_postLayoutTasksTimer;
454     Timer<FrameView> m_updateWidgetsTimer;
455     bool m_firstLayoutCallbackPending;
456
457     bool m_firstLayout;
458     bool m_isTransparent;
459     Color m_baseBackgroundColor;
460     IntSize m_lastViewportSize;
461     float m_lastZoomFactor;
462
463     AtomicString m_mediaType;
464     AtomicString m_mediaTypeWhenNotPrinting;
465
466     bool m_overflowStatusDirty;
467     bool m_horizontalOverflow;
468     bool m_verticalOverflow;
469     RenderObject* m_viewportRenderer;
470
471     bool m_wasScrolledByUser;
472     bool m_inProgrammaticScroll;
473     bool m_safeToPropagateScrollToParent;
474
475     double m_lastPaintTime;
476
477     bool m_isTrackingRepaints; // Used for testing.
478     Vector<IntRect> m_trackedRepaintRects;
479
480     RefPtr<Node> m_nodeToDraw;
481     PaintBehavior m_paintBehavior;
482     bool m_isPainting;
483
484     unsigned m_visuallyNonEmptyCharacterCount;
485     unsigned m_visuallyNonEmptyPixelCount;
486     bool m_isVisuallyNonEmpty;
487     bool m_firstVisuallyNonEmptyLayoutCallbackPending;
488
489     RefPtr<Node> m_maintainScrollPositionAnchor;
490
491     // Renderer to hold our custom scroll corner.
492     RenderScrollbarPart* m_scrollCorner;
493
494     // If true, automatically resize the frame view around its content.
495     bool m_shouldAutoSize;
496     bool m_inAutoSize;
497     // True if autosize has been run since m_shouldAutoSize was set.
498     bool m_didRunAutosize;
499     // The lower bound on the size when autosizing.
500     IntSize m_minAutoSize;
501     // The upper bound on the size when autosizing.
502     IntSize m_maxAutoSize;
503
504     OwnPtr<ScrollableAreaSet> m_scrollableAreas;
505     OwnPtr<ResizerAreaSet> m_resizerAreas;
506     OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects;
507
508     bool m_hasSoftwareFilters;
509
510     float m_visibleContentScaleFactor;
511     IntSize m_inputEventsOffsetForEmulation;
512     float m_inputEventsScaleFactorForEmulation;
513
514     IntSize m_layoutSize;
515     bool m_layoutSizeFixedToFrameSize;
516
517     Timer<FrameView> m_didScrollTimer;
518
519     Vector<IntRect> m_tickmarks;
520 };
521
522 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count)
523 {
524     if (m_isVisuallyNonEmpty)
525         return;
526     m_visuallyNonEmptyCharacterCount += count;
527     // Use a threshold value to prevent very small amounts of visible content from triggering didFirstVisuallyNonEmptyLayout.
528     // The first few hundred characters rarely contain the interesting content of the page.
529     static const unsigned visualCharacterThreshold = 200;
530     if (m_visuallyNonEmptyCharacterCount > visualCharacterThreshold)
531         setIsVisuallyNonEmpty();
532 }
533
534 inline void FrameView::incrementVisuallyNonEmptyPixelCount(const IntSize& size)
535 {
536     if (m_isVisuallyNonEmpty)
537         return;
538     m_visuallyNonEmptyPixelCount += size.width() * size.height();
539     // Use a threshold value to prevent very small amounts of visible content from triggering didFirstVisuallyNonEmptyLayout
540     static const unsigned visualPixelThreshold = 32 * 32;
541     if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
542         setIsVisuallyNonEmpty();
543 }
544
545 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFrameView());
546
547 class AllowRepaintScope {
548 public:
549     explicit AllowRepaintScope(FrameView* view)
550         : m_view(view)
551         , m_originalValue(view ? view->canRepaintDuringPerformLayout() : false)
552     {
553         if (!m_view)
554             return;
555
556         m_view->setCanRepaintDuringPerformLayout(true);
557     }
558
559     ~AllowRepaintScope()
560     {
561         if (!m_view)
562             return;
563
564         m_view->setCanRepaintDuringPerformLayout(m_originalValue);
565     }
566 private:
567     FrameView* m_view;
568     bool m_originalValue;
569 };
570
571 } // namespace WebCore
572
573 #endif // FrameView_h