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.
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.
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.
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.
28 #include "AdjustViewSizeOrNot.h"
31 #include "LayoutRect.h"
32 #include "Pagination.h"
33 #include "PaintPhase.h"
34 #include "ScrollView.h"
35 #include <wtf/Forward.h>
36 #include <wtf/OwnPtr.h>
37 #include <wtf/text/WTFString.h>
46 class FrameActionScheduler;
51 class RenderEmbeddedObject;
54 class RenderScrollbarPart;
56 Pagination::Mode paginationModeForRenderStyle(RenderStyle*);
58 typedef unsigned long long DOMTimeStamp;
60 class FrameView : public ScrollView {
62 friend class RenderView;
63 friend class Internals;
65 static PassRefPtr<FrameView> create(Frame*);
66 static PassRefPtr<FrameView> create(Frame*, const IntSize& initialSize);
70 virtual HostWindow* hostWindow() const;
72 virtual void invalidateRect(const IntRect&);
73 virtual void setFrameRect(const IntRect&);
75 #if ENABLE(REQUEST_ANIMATION_FRAME)
76 virtual bool scheduleAnimation();
79 Frame* frame() const { return m_frame.get(); }
82 int mapFromLayoutToCSSUnits(LayoutUnit);
83 LayoutUnit mapFromCSSToLayoutUnits(int);
85 LayoutUnit marginWidth() const { return m_margins.width(); } // -1 means default
86 LayoutUnit marginHeight() const { return m_margins.height(); } // -1 means default
87 void setMarginWidth(LayoutUnit);
88 void setMarginHeight(LayoutUnit);
90 virtual void setCanHaveScrollbars(bool);
91 void updateCanHaveScrollbars();
93 virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
95 virtual bool avoidScrollbarCreation() const;
97 virtual void setContentsSize(const IntSize&);
99 void layout(bool allowSubtree = true);
100 bool didFirstLayout() const;
101 void layoutTimerFired(Timer<FrameView>*);
102 void scheduleRelayout();
103 void scheduleRelayoutOfSubtree(RenderObject*);
104 void unscheduleRelayout();
105 bool layoutPending() const;
106 bool isInLayout() const { return m_inLayout; }
108 RenderObject* layoutRoot(bool onlyDuringLayout = false) const;
109 void clearLayoutRoot() { m_layoutRoot = 0; }
110 int layoutCount() const { return m_layoutCount; }
112 bool needsLayout() const;
113 void setNeedsLayout();
115 bool needsFullRepaint() const { return m_doFullRepaint; }
117 #if ENABLE(REQUEST_ANIMATION_FRAME)
118 void serviceScriptedAnimations(double monotonicAnimationStartTime);
121 #if USE(ACCELERATED_COMPOSITING)
122 void updateCompositingLayersAfterStyleChange();
123 void updateCompositingLayersAfterLayout();
124 bool flushCompositingStateForThisFrame(Frame* rootFrameForFlush);
126 void clearBackingStores();
127 void restoreBackingStores();
129 // Called when changes to the GraphicsLayer hierarchy have to be synchronized with
130 // content rendered via the normal painting path.
131 void setNeedsOneShotDrawingSynchronization();
133 virtual TiledBacking* tiledBacking() OVERRIDE;
135 // In the future when any ScrollableArea can have a node in th ScrollingTree, this should
136 // become a virtual function on ScrollableArea.
137 uint64_t scrollLayerID() const;
140 bool hasCompositedContent() const;
141 bool hasCompositedContentIncludingDescendants() const;
142 bool hasCompositingAncestor() const;
143 void enterCompositingMode();
144 bool isEnclosedInCompositingLayer() const;
146 // Only used with accelerated compositing, but outside the #ifdef to make linkage easier.
147 // Returns true if the flush was completed.
148 bool flushCompositingStateIncludingSubframes();
150 // Returns true when a paint with the PaintBehaviorFlattenCompositingLayers flag set gives
151 // a faithful representation of the content.
152 bool isSoftwareRenderable() const;
154 void didMoveOnscreen();
155 void willMoveOffscreen();
157 void resetScrollbars();
158 void resetScrollbarsAndClearContentsSize();
159 void prepareForDetach();
160 void detachCustomScrollbars();
161 virtual void recalculateScrollbarOverlayStyle();
165 bool isTransparent() const;
166 void setTransparent(bool isTransparent);
168 Color baseBackgroundColor() const;
169 void setBaseBackgroundColor(const Color&);
170 void updateBackgroundRecursively(const Color&, bool);
172 bool shouldUpdateWhileOffscreen() const;
173 void setShouldUpdateWhileOffscreen(bool);
174 bool shouldUpdate(bool = false) const;
176 void adjustViewSize();
178 virtual IntRect windowClipRect(bool clipToContents = true) const;
179 IntRect windowClipRectForFrameOwner(const HTMLFrameOwnerElement*, bool clipToLayerContents) const;
181 virtual IntRect windowResizerRect() const;
183 virtual void setFixedVisibleContentRect(const IntRect&) OVERRIDE;
184 virtual void setScrollPosition(const IntPoint&) OVERRIDE;
185 void scrollPositionChangedViaPlatformWidget();
186 virtual void repaintFixedElementsAfterScrolling();
187 virtual void updateFixedElementsAfterScrolling();
188 virtual bool shouldRubberBandInDirection(ScrollDirection) const;
189 virtual bool requestScrollPositionUpdate(const IntPoint&) OVERRIDE;
191 String mediaType() const;
192 void setMediaType(const String&);
193 void adjustMediaTypeForPrinting(bool printing);
195 void setCannotBlitToWindow();
196 void setIsOverlapped(bool);
197 bool isOverlapped() const { return m_isOverlapped; }
198 bool isOverlappedIncludingAncestors() const;
199 void setContentIsOpaque(bool);
201 void addSlowRepaintObject();
202 void removeSlowRepaintObject();
203 bool hasSlowRepaintObjects() const { return m_slowRepaintObjectCount; }
205 // Includes fixed- and sticky-position objects.
206 typedef HashSet<RenderObject*> ViewportConstrainedObjectSet;
207 void addViewportConstrainedObject(RenderObject*);
208 void removeViewportConstrainedObject(RenderObject*);
209 const ViewportConstrainedObjectSet* viewportConstrainedObjects() const { return m_viewportConstrainedObjects.get(); }
210 bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObjects && m_viewportConstrainedObjects->size() > 0; }
212 // Functions for querying the current scrolled position, negating the effects of overhang
213 // and adjusting for page scale.
214 IntSize scrollOffsetForFixedPosition() const;
216 bool fixedElementsLayoutRelativeToFrame() const;
218 void beginDeferredRepaints();
219 void endDeferredRepaints();
220 void handleLoadCompleted();
221 void flushDeferredRepaints();
222 void startDeferredRepaintTimer(double delay);
223 void resetDeferredRepaintDelay();
225 void beginDisableRepaints();
226 void endDisableRepaints();
227 bool repaintsDisabled() { return m_disableRepaints > 0; }
229 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION)
230 void updateAnnotatedRegions();
232 void updateControlTints();
234 void restoreScrollbar();
236 void scheduleEvent(PassRefPtr<Event>, PassRefPtr<Node>);
237 void pauseScheduledEvents();
238 void resumeScheduledEvents();
239 void postLayoutTimerFired(Timer<FrameView>*);
241 bool wasScrolledByUser() const;
242 void setWasScrolledByUser(bool);
244 bool safeToPropagateScrollToParent() const { return m_safeToPropagateScrollToParent; }
245 void setSafeToPropagateScrollToParent(bool isSafe) { m_safeToPropagateScrollToParent = isSafe; }
247 void addWidgetToUpdate(RenderEmbeddedObject*);
248 void removeWidgetToUpdate(RenderEmbeddedObject*);
250 virtual void paintContents(GraphicsContext*, const IntRect& damageRect);
251 void setPaintBehavior(PaintBehavior);
252 PaintBehavior paintBehavior() const;
253 bool isPainting() const;
254 bool hasEverPainted() const { return m_lastPaintTime; }
255 void setLastPaintTime(double lastPaintTime) { m_lastPaintTime = lastPaintTime; }
256 void setNodeToDraw(Node*);
258 enum SelectionInSnaphot { IncludeSelection, ExcludeSelection };
259 enum CoordinateSpaceForSnapshot { DocumentCoordinates, ViewCoordinates };
260 void paintContentsForSnapshot(GraphicsContext*, const IntRect& imageRect, SelectionInSnaphot shouldPaintSelection, CoordinateSpaceForSnapshot);
262 virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
263 virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
264 virtual void paintScrollbar(GraphicsContext*, Scrollbar*, const IntRect&) OVERRIDE;
266 Color documentBackgroundColor() const;
268 bool isInChildFrameWithFrameFlattening() const;
270 static double currentPaintTimeStamp() { return sCurrentPaintTimeStamp; } // returns 0 if not painting
272 void updateLayoutAndStyleIfNeededRecursive();
274 void incrementVisuallyNonEmptyCharacterCount(unsigned);
275 void incrementVisuallyNonEmptyPixelCount(const IntSize&);
276 void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; }
277 bool isVisuallyNonEmpty() const { return m_isVisuallyNonEmpty; }
278 void enableAutoSizeMode(bool enable, const IntSize& minSize, const IntSize& maxSize);
280 void forceLayout(bool allowSubtree = false);
281 void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkFactor, AdjustViewSizeOrNot);
283 // FIXME: This method is retained because of embedded WebViews in AppKit. When a WebView is embedded inside
284 // some enclosing view with auto-pagination, no call happens to resize the view. The new pagination model
285 // needs the view to resize as a result of the breaks, but that means that the enclosing view has to potentially
286 // resize around that view. Auto-pagination uses the bounds of the actual view that's being printed to determine
287 // the edges of the print operation, so the resize is necessary if the enclosing view's bounds depend on the
288 // web document's bounds.
290 // This is already a problem if the view needs to be a different size because of printer fonts or because of print stylesheets.
291 // Mail/Dictionary work around this problem by using the _layoutForPrinting SPI
292 // to at least get print stylesheets and printer fonts into play, but since WebKit doesn't know about the page offset or
293 // page size, it can't actually paginate correctly during _layoutForPrinting.
295 // We can eventually move Mail to a newer SPI that would let them opt in to the layout-time pagination model,
296 // but that doesn't solve the general problem of how other AppKit views could opt in to the better model.
298 // NO OTHER PLATFORM BESIDES MAC SHOULD USE THIS METHOD.
299 void adjustPageHeightDeprecated(float* newBottom, float oldTop, float oldBottom, float bottomLimit);
301 bool scrollToFragment(const KURL&);
302 bool scrollToAnchor(const String&);
303 void maintainScrollPositionAtAnchor(Node*);
304 void scrollElementToRect(Element*, const IntRect&);
306 // Methods to convert points and rects between the coordinate space of the renderer, and this view.
307 virtual IntRect convertFromRenderer(const RenderObject*, const IntRect&) const;
308 virtual IntRect convertToRenderer(const RenderObject*, const IntRect&) const;
309 virtual IntPoint convertFromRenderer(const RenderObject*, const IntPoint&) const;
310 virtual IntPoint convertToRenderer(const RenderObject*, const IntPoint&) const;
312 bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { return m_scrollCorner == scrollCorner; }
314 enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule };
315 void calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy = AnyRule);
318 static void setRepaintThrottlingDeferredRepaintDelay(double p);
319 // Negative value would mean that first few repaints happen without a delay
320 static void setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(double p);
321 // The delay grows on each repaint to this maximum value
322 static void setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(double p);
323 // On each repaint the delay increses by this amount
324 static void setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(double p);
326 virtual IntPoint lastKnownMousePosition() const;
328 virtual bool scrollbarsCanBeActive() const OVERRIDE;
330 // FIXME: Remove this method once plugin loading is decoupled from layout.
331 void flushAnyPendingPostLayoutTasks();
333 virtual bool shouldSuspendScrollAnimations() const;
334 virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate);
336 void setAnimatorsAreActive();
338 RenderBox* embeddedContentBox() const;
340 void setTracksRepaints(bool);
341 bool isTrackingRepaints() const { return m_isTrackingRepaints; }
342 void resetTrackedRepaints();
343 const Vector<IntRect>& trackedRepaintRects() const { return m_trackedRepaintRects; }
344 String trackedRepaintRectsAsText() const;
346 typedef HashSet<ScrollableArea*> ScrollableAreaSet;
347 void addScrollableArea(ScrollableArea*);
348 void removeScrollableArea(ScrollableArea*);
349 bool containsScrollableArea(ScrollableArea*) const;
350 const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.get(); }
352 virtual void removeChild(Widget*) OVERRIDE;
354 // This function exists for ports that need to handle wheel events manually.
355 // On Mac WebKit1 the underlying NSScrollView just does the scrolling, but on most other platforms
356 // we need this function in order to do the scroll ourselves.
357 bool wheelEvent(const PlatformWheelEvent&);
359 void setScrollingPerformanceLoggingEnabled(bool);
361 // Page and FrameView both store a Pagination value. Page::pagination() is set only by API,
362 // and FrameView::pagination() is set only by CSS. Page::pagination() will affect all
363 // FrameViews in the page cache, but FrameView::pagination() only affects the current
364 // FrameView. FrameView::pagination() will return m_pagination if it has been set. Otherwise,
365 // it will return Page::pagination() since currently there are no callers that need to
366 // distinguish between the two.
367 const Pagination& pagination() const;
368 void setPagination(const Pagination&);
370 bool inProgrammaticScroll() const { return m_inProgrammaticScroll; }
371 void setInProgrammaticScroll(bool programmaticScroll) { m_inProgrammaticScroll = programmaticScroll; }
373 #if ENABLE(CSS_FILTERS)
374 void setHasSoftwareFilters(bool hasSoftwareFilters) { m_hasSoftwareFilters = hasSoftwareFilters; }
375 bool hasSoftwareFilters() const { return m_hasSoftwareFilters; }
377 #if ENABLE(CSS_DEVICE_ADAPTATION)
378 IntSize initialViewportSize() const { return m_initialViewportSize; }
379 void setInitialViewportSize(const IntSize& size) { m_initialViewportSize = size; }
383 virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
384 virtual void scrollContentsSlowPath(const IntRect& updateRect);
386 virtual bool isVerticalDocument() const;
387 virtual bool isFlippedDocument() const;
390 explicit FrameView(Frame*);
395 virtual bool isFrameView() const;
397 friend class RenderWidget;
398 bool useSlowRepaints(bool considerOverlap = true) const;
399 bool useSlowRepaintsIfNotOverlapped() const;
400 void updateCanBlitOnScrollRecursively();
401 bool contentsInCompositedLayer() const;
403 bool shouldUpdateFixedElementsAfterScrolling();
405 void applyOverflowToViewport(RenderObject*, ScrollbarMode& hMode, ScrollbarMode& vMode);
406 void applyPaginationToViewport();
408 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
410 void paintControlTints();
412 void forceLayoutParentViewIfNeeded();
413 void performPostLayoutTasks();
414 void autoSizeIfEnabled();
416 virtual void repaintContentRectangle(const IntRect&, bool immediate);
417 virtual void contentsResized() OVERRIDE;
418 virtual void visibleContentsResized();
420 virtual void delegatesScrollingDidChange();
422 // Override ScrollView methods to do point conversion via renderers, in order to
423 // take transforms into account.
424 virtual IntRect convertToContainingView(const IntRect&) const OVERRIDE;
425 virtual IntRect convertFromContainingView(const IntRect&) const OVERRIDE;
426 virtual IntPoint convertToContainingView(const IntPoint&) const OVERRIDE;
427 virtual IntPoint convertFromContainingView(const IntPoint&) const OVERRIDE;
429 // ScrollableArea interface
430 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE;
431 virtual bool isActive() const OVERRIDE;
432 virtual void getTickmarks(Vector<IntRect>&) const OVERRIDE;
433 virtual void scrollTo(const IntSize&) OVERRIDE;
434 virtual void setVisibleScrollerThumbRect(const IntRect&) OVERRIDE;
435 virtual ScrollableArea* enclosingScrollableArea() const OVERRIDE;
436 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE;
437 virtual bool scrollAnimatorEnabled() const OVERRIDE;
438 #if USE(ACCELERATED_COMPOSITING)
439 virtual GraphicsLayer* layerForHorizontalScrollbar() const OVERRIDE;
440 virtual GraphicsLayer* layerForVerticalScrollbar() const OVERRIDE;
441 virtual GraphicsLayer* layerForScrollCorner() const OVERRIDE;
442 #if ENABLE(RUBBER_BANDING)
443 virtual GraphicsLayer* layerForOverhangAreas() const OVERRIDE;
447 void updateScrollableAreaSet();
449 virtual void notifyPageThatContentAreaWillPaint() const;
451 bool shouldUseLoadTimeDeferredRepaintDelay() const;
452 void deferredRepaintTimerFired(Timer<FrameView>*);
453 void doDeferredRepaints();
454 void updateDeferredRepaintDelayAfterRepaint();
455 double adjustedDeferredRepaintDelay() const;
457 bool updateWidgets();
458 void updateWidget(RenderEmbeddedObject*);
459 void scrollToAnchor();
460 void scrollPositionChanged();
462 bool hasCustomScrollbars() const;
464 virtual void updateScrollCorner();
466 FrameView* parentFrameView() const;
468 bool doLayoutWithFrameFlattening(bool allowSubtree);
470 void setViewportConstrainedObjectsNeedLayout();
472 virtual AXObjectCache* axObjectCache() const;
473 void notifyWidgetsInAllFrames(WidgetNotification);
474 void removeFromAXObjectCache();
476 static double sCurrentPaintTimeStamp; // used for detecting decoded resource thrash in the cache
479 LayoutSize m_margins;
481 typedef HashSet<RenderEmbeddedObject*> RenderEmbeddedObjectSet;
482 OwnPtr<RenderEmbeddedObjectSet> m_widgetUpdateSet;
483 RefPtr<Frame> m_frame;
485 bool m_doFullRepaint;
487 bool m_canHaveScrollbars;
488 bool m_cannotBlitToWindow;
490 bool m_contentIsOpaque;
491 unsigned m_slowRepaintObjectCount;
495 Timer<FrameView> m_layoutTimer;
496 bool m_delayedLayout;
497 RenderObject* m_layoutRoot;
499 bool m_layoutSchedulingEnabled;
501 bool m_doingPreLayoutStyleUpdate;
502 bool m_inSynchronousPostLayout;
504 unsigned m_nestedLayoutCount;
505 Timer<FrameView> m_postLayoutTasksTimer;
506 bool m_firstLayoutCallbackPending;
509 bool m_isTransparent;
510 Color m_baseBackgroundColor;
511 IntSize m_lastViewportSize;
512 float m_lastZoomFactor;
515 String m_mediaTypeWhenNotPrinting;
517 OwnPtr<FrameActionScheduler> m_actionScheduler;
519 bool m_overflowStatusDirty;
520 bool m_horizontalOverflow;
521 bool m_verticalOverflow;
522 RenderObject* m_viewportRenderer;
524 Pagination m_pagination;
526 bool m_wasScrolledByUser;
527 bool m_inProgrammaticScroll;
528 bool m_safeToPropagateScrollToParent;
530 unsigned m_deferringRepaints;
531 unsigned m_repaintCount;
532 Vector<LayoutRect> m_repaintRects;
533 Timer<FrameView> m_deferredRepaintTimer;
534 double m_deferredRepaintDelay;
535 double m_lastPaintTime;
537 unsigned m_disableRepaints;
539 bool m_isTrackingRepaints; // Used for testing.
540 Vector<IntRect> m_trackedRepaintRects;
542 bool m_shouldUpdateWhileOffscreen;
544 unsigned m_deferSetNeedsLayouts;
545 bool m_setNeedsLayoutWasDeferred;
547 RefPtr<Node> m_nodeToDraw;
548 PaintBehavior m_paintBehavior;
551 unsigned m_visuallyNonEmptyCharacterCount;
552 unsigned m_visuallyNonEmptyPixelCount;
553 bool m_isVisuallyNonEmpty;
554 bool m_firstVisuallyNonEmptyLayoutCallbackPending;
556 RefPtr<Node> m_maintainScrollPositionAnchor;
558 // Renderer to hold our custom scroll corner.
559 RenderScrollbarPart* m_scrollCorner;
561 // If true, automatically resize the frame view around its content.
562 bool m_shouldAutoSize;
564 // True if autosize has been run since m_shouldAutoSize was set.
565 bool m_didRunAutosize;
566 // The lower bound on the size when autosizing.
567 IntSize m_minAutoSize;
568 // The upper bound on the size when autosizing.
569 IntSize m_maxAutoSize;
571 OwnPtr<ScrollableAreaSet> m_scrollableAreas;
572 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects;
574 static double s_normalDeferredRepaintDelay;
575 static double s_initialDeferredRepaintDelayDuringLoading;
576 static double s_maxDeferredRepaintDelayDuringLoading;
577 static double s_deferredRepaintDelayIncrementDuringLoading;
579 #if ENABLE(CSS_FILTERS)
580 bool m_hasSoftwareFilters;
582 #if ENABLE(CSS_DEVICE_ADAPTATION)
583 // Size of viewport before any UA or author styles have overridden
584 // the viewport given by the window or viewing area of the UA.
585 IntSize m_initialViewportSize;
589 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count)
591 if (m_isVisuallyNonEmpty)
593 m_visuallyNonEmptyCharacterCount += count;
594 // Use a threshold value to prevent very small amounts of visible content from triggering didFirstVisuallyNonEmptyLayout.
595 // The first few hundred characters rarely contain the interesting content of the page.
596 static const unsigned visualCharacterThreshold = 200;
597 if (m_visuallyNonEmptyCharacterCount > visualCharacterThreshold)
598 setIsVisuallyNonEmpty();
601 inline void FrameView::incrementVisuallyNonEmptyPixelCount(const IntSize& size)
603 if (m_isVisuallyNonEmpty)
605 m_visuallyNonEmptyPixelCount += size.width() * size.height();
606 // Use a threshold value to prevent very small amounts of visible content from triggering didFirstVisuallyNonEmptyLayout
607 static const unsigned visualPixelThreshold = 32 * 32;
608 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
609 setIsVisuallyNonEmpty();
612 inline int FrameView::mapFromLayoutToCSSUnits(LayoutUnit value)
614 return value / (m_frame->pageZoomFactor() * m_frame->frameScaleFactor());
617 inline LayoutUnit FrameView::mapFromCSSToLayoutUnits(int value)
619 return value * m_frame->pageZoomFactor() * m_frame->frameScaleFactor();
622 } // namespace WebCore
624 #endif // FrameView_h